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); } } }
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; } }
private void frmHomePage_FormClosed(object sender, FormClosedEventArgs e) { staffLogin = null; rolePermissionObj = null; // this.Dispose(); this.Close(); }
private void frmHomePage_FormClosing(object sender, FormClosingEventArgs e) { new frmLogin().Show(); staffLogin = null; rolePermissionObj = null; // this.Dispose(); this.Close(); }
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); }
/// <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; } }
/// <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; } }
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; }
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; }
/// <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; } }
private void bbtnLogout_ItemClick(object sender, ItemClickEventArgs e) { if (xtraTabbedMdiManagerMenu.FloatForms.Count != 0) { XtraCustomMessageBox.Show("Vui lòng đóng tất cả các của sổ trước khi đăng xuất!", "Thông báo", false, 1); } else { DialogResult rs = XtraCustomMessageBox.Show("Bạn có muốn đăng xuất khỏi hệ thông?", "Thông báo", false, 2); if (rs == DialogResult.Yes) { new frmLogin().Show(); staffLogin = null; rolePermissionObj = null; // this.Dispose(); this.Close(); } else { return; } } }