username@email.com
2025-05-21 a980cd04341d71216e0f59bd4b7327fe9fc50032
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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);
            }
        }
 
 
    }
}