예제 #1
0
        public void InitData()
        {
            //DocStaff
            List <byte> staffTypes = new List <byte>();

            staffTypes.Add((byte)StaffType.BacSi);
            staffTypes.Add((byte)StaffType.DieuDuong);
            staffTypes.Add((byte)StaffType.KeToan);
            staffTypes.Add((byte)StaffType.LeTan);
            staffTypes.Add((byte)StaffType.Sale);
            staffTypes.Add((byte)StaffType.ThuKyYKhoa);
            staffTypes.Add((byte)StaffType.XetNghiem);

            Result result = DocStaffBus.GetDocStaffList(staffTypes);

            if (!result.IsOK)
            {
                MsgBox.Show(this.Text, result.GetErrorAsString("DocStaffBus.GetDocStaffList"), IconType.Error);
                Utility.WriteToTraceLog(result.GetErrorAsString("DocStaffBus.GetDocStaffList"));
                return;
            }
            else
            {
                DataTable dt     = result.QueryResult as DataTable;
                DataRow   newRow = dt.NewRow();
                newRow["DocStaffGUID"] = Guid.Empty.ToString();
                newRow["FullName"]     = "--------Tất cả-------";
                dt.Rows.InsertAt(newRow, 0);

                cboNhanVien.DataSource = dt;
            }
        }
예제 #2
0
        private void DisplayDocStaffList()
        {
            //DocStaff
            List <byte> staffTypes = new List <byte>();

            staffTypes.Add((byte)StaffType.BacSi);
            staffTypes.Add((byte)StaffType.BacSiNgoaiTongQuat);
            staffTypes.Add((byte)StaffType.BacSiNoiTongQuat);
            staffTypes.Add((byte)StaffType.BacSiPhuKhoa);
            staffTypes.Add((byte)StaffType.BacSiSieuAm);

            //if (_staffType != StaffType.None)
            //{
            //    if (_staffType == StaffType.BacSi)
            //    {
            //        staffTypes.Add((byte)StaffType.BacSi);
            //        staffTypes.Add((byte)StaffType.BacSiNgoaiTongQuat);
            //        staffTypes.Add((byte)StaffType.BacSiNoiTongQuat);
            //        staffTypes.Add((byte)StaffType.BacSiPhuKhoa);
            //        staffTypes.Add((byte)StaffType.BacSiSieuAm);
            //        staffTypes.Add((byte)StaffType.XetNghiem);
            //    }
            //    else
            //        staffTypes.Add((byte)_staffType);
            //}
            //else
            //{
            //    staffTypes.Add((byte)StaffType.BacSi);
            //    staffTypes.Add((byte)StaffType.BacSiNgoaiTongQuat);
            //    staffTypes.Add((byte)StaffType.BacSiNoiTongQuat);
            //    staffTypes.Add((byte)StaffType.BacSiPhuKhoa);
            //    staffTypes.Add((byte)StaffType.BacSiSieuAm);
            //    staffTypes.Add((byte)StaffType.XetNghiem);
            //}

            Result result = DocStaffBus.GetDocStaffList(staffTypes);

            if (!result.IsOK)
            {
                MsgBox.Show(this.Text, result.GetErrorAsString("DocStaffBus.GetDocStaffList"), IconType.Error);
                Utility.WriteToTraceLog(result.GetErrorAsString("DocStaffBus.GetDocStaffList"));
                return;
            }
            else
            {
                DataTable dt     = result.QueryResult as DataTable;
                DataRow   newRow = dt.NewRow();
                newRow["DocStaffGUID"] = Guid.Empty.ToString();
                newRow["FullName"]     = string.Empty;
                dt.Rows.InsertAt(newRow, 0);
                cboDocStaff.DataSource = dt;
            }

            //cboDocStaff.SelectedValue = Global.UserGUID;

            //if (cboDocStaff.SelectedValue != null && cboDocStaff.SelectedValue.ToString() != Guid.Empty.ToString())
            //    cboDocStaff.Enabled = false;
            //else
            //    cboDocStaff.Enabled = true;
        }
