protected void btnSave_Click(object sender, EventArgs e) { if (this.txtRoleName.Text.Trim().Length <= 0) { MessageBox.ShowFailTip(this, SysManage.ErrorRoleIsNull); } else { try { Role role = new Role(); if (!role.RoleExists(this.txtRoleName.Text.Trim())) { role.Description = this.txtRoleName.Text; role.Create(); LogHelp.AddUserLog(base.CurrentUser.UserName, base.CurrentUser.UserType, string.Format("添加角色:【{0}】", this.txtRoleName.Text), this); MessageBox.ShowSuccessTip(this, Site.TooltipSaveOK); } else { MessageBox.ShowFailTip(this, Site.TooltipDataExist); } } catch (Exception exception) { this.lblToolTip.Text = exception.Message; return; } this.txtRoleName.Text = ""; this.dataBind(); } }
protected void btnSave_Click(object sender, EventArgs e) { if(txtRoleName.Text.Trim().Length<=0) { Maticsoft.Common.MessageBox.Show(this,"角色为空不能保存"); return; } Role role = new Role(); role.Description = txtRoleName.Text; try { role.Create(); Maticsoft.Common.MessageBox.Show(this, Resources.Site.TooltipSaveOK); } catch(Exception ex) { lblToolTip.Text = ex.Message; return; } txtRoleName.Text = ""; dataBind(); }