/**
 * 初始化channelplanMemberEducation详情对话框
 */
var ChannelplanMemberEductionInfoDlg = {
    channelplanMemberEductionInfoData : {}
};

/**
 * 清除数据
 */
ChannelplanMemberEductionInfoDlg.clearData = function() {
    this.channelplanMemberEductionInfoData = {};
}

/**
 * 设置对话框中的数据
 *
 * @param key 数据的名称
 * @param val 数据的具体值
 */
ChannelplanMemberEductionInfoDlg.set = function(key, val) {
    this.channelplanMemberEductionInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
    return this;
}

/**
 * 设置对话框中的数据
 *
 * @param key 数据的名称
 * @param val 数据的具体值
 */
ChannelplanMemberEductionInfoDlg.get = function(key) {
    return $("#" + key).val();
}

/**
 * 关闭此对话框
 */
ChannelplanMemberEductionInfoDlg.close = function() {
    parent.layer.close(window.parent.ChannelplanMemberEduction.layerIndex);
}

/**
 * 收集数据
 */
ChannelplanMemberEductionInfoDlg.collectData = function() {
    this
    .set('id')
    .set('memberId')
    .set('degree')
    .set('startTime')
    .set('endTime')
    .set('country')
    .set('college')
    .set('major')
    .set('descriptione')
    .set('createTime')
    .set('createUser')
    .set('updateTime')
    .set('updateUser');
}

/**
 * 提交添加
 */
ChannelplanMemberEductionInfoDlg.addSubmit = function() {

    this.clearData();
    this.collectData();

    //提交信息
    var ajax = new $ax(Feng.ctxPath + "/api/channelplanMemberEduction/add", function(data){
        Feng.success("添加成功!");
        window.parent.ChannelplanMemberEduction.table.refresh();
        ChannelplanMemberEductionInfoDlg.close();
    },function(data){
        Feng.error("添加失败!" + data.responseJSON.message + "!");
    });
    ajax.set(this.channelplanMemberEductionInfoData);
    ajax.start();
}

/**
 * 提交修改
 */
ChannelplanMemberEductionInfoDlg.editSubmit = function() {

    this.clearData();
    this.collectData();

    //提交信息
    var ajax = new $ax(Feng.ctxPath + "/api/channelplanMemberEduction/update", function(data){
        Feng.success("修改成功!");
        window.parent.ChannelplanMemberEduction.table.refresh();
        ChannelplanMemberEductionInfoDlg.close();
    },function(data){
        Feng.error("修改失败!" + data.responseJSON.message + "!");
    });
    ajax.set(this.channelplanMemberEductionInfoData);
    ajax.start();
}

$(function() {

});
