/**
 * 初始化channelplanMemberInfo详情对话框
 */
var ChannelplanMemberInfoInfoDlg = {
    channelplanMemberInfoInfoData : {}
};

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

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

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

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

/**
 * 收集数据
 */
ChannelplanMemberInfoInfoDlg.collectData = function() {
    this
    .set('id')
    .set('cpId')
    .set('cName')
    .set('eName')
    .set('sex')
    .set('birthday')
    .set('birthplace')
    .set('photoUrl')
    .set('nationality')
    .set('cGraduate')
    .set('eGraduate')
    .set('cWorkUnit')
    .set('eWorkUnit')
    .set('education')
    .set('companyName')
    .set('post')
    .set('companyAddress')
    .set('zipCode')
    .set('field')
    .set('workTime')
    .set('memberType')
    .set('fieldSummary')
    .set('developProduct')
    .set('publishThesis')
    .set('getAwardsDetail')
    .set('banProtocol')
    .set('description')
    .set('createTime')
    .set('createUser')
    .set('updateTime')
    .set('updateUser');
}

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

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

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

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

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

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

$(function() {

});