예제 #3
0
        private void OnDisplayDocStaffList()
        {
            Result result = DocStaffBus.GetNhanVienTrungLapList();

            if (result.IsOK)
            {
                MethodInvoker method = delegate
                {
                    ClearData();
                    dgDocStaff.DataSource = result.QueryResult;
                };

                if (InvokeRequired)
                {
                    BeginInvoke(method);
                }
                else
                {
                    method.Invoke();
                }
            }
            else
            {
                MsgBox.Show(Application.ProductName, result.GetErrorAsString("DocStaffBus.GetNhanVienTrungLapList"), IconType.Error);
                Utility.WriteToTraceLog(result.GetErrorAsString("DocStaffBus.GetNhanVienTrungLapList"));
            }
        }
예제 #4
0
        private void btnMerge_Click(object sender, EventArgs e)
        {
            if (dgMergePatient.SelectedRows == null || dgMergePatient.SelectedRows.Count <= 0)
            {
                MsgBox.Show(Application.ProductName, "Vui lòng chọn nhân viên cần giữ lại.", IconType.Information);
                return;
            }

            string keepPatientGUID = (dgMergePatient.SelectedRows[0].DataBoundItem as DataRowView).Row["DocStaffGUID"].ToString();

            foreach (DataGridViewRow row in dgMergePatient.Rows)
            {
                DataRow dr = (row.DataBoundItem as DataRowView).Row;
                if (dr["DocStaffGUID"].ToString() != keepPatientGUID)
                {
                    string mergePatientGUID = dr["DocStaffGUID"].ToString();
                    DocStaffBus.Merge2DocStaffs(keepPatientGUID, mergePatientGUID);
                }
            }

            MsgBox.Show("Merge nhan vien", "Merge kết thúc", IconType.Information);
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Close();
            }
        }
예제 #5
0
        private void InitData()
        {
            dtpkNgayCanDo.Value = DateTime.Now;

            //DocStaff
            List <byte> staffTypes = new List <byte>();

            staffTypes.Add((byte)StaffType.DieuDuong);
            Result result = DocStaffBus.GetDocStaffList(staffTypes);

            if (!result.IsOK)
            {
                MsgBox.Show(this.Text, result.GetErrorAsString("DocStaffBus.GetDocStaffList"), IconType.Error);
                Utility.WriteToTraceLog(result.GetErrorAsString("DocStaffBus.GetDocStaffList"));
                return;
            }
            else
            {
                cboDocStaff.DataSource = result.QueryResult;
            }

            if (Global.StaffType == StaffType.DieuDuong)
            {
                cboDocStaff.SelectedValue = Global.UserGUID;
                cboDocStaff.Enabled       = false;
            }
        }
예제 #6
0
        private void DisplayDSBasSiSoi()
        {
            //DocStaff
            List <byte> staffTypes = new List <byte>();

            staffTypes.Add((byte)StaffType.BacSi);
            staffTypes.Add((byte)StaffType.BacSiSieuAm);
            staffTypes.Add((byte)StaffType.BacSiNgoaiTongQuat);
            staffTypes.Add((byte)StaffType.BacSiNoiTongQuat);
            staffTypes.Add((byte)StaffType.BacSiPhuKhoa);
            Result result = DocStaffBus.GetDocStaffList(staffTypes);

            if (!result.IsOK)
            {
                MsgBox.Show(this.Text, result.GetErrorAsString("DocStaffBus.GetDocStaffList"), IconType.Error);
                Utility.WriteToTraceLog(result.GetErrorAsString("DocStaffBus.GetDocStaffList"));
                return;
            }
            else
            {
                cboBSSoi.DataSource = result.QueryResult;
            }

            if (Global.StaffType == StaffType.BacSi || Global.StaffType == StaffType.BacSiSieuAm ||
                Global.StaffType == StaffType.BacSiNgoaiTongQuat || Global.StaffType == StaffType.BacSiNoiTongQuat ||
                Global.StaffType == StaffType.BacSiPhuKhoa)
            {
                cboBSSoi.SelectedValue = Global.UserGUID;
                cboBSSoi.Enabled       = false;
            }
        }
