Exemple #1
0
        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 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 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);
            }
        }