Пример #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(this.teRoleName.Text.Trim()))
                {
                    XtraMessageBox.Show("teRoleName is empty!", "提示", MessageBoxButtons.OK);
                    return;
                }

                int res = _bll.AddRoles(new RolesVM()
                {
                    Name = this.teRoleName.Text.Trim(),
                });

                if (res > 0)
                {
                    XtraMessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK);
                    this.teRoleName.Text = string.Empty;
                    RequestGridData();
                }
                else
                {
                    XtraMessageBox.Show("保存失败!", "提示", MessageBoxButtons.OK);
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.ToString(), "提示", MessageBoxButtons.OK);
            }
        }