예제 #7
0
        private void OnDisplayDocStaffList()
        {
            Result result = DocStaffBus.GetDocStaffList(1);

            if (result.IsOK)
            {
                MethodInvoker method = delegate
                {
                    ClearData();
                    DataTable dt     = result.QueryResult as DataTable;
                    DataRow   newRow = dt.NewRow();
                    newRow["DocStaffGUID"] = Guid.Empty.ToString();
                    newRow["FullName"]     = "--------Tất cả--------";
                    dt.Rows.InsertAt(newRow, 0);

                    cboNhanVien.DataSource = dt;
                };

                if (InvokeRequired)
                {
                    BeginInvoke(method);
                }
                else
                {
                    method.Invoke();
                }
            }
            else
            {
                MsgBox.Show(Application.ProductName, result.GetErrorAsString("DocStaffBus.GetDocStaffList"), IconType.Error);
                Utility.WriteToTraceLog(result.GetErrorAsString("DocStaffBus.GetDocStaffList"));
            }
        }
예제 #8
0
        private void DisplayDocStaffList()
        {
            //DocStaff
            List <byte> staffTypes = new List <byte>();

            staffTypes.Add((byte)StaffType.BacSi);
            staffTypes.Add((byte)StaffType.BacSiNgoaiTongQuat);
            staffTypes.Add((byte)StaffType.BacSiNoiTongQuat);
            staffTypes.Add((byte)StaffType.BacSiPhuKhoa);
            staffTypes.Add((byte)StaffType.BacSiSieuAm);

            Result result = DocStaffBus.GetDocStaffList(staffTypes);

            if (!result.IsOK)
            {
                MsgBox.Show(this.Text, result.GetErrorAsString("DocStaffBus.GetDocStaffList"), IconType.Error);
                Utility.WriteToTraceLog(result.GetErrorAsString("DocStaffBus.GetDocStaffList"));
                return;
            }
            else
            {
                DataTable dt     = result.QueryResult as DataTable;
                DataRow   newRow = dt.NewRow();
                newRow["DocStaffGUID"] = Guid.Empty.ToString();
                newRow["FullName"]     = " ";
                dt.Rows.InsertAt(newRow, 0);

                bacSiThucHienGUIDDataGridViewTextBoxColumn.DataSource    = dt;
                bacSiThucHienGUIDDataGridViewTextBoxColumn.DisplayMember = "FullName";
                bacSiThucHienGUIDDataGridViewTextBoxColumn.ValueMember   = "DocStaffGUID";
            }
        }
예제 #9
0
        public void DisplayBacSiPhuTrach()
        {
            ClearBSPhuTrach();
            //DocStaff
            List <byte> staffTypes = new List <byte>();

            staffTypes.Add((byte)StaffType.BacSi);
            staffTypes.Add((byte)StaffType.BacSiSieuAm);
            staffTypes.Add((byte)StaffType.BacSiNgoaiTongQuat);
            staffTypes.Add((byte)StaffType.BacSiNoiTongQuat);
            staffTypes.Add((byte)StaffType.BacSiPhuKhoa);
            Result result = DocStaffBus.GetDocStaffList(staffTypes);

            if (!result.IsOK)
            {
                MsgBox.Show(this.Text, result.GetErrorAsString("DocStaffBus.GetDocStaffList"), IconType.Error);
                Utility.WriteToTraceLog(result.GetErrorAsString("DocStaffBus.GetDocStaffList"));
                return;
            }
            else
            {
                DataTable dt     = result.QueryResult as DataTable;
                DataRow   newRow = dt.NewRow();
                newRow["DocStaffGUID"] = Guid.Empty.ToString();
                newRow["FullName"]     = string.Empty;
                dt.Rows.InsertAt(newRow, 0);
                cboDocStaff.DataSource = dt;
            }
        }
