protected void btnAdd_Click(object sender, EventArgs e)
 {
     MBusinessTypeData model = new MBusinessTypeData();
     MBusinessTypeBB businessTypeBB = new MBusinessTypeBB();
     try
     {
         if (this.State == "1")
         {
             this.SetModel(ref model);
             businessTypeBB.AddRecord(model);
         }
         else if (this.State == "2")
         {
             model = businessTypeBB.GetModel(this.IdValue);
             this.SetModel(ref model);
             businessTypeBB.ModifyRecord(model);
         }
     }
     catch (Exception ex)
     {
         this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",4);", true);
         return;
     }
     finally
     {
         businessTypeBB.Dispose();
     }
 }
 private void ShowInfo(string id)
 {
     MBusinessTypeBB businessTypeBB = new MBusinessTypeBB();
     MBusinessTypeData model = new MBusinessTypeData();
     try
     {
         model = businessTypeBB.GetModel(id);
         this.messageNo.Text = model.messageNo;
         this.messageNm.Text = model.messageNm;
         this.tableNm.Text = model.tableNm;
         this.recordKeyField.Text = model.recordKeyField;
         this.keyIsInt.Text = model.keyIsInt.ToString();
         this.titleField.Text = model.titleField;
         this.itemNo.Text = model.itemNo;
         this.remark.Text = model.remark;
         this.isRun.Text = model.isRun.ToString();
     }
     finally
     {
         businessTypeBB.Dispose();
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
         {
             this.IdValue = Request.Params["id"];
         }
         if (Request.Params["state"] != null && Request.Params["state"].Trim() != string.Empty)
         {
             this.State = Request.Params["state"].ToString();
             switch (this.State)
             {
                 case "1":   //add
                     break;
                 case "2":   //update
                     //���ؿؼ�
                     MBusinessTypeBB businessTypeBB = new MBusinessTypeBB();
                     MBusinessTypeData businessTypeData = new MBusinessTypeData();
                     try
                     {
                         businessTypeData = businessTypeBB.GetModel(this.IdValue);
                         //����й��������˴�Ҫ��֤�Ƿ������޸�
                         this.ShowInfo(this.IdValue);
                     }
                     finally
                     {
                         businessTypeBB.Dispose();
                     }
                     break;
                 default:
                     break;
             }
         }
     }
     this.BindGrid(this.IdValue);
 }