private void GetLogin() { var TrungTam = BioNet_Bus.GetThongTinTrungTam(); var NgayServer = BioNet_Bus.GetDateTime(); DLLLicensePS.Reponse res = DLLLicensePS.DECRYPT.CheckLisences(TrungTam.ID, string.Empty, TrungTam.LicenseKey, NgayServer.Date.ToString("dd/MM/yyyy"), DateTime.Now.Date.ToString("dd/MM/yyy")); if (!res.Result) { XtraMessageBox.Show("Bản quyền phần mềm hết hạn,vui lòng liên hệ với nhà cung cấp! \r\n Thông tin chi tiết : " + res.ResultString, "BioNet - Chương trình sàng lọc sơ sinh!", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { if (res.TimeRemind < 7) { string str = @"Bản quyền phần mềm chỉ còn {0} ngày. Vui lòng liên hệ mua bản quyền để sử dụng phần mềm không bị gián đoạn!"; string mes = string.Format(str, res.TimeRemind); XtraMessageBox.Show(mes, "BioNet - Chương trình sàng lọc sơ sinh!", MessageBoxButtons.OK, MessageBoxIcon.Warning); } DiaglogFrm.FrmLogin frm = new DiaglogFrm.FrmLogin(); frm.ShowDialog(); if (!frm.cancel) { this.empCode = frm._EmployeeCode; List <PSMenuSecurity> lstMenuSecurity = new List <PSMenuSecurity>(); lstMenuSecurity = BioBLL.ListMenuSecurity(empCode); foreach (var item in lstMenuSecurity) { this.SetMenu(item.MenuCode); } } } }
private void gridControl_DonViCoSo_ProcessGridKey(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Delete && gridView_DonViCoSo.State != DevExpress.XtraGrid.Views.Grid.GridState.Editing) { if (XtraMessageBox.Show("Bạn có muốn xóa danh mục này hay không?", "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.No) { try { if (BioBLL.DelDonViCS(gridView_DonViCoSo.GetRowCellValue(gridView_DonViCoSo.FocusedRowHandle, "MaDVCS").ToString())) { this.gridControl_DonViCoSo.DataSource = BioBLL.GetListDonViCoSo(); } else { XtraMessageBox.Show("Xóa danh mục thất bại!", "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch { XtraMessageBox.Show("Xóa danh mục thất bại!", "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } } }
private int CheckLevelPositionWithPosCode(string empLogin) { try { PSEmployee employeeLogin = new PSEmployee(); employeeLogin = BioBLL.GetEmployeeByCode(empLogin); PSEmployeePosition postion = new PSEmployeePosition(); postion = BioBLL.GetPositionByCode(this.positionCode); int levelLogin = employeeLogin.PSEmployeePosition.Level; int level = postion.Level; if (levelLogin < level) { return(1); } else if (levelLogin == level) { return(-1); } else { return(0); } } catch { return(-2); } }
private int CheckLevelPositionWithEmpCode(string empLogin, string empCode) { try { if (empLogin == empCode) { return(2); } else { PSEmployee employeeLogin = new PSEmployee(); employeeLogin = BioBLL.GetEmployeeByCode(empLogin); PSEmployee employee = new PSEmployee(); employee = BioBLL.GetEmployeeByCode(empCode); int levelLogin = employeeLogin.PSEmployeePosition.Level; int level = employee.PSEmployeePosition.Level; if (levelLogin < level) { return(1); } else if (levelLogin == level) { return(-1); } else { return(0); } } } catch { return(-2); } }
private void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.idServicePackage)) { XtraMessageBox.Show("Chưa chọn gói dịch vụ!", "Bệnh viện điện tử .NET", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } List <string> lstService = new List <string>(); foreach (DataRow row in this.dtGoiDV.Rows) { if (Convert.ToBoolean(row["Check"])) { lstService.Add(row["IDDichVu"].ToString()); } } if (BioBLL.UpdDetailServicePackage(this.idServicePackage, lstService)) { XtraMessageBox.Show("Cập nhật chi tiết gói dịch vụ thành công!", "Bệnh viện điện tử .NET", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { XtraMessageBox.Show("Cập nhật chi tiết gói dịch vụ thất bại!", "Bệnh viện điện tử .NET", MessageBoxButtons.OK, MessageBoxIcon.Error); CheckService(this.idServicePackage); } }
private void gridControl_ChiCuc_ProcessGridKey(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Delete && gridView_ChiCuc.State != DevExpress.XtraGrid.Views.Grid.GridState.Editing) { if (XtraMessageBox.Show("Bạn có muốn xóa danh mục này hay không?", "Bệnh viện điện tử .NET", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.No) { try { if (BioBLL.DelChiCuc(gridView_ChiCuc.GetRowCellValue(gridView_ChiCuc.FocusedRowHandle, "MaChiCuc").ToString())) { this.gridControl_ChiCuc.DataSource = BioBLL.GetListChiCuc(); } else { XtraMessageBox.Show("Xóa danh mục thất bại!", "Bệnh viện điện tử .NET", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch { XtraMessageBox.Show("Xóa danh mục thất bại!", "Bệnh viện điện tử .NET", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } } }
private void gridView_Info_DoubleClick(object sender, EventArgs e) { this.maBenhNhan = gridView_Info.GetRowCellValue(gridView_Info.FocusedRowHandle, "MaBenhNhan").ToString(); PSPatient infoPerson = BioBLL.GetInfoPersonByMa(maBenhNhan); txtTenMe.Text = infoPerson.MotherName; txtTenCha.Text = infoPerson.FatherName; txtNamSinhMe.EditValue = !string.IsNullOrEmpty(infoPerson.MotherBirthday.ToString())? Convert.ToDateTime(infoPerson.MotherBirthday).ToString("dd/MM/yyyy") : string.Empty; txtNamSinhCha.EditValue = !string.IsNullOrEmpty(infoPerson.FatherBirthday.ToString())? Convert.ToDateTime(infoPerson.FatherBirthday).ToString("dd/MM/yyyy") : string.Empty; txtSDTMe.Text = infoPerson.MotherPhoneNumber; txtSDTCha.Text = infoPerson.FatherPhoneNumber; txtAddress.Text = infoPerson.DiaChi; txtTenBenhNhan.Text = infoPerson.TenBenhNhan; txtGioiTinh.EditValue = infoPerson.GioiTinh; txtGioSinhBenhNhan.EditValue = !string.IsNullOrEmpty(infoPerson.NgayGioSinh.ToString()) ? Convert.ToDateTime(infoPerson.NgayGioSinh).ToString("H:mm:ss") : string.Empty; txtNamSinhBenhNhan.EditValue = !string.IsNullOrEmpty(infoPerson.NgayGioSinh.ToString()) ? Convert.ToDateTime(infoPerson.NgayGioSinh).ToString("dd/MM/yyyy") : string.Empty; txtNoiSinh.Text = infoPerson.NoiSinh; lookUpDanToc.EditValue = infoPerson.DanTocID; txtTuan.Value = Convert.ToDecimal(infoPerson.TuanTuoiKhiSinh); txtNang.Text = infoPerson.CanNang.ToString(); cboPhuongPhapSinh.EditValue = infoPerson.PhuongPhapSinh; btnEdit.Enabled = true; ReadOnlyText(true); }
private void FrmDMDichVu_Load(object sender, EventArgs e) { this.repositoryItemLookUpEdit_Nhom.DataSource = BioBLL.GetListNhom(); this.repositoryItemLookUpEdit_Nhom.ValueMember = "RowIDNhom"; this.repositoryItemLookUpEdit_Nhom.DisplayMember = "TenNhom"; this.gridControl_DMDichVu.DataSource = BioBLL.GetListDichVu(); }
private void FrmDMThongSoXN_Load(object sender, EventArgs e) { this.repositoryItemLookUpEdit_nhom.DataSource = BioBLL.GetListNhom(); this.repositoryItemLookUpEdit_nhom.ValueMember = "RowIDNhom"; this.repositoryItemLookUpEdit_nhom.DisplayMember = "TenNhom"; this.gridControl_thongso.DataSource = BioBLL.GetListThongSoXN(); }
private bool CheckCodeExist(string maDonViCS) { if (!BioBLL.CheckExistCodeDVCS(maDonViCS)) { XtraMessageBox.Show("Mã đơn vị cơ sở đã tồn tại!", "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } return(true); }
private bool CheckCodeExist(string maChiCuc) { if (!BioBLL.CheckExistCode(maChiCuc)) { XtraMessageBox.Show("Mã chi cục đã tồn tại!", "Bệnh viện điện tử .NET", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } return(true); }
private void FrmDMGoiDichVuDonVi_Load(object sender, EventArgs e) { this.repositoryItemLookUpEdit_DonViCoSo.DataSource = BioBLL.GetListDonViCoSo(); this.repositoryItemLookUpEdit_DonViCoSo.ValueMember = "MaDVCS"; this.repositoryItemLookUpEdit_DonViCoSo.DisplayMember = "TenDVCS"; this.repositoryItemLookUpEdit_GoiDVChung.DataSource = BioBLL.GetListGoiDichVuChung(); this.repositoryItemLookUpEdit_GoiDVChung.ValueMember = "IDGoiDichVuChung"; this.repositoryItemLookUpEdit_GoiDVChung.DisplayMember = "TenGoiDichVuChung"; this.gridControl_GoiDVDonvi.DataSource = BioBLL.GetListGoiDichVuCoSo(); }
private void FrmDMGoiDichVuChiTiet_Load(object sender, EventArgs e) { gridControl_GoiDichVuChung.DataSource = BioBLL.GetListGoiDichVuChung(); this.dtGoiDV = BioBLL.GetListDichVu(); this.dtGoiDV.Columns.Add("Check", typeof(bool)); foreach (DataRow row in this.dtGoiDV.Rows) { row["Check"] = false; } gridControl_DichVu.DataSource = this.dtGoiDV; }
private void GetServerName() { string myServer = BioBLL.MyServerName(); DataTable servers = BioBLL.TableServerName(); if (servers != null && servers.Rows.Count > 0) { for (int i = 0; i < servers.Rows.Count; i++) { this.cbxServerName.Properties.Items.Add(servers.Rows[i]["ServerName"]); } this.cbxServerName.EditValue = myServer; } }
private void FrmStartup_Load(object sender, EventArgs e) { if (BioBLL.CheckConnection()) { this.GetLogin(); } else { DiaglogFrm.frmConfig frm = new DiaglogFrm.frmConfig(); frm.ShowDialog(this); if (frm.isConnected) { Application.Restart(); } } }
private void barButtonItem19_ItemClick(object sender, ItemClickEventArgs e) { if (BioBLL.CheckConnection()) { this.GetLogin(); } else { DiaglogFrm.frmConfig frm = new DiaglogFrm.frmConfig(); frm.ShowDialog(this); if (frm.isConnected) { Application.Restart(); } } }
private void CheckService(string id) { List <string> lstService = new List <string>(); lstService = BioBLL.GetListServicePackageByIDGoi(id).Select(x => x.IDDichVu).ToList(); foreach (DataRow row in this.dtGoiDV.Rows) { if (lstService.Contains(row["IDDichVu"].ToString())) { row["Check"] = true; } else { row["Check"] = false; } } }
private void gridControl_Employee_ProcessGridKey(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Delete && gridView_Employee.State != DevExpress.XtraGrid.Views.Grid.GridState.Editing) { if (XtraMessageBox.Show("Bạn có muốn xóa nhân viên này hay không?", "Bệnh viện điện tử .NET", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.No) { try { if (BioBLL.DelEmployee(gridView_Employee.GetRowCellValue(gridView_Employee.FocusedRowHandle, "EmployeeCode").ToString())) { gridControl_Employee.DataSource = BioBLL.DTEmployee(string.Empty); } } catch { return; } } } }
private void butOK_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.txtPassword.Text.Trim())) { XtraMessageBox.Show("Vui lòng nhập mật khẩu!", "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (string.IsNullOrEmpty(this.txtLyDo.Text.Trim())) { XtraMessageBox.Show("Vui lòng nhập lý do hủy mẫu!", "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } string pass = BioBLL.GetMD5(this.txtPassword.Text.Trim()); if (BioNet_Bus.XacThucNhanVien(this.maNV, pass)) { if (XtraMessageBox.Show("Bạn có chắn chắn muốn xóa mẫu này không?", "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { var res = BioNet_Bus.HuyMauPhieu(maPhieu, maTiepNhan, maDonVi, maNV, this.txtLyDo.Text.Trim()); if (res.Result) { XtraMessageBox.Show("Đã hủy mẫu của phiếu " + this.maPhieu, "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Warning); DialogResult = DialogResult.OK; this.Close(); } else { XtraMessageBox.Show("Lỗi : \r\n " + res.StringError, "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Warning); DialogResult = DialogResult.Cancel; this.Close(); } } else { DialogResult = DialogResult.Cancel; this.Close(); } } else { XtraMessageBox.Show("Mật khẩu không đúng, vui lòng thử lại hoặc hủy bỏ", "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void gridView_Trungtam_ValidateRow(object sender, DevExpress.XtraGrid.Views.Base.ValidateRowEventArgs e) { try { GridView view = sender as GridView; int rowfocus = e.RowHandle; if (string.IsNullOrEmpty(Convert.ToString(view.GetRowCellValue(rowfocus, col_th_TenTrungTam)))) { e.Valid = false; view.SetColumnError(col_th_TenTrungTam, "Tên trung tâm không được để trống!"); } if (e.Valid) { byte[] byteNull = ASCIIEncoding.ASCII.GetBytes(""); PSThongTinTrungTam trungTam = new PSThongTinTrungTam(); trungTam.MaTrungTam = gridView_Trungtam.GetRowCellValue(e.RowHandle, "MaTrungTam").ToString(); trungTam.TenTrungTam = gridView_Trungtam.GetRowCellValue(e.RowHandle, "TenTrungTam").ToString(); trungTam.Diachi = gridView_Trungtam.GetRowCellValue(e.RowHandle, "Diachi").ToString(); trungTam.DienThoai = gridView_Trungtam.GetRowCellValue(e.RowHandle, "DienThoai").ToString(); if (string.IsNullOrEmpty(gridView_Trungtam.GetRowCellValue(e.RowHandle, "Logo").ToString())) { trungTam.Logo = new Binary(byteNull); } else { trungTam.Logo = (Binary)gridView_Trungtam.GetRowCellValue(e.RowHandle, "Logo"); } trungTam.MaVietTat = gridView_Trungtam.GetRowCellValue(e.RowHandle, "MaVietTat").ToString(); if (e.RowHandle >= 0) { if (BioBLL.UpdTrungTam(trungTam)) { XtraMessageBox.Show("Cập nhật trung tâm thành công!", "Bệnh viện điện tử .NET", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { XtraMessageBox.Show("Cập nhật trung tâm thất bại!", "Bệnh viện điện tử .NET", MessageBoxButtons.OK, MessageBoxIcon.Error); } } this.gridControl_Trungtam.DataSource = BioBLL.GetListTrungTam(); } } catch { XtraMessageBox.Show("Thao tác thất bại!", "Bệnh viện điện tử .NET", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void butOK_Click(object sender, EventArgs e) { try { if (this.txtUsername.Text == string.Empty) { XtraMessageBox.Show("Tên đăng nhập không được để trống!", "Bionet - Sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.txtUsername.Focus(); return; } if (this.txtPassword.Text == string.Empty) { XtraMessageBox.Show("Mật khẩu không được để trống!", "Bionet - Sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.txtPassword.Focus(); return; } if (txtUsername.Text != string.Empty && txtPassword.Text != string.Empty) { string pass = BioBLL.GetMD5(txtPassword.Text); bool bCheckLogin = BioBLL.CheckLogin(txtUsername.Text, pass); if (bCheckLogin) { this._EmployeeCode = BioBLL.GetEmployeeCode(txtUsername.Text); this.Close(); } else { XtraMessageBox.Show("Sai thông tin đăng nhập!", "Bionet - Sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.txtUsername.Focus(); this._username = string.Empty; this._fullname = string.Empty; this._EmployeeCode = string.Empty; this.shiftCode = string.Empty; return; } } } catch (Exception ex) { XtraMessageBox.Show("Chưa kết nối với dữ liệu!\t\n-Liên hệ quản trị để kiểm tra chi tiết:\t\n" + ex.ToString(), "Bionet - Sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } }
private void FrmDMDonViCoSo_Load(object sender, EventArgs e) { this.repositoryItemLookUpEdit_ChiCuc.DataSource = BioBLL.GetListChiCuc(); this.repositoryItemLookUpEdit_ChiCuc.ValueMember = "MaChiCuc"; this.repositoryItemLookUpEdit_ChiCuc.DisplayMember = "TenChiCuc"; DataTable dtkq = new DataTable(); dtkq.Columns.Add("id", typeof(int)); dtkq.Columns.Add("name", typeof(string)); dtkq.Rows.Add(1, "Theo trung tâm"); dtkq.Rows.Add(2, "Theo đơn vị"); dtkq.Rows.Add(3, "Theo đơn vị kiểu 2"); this.repositoryItemLookUpEdit_KieuTraKetQua.DataSource = dtkq; this.repositoryItemLookUpEdit_KieuTraKetQua.DisplayMember = "name"; this.repositoryItemLookUpEdit_KieuTraKetQua.ValueMember = "id"; this.gridControl_DonViCoSo.DataSource = BioBLL.GetListDonViCoSo(); }
private void gridControl_GoiDVDonvi_ProcessGridKey(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Delete && gridView_GoiDVDonvi.State != DevExpress.XtraGrid.Views.Grid.GridState.Editing) { if (XtraMessageBox.Show("Bạn có muốn xóa danh mục này hay không?", "Bệnh viện điện tử .NET", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.No) { try { if (BioBLL.DelGoiDichVuCoSo(Convert.ToInt32(gridView_GoiDVDonvi.GetRowCellValue(gridView_GoiDVDonvi.FocusedRowHandle, "RowIDGoiDichVuTrungTam").ToString()))) { this.gridControl_GoiDVDonvi.DataSource = BioBLL.GetListGoiDichVuCoSo(); } } catch { XtraMessageBox.Show("Xóa danh mục thất bại!", "Bệnh viện điện tử .NET", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } } }
private void FrmEmployee_Load(object sender, EventArgs e) { //DataTable dt = new DataTable(); //dt.Columns.Add(new DataColumn("StatusCode", typeof(Int32))); //dt.Columns.Add(new DataColumn("StatusName", typeof(string))); //dt.Rows.Add(new object[] { "0", "Nữ" }); //dt.Rows.Add(new object[] { "1", "Nam" }); //ref_status_sex.DataSource = dt; //ref_status_sex.DisplayMember = "StatusName"; //ref_status_sex.ValueMember = "StatusCode"; //ref_status_position.DataSource = BioBLL.ListEmployeePosition(0); //ref_status_position.DisplayMember = "PositionName"; //ref_status_position.ValueMember = "PositionCode"; //this.ref_EmployeeGroup.DataSource = BioBLL.ListEmployeeGroup(0); //this.ref_EmployeeGroup.DisplayMember = "EmployeeGroupName"; //this.ref_EmployeeGroup.ValueMember = "EmployeeGroupID"; this.gridControl_Employee.DataSource = BioBLL.DTEmployeePosition(); }
private void gridView_Employee_RowCellClick(object sender, RowCellClickEventArgs e) { if (e.Column.FieldName == "Password") { if (XtraMessageBox.Show("Bạn có muốn thay đổi mật khẩu về mặc định không?", "Bệnh viện điện tử .NET", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.No) { try { string empCode = gridView_Employee.GetRowCellValue(gridView_Employee.FocusedRowHandle, "EmployeeCode").ToString(); if (BioBLL.UpdPassEmployee(empCode, string.Empty)) { XtraMessageBox.Show("Cập nhật mật khẩu nhân viên thành công!", "Bệnh viện điện tử .NET", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { XtraMessageBox.Show("Cập nhật mật khẩu nhân viên thất bại!", "Bệnh viện điện tử .NET", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch { return; } } } }
private void butConnect_Click(object sender, EventArgs e) { try { if (BioBLL.CheckConnection(this.cbxServerName.Text.Trim(), this.txtUserName.Text.Trim(), this.txtPassword.Text.Trim(), this.txtDataBaseName.Text.Trim())) { MessageBox.Show("Kết nối thành công đến Server: " + cbxServerName.EditValue.ToString() + ".\nChương trình tự động khởi động lại.", "iHIS - Bệnh Viện Điện Tử", MessageBoxButtons.OK, MessageBoxIcon.Information); this.isConnected = true; this.Close(); } else { MessageBox.Show("Kết nối đến server " + cbxServerName.EditValue.ToString() + ", database: " + this.txtDataBaseName.Text + ", userName: "******" không thành công! \r\n Vui lòng kiểm tra lại thông tin kết nối.", "iHIS - Bệnh Viện Điện Tử", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.cbxServerName.Focus(); } } catch (Exception ex) { XtraMessageBox.Show("butConnect_Click: " + ex.ToString(), "iHIS - Bệnh viện điện tử", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
private bool UpdateMenuForEmp() { try { List <PSMenuSecurity> lstMenuSecurity = new List <PSMenuSecurity>(); for (int i = 0; i < lstMenu.Count; i++) { string item = lstMenu[i]; string[] items = item.Split(','); PSMenuSecurity menuSecurity = new PSMenuSecurity { MenuCode = items[0], MenuName = items[1], EmployeeCode = empCode, CreateDate = DateTime.Now }; lstMenuSecurity.Add(menuSecurity); } return(BioBLL.UpdateMenuSercurity(lstMenuSecurity, empCode)); } catch { return(false); } }
private void btnSave_Click(object sender, EventArgs e) { PSEmployee emp = BioBLL.GetEmployeeByCode(this.empLogin); if (emp.Password != BioBLL.GetMD5(txtPassOld.Text)) { XtraMessageBox.Show("Sai mật khẩu cũ. Vui lòng nhập lại!", "iHIS - Bệnh viện điện tử", MessageBoxButtons.OK, MessageBoxIcon.Error); txtPassOld.Focus(); return; } if (string.IsNullOrEmpty(txtPassNew.Text)) { XtraMessageBox.Show("Không được để trống mật khẩu mới", "iHIS - Bệnh viện điện tử", MessageBoxButtons.OK, MessageBoxIcon.Error); txtPassNew.Focus(); return; } if (string.IsNullOrEmpty(txtPassConfirm.Text)) { XtraMessageBox.Show("Không được để trống nhập lại mật khấu mới", "iHIS - Bệnh viện điện tử", MessageBoxButtons.OK, MessageBoxIcon.Error); txtPassConfirm.Focus(); return; } if (txtPassNew.Text != txtPassConfirm.Text) { XtraMessageBox.Show("Nhập lại mật khẩu mới không trùng nhau", "iHIS - Bệnh viện điện tử", MessageBoxButtons.OK, MessageBoxIcon.Error); txtPassConfirm.Focus(); return; } if (BioBLL.UpdPassEmployee(this.empLogin, txtPassConfirm.Text)) { XtraMessageBox.Show("Cập nhật mật khẩu thành công", "iHIS - Bệnh viện điện tử", MessageBoxButtons.OK, MessageBoxIcon.Information); this.ClearText(); } else { XtraMessageBox.Show("Cập nhật mật khẩu thất bại", "iHIS - Bệnh viện điện tử", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private bool UpdateMenuForPosition() { try { List <PSMenuSecurityPosition> lstMenuSecurity = new List <PSMenuSecurityPosition>(); for (int i = 0; i < lstMenu.Count; i++) { string item = lstMenu[i]; string[] items = item.Split(','); PSMenuSecurityPosition menuSecurity = new PSMenuSecurityPosition { MenuCode = items[0], MenuName = items[1], PositionCode = this.positionCode, CreateDate = DateTime.Now }; lstMenuSecurity.Add(menuSecurity); } this.lstMenuByPositionNew = lstMenuSecurity; return(BioBLL.UpdateMenuSercurityPosition(lstMenuSecurity, this.positionCode)); } catch { return(false); } }
private void gridControl_Employee_ProcessGridKey(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Delete && gridView_Employee.State != DevExpress.XtraGrid.Views.Grid.GridState.Editing) { if (XtraMessageBox.Show("Bạn có muốn xóa chức danh này hay không?", "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.No) { try { if (BioBLL.DelEmployeePosition(Convert.ToInt32(gridView_Employee.GetRowCellValue(gridView_Employee.FocusedRowHandle, "PositionCode").ToString()))) { gridControl_Employee.DataSource = BioBLL.DTEmployeePosition(); } else { XtraMessageBox.Show("Không thể xóa chức danh này!", "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.YesNo, MessageBoxIcon.Information); } } catch { XtraMessageBox.Show("Lỗi khi xóa chức danh này!", "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.YesNo, MessageBoxIcon.Error); return; } } } }