예제 #10
0
        private void OnDisplayBacSi()
        {
            List <byte> staffTypes = new List <byte>();

            staffTypes.Add((byte)StaffType.BacSi);
            staffTypes.Add((byte)StaffType.BacSiSieuAm);
            staffTypes.Add((byte)StaffType.BacSiNgoaiTongQuat);
            staffTypes.Add((byte)StaffType.BacSiNoiTongQuat);
            staffTypes.Add((byte)StaffType.BacSiPhuKhoa);
            Result result = DocStaffBus.GetDocStaffList(staffTypes);

            if (result.IsOK)
            {
                DataTable dt = result.QueryResult as DataTable;
                cboBacSi.DataSource = dt;

                DataRow[] rows = dt.Select(string.Format("DocStaffGUID='{0}'", Global.UserGUID));
                if (rows != null && rows.Length > 0)
                {
                    cboBacSi.SelectedValue = Global.UserGUID;
                }
            }
            else
            {
                MsgBox.Show(this.Text, result.GetErrorAsString("DocStaffBus.GetDocStaffList"), IconType.Error);
                Utility.WriteToTraceLog(result.GetErrorAsString("DocStaffBus.GetDocStaffList"));
            }
        }
예제 #11
0
        private void InitData()
        {
            string docStaffGUID = _isNew ? Guid.Empty.ToString() : _drLogon["DocStaffGUID"].ToString();
            Result result       = DocStaffBus.GetDocStaffListWithoutLogon(docStaffGUID);

            if (result.IsOK)
            {
                cboDocStaff.DataSource = result.QueryResult as DataTable;
            }
            else
            {
                MsgBox.Show(this.Text, result.GetErrorAsString("DocStaffBus.GetDocStaffList"), IconType.Error);
                Utility.WriteToTraceLog(result.GetErrorAsString("DocStaffBus.GetDocStaffList"));
            }
        }
예제 #12
0
        private void InitData()
        {
            dtpkNgay.Value = DateTime.Now;

            //DocStaff
            List <byte> staffTypes = new List <byte>();

            staffTypes.Add((byte)StaffType.BacSi);
            staffTypes.Add((byte)StaffType.BacSiSieuAm);
            staffTypes.Add((byte)StaffType.BacSiNgoaiTongQuat);
            staffTypes.Add((byte)StaffType.BacSiNoiTongQuat);
            staffTypes.Add((byte)StaffType.BacSiPhuKhoa);
            Result result = DocStaffBus.GetDocStaffList(staffTypes);

            if (!result.IsOK)
            {
                MsgBox.Show(this.Text, result.GetErrorAsString("DocStaffBus.GetDocStaffList"), IconType.Error);
                Utility.WriteToTraceLog(result.GetErrorAsString("DocStaffBus.GetDocStaffList"));
                return;
            }
            else
            {
                cboDocStaff.DataSource = result.QueryResult;
            }

            if (Global.StaffType == StaffType.BacSi || Global.StaffType == StaffType.BacSiSieuAm ||
                Global.StaffType == StaffType.BacSiNgoaiTongQuat || Global.StaffType == StaffType.BacSiNoiTongQuat ||
                Global.StaffType == StaffType.BacSiPhuKhoa)
            {
                cboDocStaff.SelectedValue = Global.UserGUID;
                cboDocStaff.Enabled       = false;
            }

            //Symptom
            result = SymptomBus.GetSymptomList();
            if (!result.IsOK)
            {
                MsgBox.Show(this.Text, result.GetErrorAsString("SymptomBus.GetSymptomList"), IconType.Error);
                Utility.WriteToTraceLog(result.GetErrorAsString("SymptomBus.GetSymptomList"));
                return;
            }
            else
            {
                cboTrieuChung.DataSource = result.QueryResult;
            }
        }
