Пример #1
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     SCoprationData model = new SCoprationData();
     SCoprationBB coprationBB = new SCoprationBB();
     try
     {
         if (this.State == "1")
         {
             this.SetModel(ref model);
             model.isrtDt = DateTime.Now.ToString();
             model.isrtEmpId = this.currentUser.empId;
             coprationBB.AddRecord(model);
             this.State = "2";
         }
         else if (this.State == "2")
         {
             model = coprationBB.GetModel();
             this.SetModel(ref model);
             model.updtDt = DateTime.Now.ToString();
             model.updtEmpId = this.currentUser.empId;
             coprationBB.ModifyRecord(model);
         }
     }
     catch (Exception ex)
     {
         this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true);
         return;
     }
     finally
     {
         coprationBB.Dispose();
     }
 }