/// <summary> /// 数据保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { LCustTagData model = new LCustTagData(); LCustTagBB custTagBB = new LCustTagBB(); try { if (this.State == "1") { this.SetModel(ref model); model.isrtDt = DateTime.Now.ToString(); model.isrtEmpId = this.currentUser.empId; model.smallTagSql = this.smallSQL.Text.ToString(); model.bigTagSql = this.bigSQL.Text.ToString(); this.IdValue = custTagBB.AddRecord(model); this.State = "1"; } else if (this.State == "2") { model = custTagBB.GetModel(this.IdValue); this.SetModel(ref model); model.updtDt = DateTime.Now.ToString(); model.updtEmpId = this.currentUser.empId; model.smallTagSql = this.smallSQL.Text.ToString(); model.bigTagSql = this.bigSQL.Text.ToString(); custTagBB.ModifyRecord(model); } } catch (Exception ex) { this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true); return; } finally { custTagBB.Dispose(); } Response.Redirect("LCustTagList.aspx?&itemno=" + this.itemNo + "&pTypeNo=main", false); }