- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections.Generic;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- public partial class CRMEdit : System.Web.UI.Page
- {
- //模板
- Model.CRM MR = new Model.CRM();
- //业务
- BLL.CRM BR = new BLL.CRM();
- public int MRID
- {
- get
- {
- if (ViewState["CRMMRID"] == null)
- {
- return 0;
- }
- else
- {
- return int.Parse(ViewState["CRMMRID"].ToString());
- }
- }
- set { ViewState["CRMMRID"] = value; }
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- LoginLogic.MatchLoad("../", "CRMEdit");
- if (!IsPostBack)
- {
- object objid = Request.QueryString["id"];
- if (objid != null)
- {
- int ri = int.Parse(objid.ToString());
- MR = BR.GetModel(ri);
- MRID = MR.ID;
- KeyValue_XM.Text = MR.XM;
- KeyValue_NC.Text = MR.NC;
- KeyValue_XB.Text = MR.XB;
- KeyValue_GDDH.Text = MR.GDDH;
- KeyValue_SJHM.Text = MR.SJHM;
- KeyValue_Email.Text = MR.Email;
- KeyValue_QQ.Text = MR.QQ;
- KeyValue_MSN.Text = MR.MSN;
- KeyValue_BZ.Text = MR.BZ;
- KeyValue_GS.Text = MR.GS;
- KeyValue_DZ.Text = MR.DZ;
- KeyValue_WZ.Text = MR.WZ;
- KeyValue_FL.Text = MR.FL;
- KeyValue_XXDZ.Text = MR.XXDZ;
- //"127.0.0.1" = MR.DLIP;
- //DateTime.Now = MR.TJSJ;
- //SessionInclude.SessionId = MR.KFID;
- KeyValue_WYID.Text = MR.WYID.ToString();
- KeyValue_ZHJHM.Text = MR.ZHJHM;
- }
- }
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- try
- {
- int ri = int.Parse(Request.QueryString["id"].ToString());
- MR = BR.GetModel(ri);
- int iWYID = 0;
- if (!int.TryParse(KeyValue_WYID.Text, out iWYID))
- {
- throw new Exception("内部系统ID必须为数字!");
- }
- MR.XM = KeyValue_XM.Text;
- MR.NC = KeyValue_NC.Text;
- MR.XB = KeyValue_XB.Text;
- MR.GDDH = KeyValue_GDDH.Text;
- MR.SJHM = KeyValue_SJHM.Text;
- MR.Email = KeyValue_Email.Text;
- MR.QQ = KeyValue_QQ.Text;
- MR.MSN = KeyValue_MSN.Text;
- MR.BZ = KeyValue_BZ.Text;
- MR.GS = KeyValue_GS.Text;
- MR.DZ = KeyValue_DZ.Text;
- MR.WZ = KeyValue_WZ.Text;
- MR.FL = KeyValue_FL.Text;
- MR.XXDZ = KeyValue_XXDZ.Text;
- MR.DLIP = "127.0.0.1";
- MR.TJSJ = DateTime.Now;
- MR.KFID = SessionInclude.SessionId;
- MR.WYID = iWYID;
- MR.ZHJHM = KeyValue_ZHJHM.Text;
- BR.Update(MR);
- MessageBox.Show("更新成功", "CRMManager.aspx");
- }
- catch (Exception exp)
- {
- MessageBox.Show(exp.Message);
- }
- }
- }