using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Web;
|
using System.Web.UI;
|
using System.Web.UI.WebControls;
|
using CY.Model;
|
using CY.BLL;
|
using CY.Infrastructure.Common;
|
using System.Data;
|
using CY.BLL.Sys;
|
using CY.BLL.OA;
|
|
namespace CY.WebForm.Pages.member
|
{
|
//吴辉
|
//添加/修改配置信息
|
public partial class MemberDictionaryEdit : BasePage
|
{
|
EC_MemberDictionaryBLL bll_EC_MemberDictionaryBLL = null;
|
Sys_DictionaryBLL bll_Sys_DictionaryBLL = null;
|
|
//初始化
|
public MemberDictionaryEdit()
|
{
|
bll_EC_MemberDictionaryBLL = new EC_MemberDictionaryBLL();
|
bll_Sys_DictionaryBLL = new Sys_DictionaryBLL();
|
}
|
|
//页面加载
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
if (!IsPostBack)
|
{
|
InitData();
|
}
|
}
|
|
//页面加载
|
public void InitData()
|
{
|
this.selParType.DataSource = bll_Sys_DictionaryBLL.GetDataByType("会员配置表类型");
|
this.selParType.DataValueField = "Name";
|
this.selParType.DataTextField = "Name";
|
this.selParType.DataBind();
|
|
EC_MemberDictionary m_EC_MemberDictionary = new EC_MemberDictionary();
|
if (Request["Keyid"] != null && Request["Keyid"].ToInt32() > 0)
|
m_EC_MemberDictionary = bll_EC_MemberDictionaryBLL.GetModelByKeyid(Request["Keyid"].ToInt32());
|
|
this.txtParName.Value = m_EC_MemberDictionary.ParName.ToString2();
|
this.selParType.Value = m_EC_MemberDictionary.ParType.ToString2();
|
|
}
|
|
//提交事件
|
protected void btn_Submit_form(object sender, EventArgs e)
|
{
|
EC_MemberDictionary m_EC_MemberDictionary = bll_EC_MemberDictionaryBLL.GetModelByKeyid(Request["Keyid"].ToInt32());
|
if (m_EC_MemberDictionary == null)
|
{
|
m_EC_MemberDictionary = new EC_MemberDictionary();
|
m_EC_MemberDictionary.MemberId = CurrentUser.MemberId;
|
}
|
|
m_EC_MemberDictionary.ParName = this.txtParName.Value.ToString2();
|
m_EC_MemberDictionary.ParType = this.selParType.Value.ToString2();
|
m_EC_MemberDictionary.Operator =CurrentUser.ShortName;
|
m_EC_MemberDictionary.LastUpdateTime = DateTime.Now;
|
|
if (Request["Keyid"] != null && Request["Keyid"].ToInt32() > 0)
|
{
|
if (bll_EC_MemberDictionaryBLL.UpdateModel(m_EC_MemberDictionary))
|
JavaScript.MessageBox("更新成功", this,true,true);
|
else
|
JavaScript.MessageBox("更新失败", this);
|
}
|
else
|
{
|
if (bll_EC_MemberDictionaryBLL.InsertModel(m_EC_MemberDictionary))
|
{
|
this.txtParName.Value = "";
|
JavaScript.MessageBox("新增成功", this,false,true);
|
}
|
else
|
JavaScript.MessageBox("新增失败", this);
|
}
|
}
|
|
|
}
|
}
|