Example #1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (CheckSave())
     {
         bool retValue = true;
         FunctionController controler = new FunctionController();
         FunctionEntity     fun       = new FunctionEntity();
         fun.OID = hdfOID.Value;
         fun.FUNCTIONPARENTID = hfParentOID.Value;
         fun.FUNCTIONKEY      = txtFuncCode.Text.Trim();
         fun.FUNCTIONLEVEL    = Convert.ToInt32(txtFuncLevel.Text.Trim());
         fun.FUNCTIONNAME     = txtFuncName.Text.Trim();
         fun.FUNCTIONORDER    = Convert.ToInt32(txtFuncOrder.Text.Trim());
         fun.FUNCTIONSTATUS   = drpFuncStatus.SelectedValue;
         fun.FUNCTIONTYPE     = 0;
         fun.FUNCTIONURL      = txtFuncUrl.Text.Trim();
         fun.MEMO             = txtFuncMemo.Text.Trim();
         fun.CUSER            = AppCenter.CurrentPersonAccount;
         fun.MUSER            = AppCenter.CurrentPersonAccount;
         if (string.IsNullOrEmpty(fun.OID))
         {
             fun.OID  = Guid.NewGuid().ToString();
             retValue = controler.InsertFunction(fun);
         }
         else
         {
             retValue = controler.UpdateFunction(fun);
         }
         if (retValue)
         {
             base.ShowMessage(CommonMessage.SaveSuccess);
             this.ClearAllControls();
             this.BindTree();
         }
         else
         {
             base.ShowMessage(CommonMessage.SaveFailed);
         }
     }
 }