예제 #13
0
        private void InitData()
        {
            dtpkNgay.Value   = DateTime.Now;
            dtpkGioVao.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 0, 0);
            dtpkGioRa.Value  = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 0, 0);

            Result result = DocStaffBus.GetDocStaffList(1);

            if (!result.IsOK)
            {
                MsgBox.Show(this.Text, result.GetErrorAsString("DocStaffBus.GetDocStaffList"), IconType.Error);
                Utility.WriteToTraceLog(result.GetErrorAsString("DocStaffBus.GetDocStaffList"));
                return;
            }
            else
            {
                DataTable dt = result.QueryResult as DataTable;
                cboNguoiDeXuat.DataSource = dt.Copy();
            }
        }
예제 #14
0
        private void OnDeleteDocStaff()
        {
            List <string>  deletedDocStaffList = new List <string>();
            List <DataRow> deletedRows         = new List <DataRow>();
            DataTable      dt = dgDocStaff.DataSource as DataTable;

            foreach (DataRow row in dt.Rows)
            {
                if (Boolean.Parse(row["Checked"].ToString()))
                {
                    deletedDocStaffList.Add(row["DocStaffGUID"].ToString());
                    deletedRows.Add(row);
                }
            }

            if (deletedDocStaffList.Count > 0)
            {
                if (MsgBox.Question(Application.ProductName, "Bạn có muốn xóa những nhân viên mà bạn đã đánh dấu ?") == DialogResult.Yes)
                {
                    Result result = DocStaffBus.DeleteDocStaff(deletedDocStaffList);
                    if (result.IsOK)
                    {
                        //foreach (DataRow row in deletedRows)
                        //{
                        //    dt.Rows.Remove(row);
                        //}
                        DisplayAsThread();
                    }
                    else
                    {
                        MsgBox.Show(Application.ProductName, result.GetErrorAsString("DocStaffBus.DeleteDocStaff"), IconType.Error);
                        Utility.WriteToTraceLog(result.GetErrorAsString("DocStaffBus.DeleteDocStaff"));
                    }
                }
            }
            else
            {
                MsgBox.Show(Application.ProductName, "Vui lòng đánh dấu những nhân viên cần xóa.", IconType.Information);
            }
        }
예제 #15
0
        public void InitData()
        {
            btnPrintPreview.Enabled = AllowPrint;
            btnPrint.Enabled        = AllowPrint;
            btnExportExcel.Enabled  = AllowExport;

            //DocStaff
            List <byte> staffTypes = new List <byte>();

            staffTypes.Add((byte)StaffType.BacSi);
            staffTypes.Add((byte)StaffType.BacSiSieuAm);
            staffTypes.Add((byte)StaffType.BacSiNgoaiTongQuat);
            staffTypes.Add((byte)StaffType.BacSiNoiTongQuat);
            staffTypes.Add((byte)StaffType.BacSiPhuKhoa);

            Result result = null;

            if (Global.UserGUID == Guid.Empty.ToString())
            {
                result = DocStaffBus.GetDocStaffList(staffTypes);
            }
            else
            {
                result = DocStaffBus.GetDocStaffList(staffTypes, Global.UserGUID);
            }

            if (!result.IsOK)
            {
                MsgBox.Show(this.Text, result.GetErrorAsString("DocStaffBus.GetDocStaffList"), IconType.Error);
                Utility.WriteToTraceLog(result.GetErrorAsString("DocStaffBus.GetDocStaffList"));
                return;
            }
            else
            {
                cboDocStaff.DataSource = result.QueryResult;
            }
        }
