예제 #1
0
        /// <summary>
        /// 添加
        /// </summary>
        private void addRole()
        {
            try
            {
                if (checkInput())
                {
                    SysRole role = new SysRole();

                    role.R_Code   = R_Code.Text;
                    role.R_Name   = R_Name.Text;
                    role.R_Remark = R_Remark.Text;

                    role.R_CreateBy   = R_CreateBy.Text;
                    role.R_CreateDate = R_CreateDate.Value;
                    role.R_UpdateBy   = null;
                    role.R_UpdateDate = null;

                    SysRoleBLL rolebll = new SysRoleBLL();
                    if (rolebll.Exists(role.R_Code))
                    {
                        untCommon.InfoMsg("角色编号已存在!");
                    }
                    else
                    {
                        if (rolebll.Add(role) > 0)
                        {
                            untCommon.InfoMsg("添加成功!");
                            frmParent.loadData();
                        }
                        else
                        {
                            untCommon.InfoMsg("添加失败!");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                untCommon.ErrorMsg("角色管理添加数据异常:" + ex);
            }
        }