예제 #1
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         var customerRole = new HozestERP.BusinessLogic.CustomerManagement.CustomerRole()
         {
             Name                 = this.txtName.Text,
             Description          = this.txtDescription.Text,
             Code                 = string.Empty,
             Deleted              = false,
             Active               = this.chkActive.Checked,
             CreateStaff          = HozestERPContext.Current.User.CustomerID,
             CreateDate           = DateTime.Now,
             ParentCustomerRoleID = int.Parse(this.dropDownField.Value.ToString())
         };
         this.SaveRoleAlertType(customerRole.CustomerRoleID);
         base.CustomerService.InsertCustomerRole(customerRole);
         this.SaveCustomerRoleModule(customerRole.CustomerRoleID);
         X.MessageBox.Show(new MessageBoxConfig()
         {
             Title   = "提示信息",
             Message = "模块设置成功!",
             Icon    = MessageBox.Icon.INFO,
             Buttons = MessageBox.Button.OK,
         });
         this._CustomerRoleID = customerRole.CustomerRoleID;
         this.ResourceManager2.AddScript("#{GridPanel1}.save();window.parent.RefreshCustomerRoleTree();window.location='CustomerRoleModule.aspx?CustomerRoleID=" + customerRole.CustomerRoleID + "';");
     }
     catch (Exception err)
     {
         base.ProcessException(err);
     }
 }
예제 #2
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         var customerRole = new HozestERP.BusinessLogic.CustomerManagement.CustomerRole()
         {
             Name                 = this.txtName.Text,
             Description          = this.txtDescription.Text,
             Code                 = string.Empty,
             Deleted              = false,
             Active               = this.chkActive.Checked,
             CreateStaff          = HozestERPContext.Current.User.CustomerID,
             CreateDate           = DateTime.Now,
             ParentCustomerRoleID = int.Parse(this.ddlParentCustomerRole.SelectedValue)
         };
         base.CustomerService.InsertCustomerRole(customerRole);
         this.Master.JsWrite("alert('保存成功.');window.parent.RefreshCustomerRoleTree();window.location='CustomerRoleDetails.aspx?CustomerRoleID=" + customerRole.CustomerRoleID + "';", "");
     }
 }