Beispiel #1
0
        /// <summary>
        /// 保存
        /// </summary>
        private void btnSave_Click_1(object sender, EventArgs e)
        {
            if (CheckInput())
            {
                if (_currentRolesTable == null)
                {
                    _currentRolesTable = new BaseRolesTable();
                }
                _currentRolesTable.CODE             = txtCode.Text;
                _currentRolesTable.NAME             = txtName.Text;
                _currentRolesTable.MEMO             = txtMemo.Text;
                _currentRolesTable.LAST_UPDATE_USER = _userInfo.CODE;

                try
                {
                    if (bRoles.Exists(txtCode.Text.Trim()))
                    {
                        bRoles.Update(_currentRolesTable);
                    }
                    else
                    {
                        _currentRolesTable.CREATE_USER = _userInfo.CODE;
                        bRoles.Add(_currentRolesTable);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("");
                    return;
                }
                result = DialogResult.OK;
                this.Close();
            }
        }
Beispiel #2
0
        public string CheckRoles(string roles, string title)
        {
            if (roles == null || "".Equals(roles))
            {
                return(title + ERROR_NULL);
            }
            if (_rolesTable[roles.ToString()] != null)
            {
                return("");
            }
            BRoles bRoles = new BRoles();

            if (bRoles.Exists(roles))
            {
                _rolesTable.Add(roles, roles);
                return("");
            }
            return(title + ERROR_EXIST);
        }