protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //���ؿؼ� SSystemConfigBB systemConfigBB = new SSystemConfigBB(); SSystemConfigData systemConfigData = new SSystemConfigData(); try { systemConfigData = systemConfigBB.GetModel(); if (systemConfigData != null) { this.State = "2"; this.ShowInfo(systemConfigData); } else { this.State = "1"; } } finally { systemConfigBB.Dispose(); } } }
protected void btnAdd_Click(object sender, EventArgs e) { SSystemConfigData model = new SSystemConfigData(); SSystemConfigBB systemConfigBB = new SSystemConfigBB(); try { if (this.State == "1") { this.SetModel(ref model); model.updtDt = DateTime.Now.ToString(); model.updtEmpId = this.currentUser.empId; systemConfigBB.AddRecord(model); this.State = "2"; } else if (this.State == "2") { model = systemConfigBB.GetModel(); this.SetModel(ref model); model.updtDt = DateTime.Now.ToString(); model.updtEmpId = this.currentUser.empId; systemConfigBB.ModifyRecord(model); } } catch (Exception ex) { this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true); return; } finally { systemConfigBB.Dispose(); } }