private void btnSave_Click(object sender, EventArgs e)
        {
            if (!checkData())
            {
                return;
            }
            else
            {
                String rolePermissionName = Utils.standardNamePerson(txtRolePermissionName.Text);
                rolePermissionObject = new DTORolePermission("CV0000000", rolePermissionName);

                if (rolePermissionBUS.InsertRolePermission(rolePermissionObject))
                {
                    XtraCustomMessageBox.Show("Thêm dữ liệu thành công!", "Thông báo", true, 1);
                    btnAdd.Enabled = true;
                    btnCancelAdd.Enabled = false;
                    btnCancelAdd.Visible = false;
                    btnSave.Enabled = false;
                }
                else
                {
                    XtraCustomMessageBox.Show("Thêm dữ liệu thất bại!", "Lỗi", true, 4);
                }
            }
        }
Пример #2
0
 public frmCustomer()
 {
     InitializeComponent();
     rolePermissionDataTable = new DataTable();
     rolePermissionBUS = new BUSRolePermission();
     rolePermissionObject = new DTORolePermission();
     customerDataTable = new DataTable();
     customerBUS = new BUSCustomer();
     customerObject = new DTOCustomer();
     customerMultiSelect = new GridCheckMarksSelection(grdvListCustomer);
     ruleBUS = new BUSRule();
     CustomerSno.VisibleIndex = 1;
 }
Пример #3
0
 public frmSearchStaff()
 {
     InitializeComponent();
     rolePermissionDataTable = new DataTable();
     rolePermissionBUS = new BUSRolePermission();
     rolePermissionObject = new DTORolePermission();
     _StaffDT = new DataTable();
     staffBUS = new BUSStaff();
     staffObject = new DTOStaff();
     staffMultiSelect = new GridCheckMarksSelection(grdvListStaff);
     ruleBUS = new BUSRule();
     StaffSno.VisibleIndex = 1;
 }
Пример #4
0
        public DTORolePermission GetRolePermissionByPositionId(String strPositionId)
        {
            try
            {
                DTORolePermission rolePermissionObj;
                BUSRolePermission rolePermissionBUS = new BUSRolePermission();
                DataTable tb = rolePermissionBUS.GetRolePermissionById(strPositionId);
                if (tb.Rows.Count > 0)
                {
                    rolePermissionObj = new DTORolePermission();
                    if (!tb.Rows[0][3].ToString().Equals(""))
                    {
                        rolePermissionObj.SystemManager = Boolean.Parse(tb.Rows[0][3].ToString());
                        rolePermissionObj.ChangeRule = Boolean.Parse(tb.Rows[0][4].ToString());
                    }
                }
                else
                    return null;
                return rolePermissionObj;
            }
            catch (Exception)
            {

                throw;
            }
        }
Пример #5
0
 private void InitStaffObj()
 {
     staffBUS = new BUSStaff();
     rolePermissionDataTable = new DataTable();
     rolePermissionBUS = new BUSRolePermission();
     rolePermissionDTO = new DTORolePermission();
     rolePermissionDTO.RolePermissionID = frmHomePage.staffLogin.RolePermissionId;
     rolePermissionDTO.RolePermissionName = rolePermissionBUS.GetRolePermissionNameById(rolePermissionDTO.RolePermissionID);
 }
Пример #6
0
        /// <summary>
        /// Phương thức cập nhật một RolePermission xuống csdl theo id
        /// </summary>
        /// <returns>true: thêm mới thành công, false: thêm mới thất bại</returns>
        public bool UpdateRolePermission(DTORolePermission RolePermission)
        {
            try
            {
                return RolePermissionDAO.UpdateRolePermission(RolePermission);
            }
            catch (SqlException)
            {

                throw;
            }
        }
Пример #7
0
        /// <summary>
        /// Phương thức thêm mới một RolePermission vào csdl
        /// </summary>
        /// <returns>true: thêm mới thành công, false: thêm mới thất bại</returns>
        public bool InsertRolePermission(DTORolePermission RolePermission)
        {
            try
            {
                return RolePermissionDAO.InsertRolePermission(RolePermission);
            }
            catch (SqlException)
            {

                throw;
            }
        }
Пример #8
0
        /// <summary>
        /// Phương thức cập nhật một RolePermission xuống csdl theo id
        /// </summary>
        /// <returns>true: thêm mới thành công, false: thêm mới thất bại</returns>
        public bool UpdateRolePermission(DTORolePermission rolePermission)
        {
            try
            {
                DataExecute.Instance.createSqlCmd("sp_EditRolePermissionUpdate"/*Truyen vao storeprocedure*/, new object[2] { rolePermission.RolePermissionID, rolePermission.RolePermissionName });
                return DataExecute.Instance.updateData(DataConnection.Instance.m_cmd) > 0;
            }
            catch (SqlException)
            {

                throw;
            }
        }