예제 #16
0
        private void OnSaveInfo()
        {
            try
            {
                _contact.FullName = txtFullName.Text;

                string surName   = string.Empty;
                string firstName = string.Empty;
                Utility.GetSurNameFirstNameFromFullName(txtFullName.Text, ref surName, ref firstName);
                _contact.SurName   = surName;
                _contact.FirstName = firstName;

                _contact.KnownAs       = txtKnownAs.Text;
                _contact.PreferredName = txtPreferredName.Text;
                _contact.Archived      = false;

                _contact.DobStr          = txtDOB.Text;
                _contact.IdentityCard    = txtIdentityCard.Text;
                _contact.HomePhone       = txtHomePhone.Text;
                _contact.WorkPhone       = txtWorkPhone.Text;
                _contact.Mobile          = txtMobile.Text;
                _contact.Email           = txtEmail.Text;
                _contact.FAX             = txtFax.Text;
                _contact.Address         = txtAddress.Text;
                _docStaff.Qualifications = txtQualifications.Text;


                if (_isNew)
                {
                    _contact.CreatedBy   = Guid.Parse(Global.UserGUID);
                    _contact.CreatedDate = DateTime.Now;
                }
                else
                {
                    _contact.UpdatedBy   = Guid.Parse(Global.UserGUID);
                    _contact.UpdatedDate = DateTime.Now;
                }

                MethodInvoker method = delegate
                {
                    _docStaff.AvailableToWork = !chkXoa.Checked;
                    _contact.Archived         = chkXoa.Checked;

                    if (chkXoa.Checked)
                    {
                        _contact.DateArchived = DateTime.Now;
                        _contact.DeletedBy    = Guid.Parse(Global.UserGUID);
                        _contact.DeletedDate  = DateTime.Now;
                    }

                    _docStaff.SpecialityGUID = Guid.Parse(cboSpeciality.SelectedValue.ToString());
                    _docStaff.WorkType       = (byte)cboWorkType.SelectedIndex;
                    _docStaff.StaffType      = (byte)GetStaffType(cboStaffType.SelectedIndex);

                    if (picChuKy.Image != null)
                    {
                        MemoryStream mem = new MemoryStream();
                        Image        pic = picChuKy.Image;
                        pic.Save(mem, System.Drawing.Imaging.ImageFormat.Png);
                        byte[] buff = mem.ToArray();
                        _docStaff.ChuKy = new System.Data.Linq.Binary(buff);
                        mem.Close();
                        mem = null;
                    }

                    switch (cboStaffType.SelectedIndex)
                    {
                    case 0:
                        _contact.Occupation = "Bác sĩ";
                        break;

                    case 1:
                        _contact.Occupation = "Bác sĩ siêu âm";
                        break;

                    case 2:
                        _contact.Occupation = "Bác sĩ ngoại tổng quát";
                        break;

                    case 3:
                        _contact.Occupation = "Bác sĩ nội tổng quát";
                        break;

                    case 4:
                        _contact.Occupation = "Bác sĩ phụ khoa";
                        break;

                    case 5:
                        _contact.Occupation = "Điều dưỡng";
                        break;

                    case 6:
                        _contact.Occupation = "Lễ tân";
                        break;

                    case 7:
                        _contact.Occupation = "Thư ký y khoa";
                        break;

                    case 8:
                        _contact.Occupation = "Xét nghiệm";
                        break;

                    case 9:
                        _contact.Occupation = "Sale";
                        break;

                    case 10:
                        _contact.Occupation = "Kế toán";
                        break;
                    }

                    _contact.Gender = (byte)cboGender.SelectedIndex;

                    Result result = DocStaffBus.InsertDocStaff(_contact, _docStaff);
                    if (!result.IsOK)
                    {
                        MsgBox.Show(this.Text, result.GetErrorAsString("DocStaffBus.InsertDocStaff"), IconType.Error);
                        Utility.WriteToTraceLog(result.GetErrorAsString("DocStaffBus.InsertDocStaff"));
                        this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
                    }
                };

                if (InvokeRequired)
                {
                    BeginInvoke(method);
                }
                else
                {
                    method.Invoke();
                }
            }
            catch (Exception e)
            {
                MsgBox.Show(this.Text, e.Message, IconType.Error);
                Utility.WriteToTraceLog(e.Message);
            }
        }
예제 #17
0
        private void DisplayInfo(DataRow drDocStaff)
        {
            try
            {
                _contact.ContactGUID   = Guid.Parse(drDocStaff["ContactGUID"].ToString());
                _docStaff.DocStaffGUID = Guid.Parse(drDocStaff["DocStaffGUID"].ToString());
                _docStaff.ContactGUID  = _contact.ContactGUID;

                txtFullName.Text            = drDocStaff["FullName"] as string;
                txtKnownAs.Text             = drDocStaff["KnownAs"] as string;
                txtPreferredName.Text       = drDocStaff["PreferredName"] as string;
                cboGender.SelectedIndex     = Convert.ToInt32(drDocStaff["Gender"]);
                txtDOB.Text                 = drDocStaff["DobStr"] as string;
                txtIdentityCard.Text        = drDocStaff["IdentityCard"] as string;
                txtQualifications.Text      = drDocStaff["Qualifications"] as string;
                cboSpeciality.SelectedValue = drDocStaff["SpecialityGUID"];
                cboWorkType.SelectedIndex   = Convert.ToInt32(drDocStaff["WorkType"]);
                cboStaffType.SelectedIndex  = GetStaffTypeIndex((StaffType)Convert.ToInt32(drDocStaff["StaffType"]));
                txtHomePhone.Text           = drDocStaff["HomePhone"] as string;
                txtWorkPhone.Text           = drDocStaff["WorkPhone"] as string;
                txtMobile.Text              = drDocStaff["Mobile"] as string;
                txtEmail.Text               = drDocStaff["Email"] as string;
                txtFax.Text                 = drDocStaff["Fax"] as string;
                txtAddress.Text             = drDocStaff["Address"] as string;

                chkXoa.Checked = !Convert.ToBoolean(drDocStaff["AvailableToWork"]);

                Result result = DocStaffBus.GetChuKy(_docStaff.DocStaffGUID.ToString());
                if (result.IsOK)
                {
                    if (result.QueryResult != null)
                    {
                        Byte[]       buff = (byte[])result.QueryResult;
                        MemoryStream mem  = new MemoryStream(buff);
                        Image        img  = Image.FromStream(mem);
                        picChuKy.Image = img;
                    }
                }
                else
                {
                    MsgBox.Show(this.Text, result.GetErrorAsString("DocStaffBus.GetChuKy"), IconType.Error);
                    Utility.WriteToTraceLog(result.GetErrorAsString("DocStaffBus.GetChuKy"));
                }

                if (drDocStaff["CreatedDate"] != null && drDocStaff["CreatedDate"] != DBNull.Value)
                {
                    _contact.CreatedDate = Convert.ToDateTime(drDocStaff["CreatedDate"]);
                }

                if (drDocStaff["CreatedBy"] != null && drDocStaff["CreatedBy"] != DBNull.Value)
                {
                    _contact.CreatedBy = Guid.Parse(drDocStaff["CreatedBy"].ToString());
                }

                if (drDocStaff["UpdatedDate"] != null && drDocStaff["UpdatedDate"] != DBNull.Value)
                {
                    _contact.UpdatedDate = Convert.ToDateTime(drDocStaff["UpdatedDate"]);
                }

                if (drDocStaff["UpdatedBy"] != null && drDocStaff["UpdatedBy"] != DBNull.Value)
                {
                    _contact.UpdatedBy = Guid.Parse(drDocStaff["UpdatedBy"].ToString());
                }

                if (drDocStaff["DeletedDate"] != null && drDocStaff["DeletedDate"] != DBNull.Value)
                {
                    _contact.DeletedDate = Convert.ToDateTime(drDocStaff["DeletedDate"]);
                }

                if (drDocStaff["DeletedBy"] != null && drDocStaff["DeletedBy"] != DBNull.Value)
                {
                    _contact.DeletedBy = Guid.Parse(drDocStaff["DeletedBy"].ToString());
                }

                if (!_allowEdit)
                {
                    groupBox1.Enabled = _allowEdit;
                    btnOK.Enabled     = _allowEdit;
                }
            }
            catch (Exception e)
            {
                MsgBox.Show(this.Text, e.Message, IconType.Error);
                Utility.WriteToTraceLog(e.Message);
            }
        }