Beispiel #1
0
        private void OnDisplayCheckList(DataRow patientRow)
        {
            ClearCheckList();
            chkChecked.Checked = false;
            Result result = CompanyContractBus.GetCheckList(_hopDongGUID, patientRow["PatientGUID"].ToString());

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

                foreach (DataGridViewRow row in dgService.Rows)
                {
                    DataRow drRow = (row.DataBoundItem as DataRowView).Row;
                    if (drRow["NguoiChuyenNhuong"] != null && drRow["NguoiChuyenNhuong"] != DBNull.Value &&
                        drRow["NguoiChuyenNhuong"].ToString().Trim() != string.Empty)
                    {
                        DataGridViewDisableCheckBoxCell cell = row.Cells["Using"] as DataGridViewDisableCheckBoxCell;
                        cell.Enabled = false;
                    }
                }

                OnTinhTongTienChecklist(patientRow);
                //btnLuu.Enabled = AllowEdit;
            }
            else
            {
                MsgBox.Show(this.Text, result.GetErrorAsString("CompanyContractBus.GetCheckList"), IconType.Error);
                Utility.WriteToTraceLog(result.GetErrorAsString("CompanyContractBus.GetCheckList"));
            }
        }
        private void OnCapNhatAllChecklist(List <string> checkedPatientList)
        {
            foreach (string patientGUID in checkedPatientList)
            {
                Result result = CompanyContractBus.GetCheckList(_hopDongGUID, patientGUID);
                if (!result.IsOK)
                {
                    MsgBox.Show(this.Text, result.GetErrorAsString("CompanyContractBus.GetCheckList"), IconType.Error);
                    Utility.WriteToTraceLog(result.GetErrorAsString("CompanyContractBus.GetCheckList"));
                    return;
                }

                DataTable      dtChecklist   = result.QueryResult as DataTable;
                List <DataRow> checkListRows = new List <DataRow>();
                foreach (DataRow row in dtChecklist.Rows)
                {
                    bool isUsing = Convert.ToBoolean(row["Using"]);
                    if (isUsing)
                    {
                        continue;
                    }
                    row["Using"] = true;
                    checkListRows.Add(row);
                }

                if (checkListRows.Count <= 0)
                {
                    continue;
                }
                result = ServiceHistoryBus.UpdateChecklist(patientGUID, _hopDongGUID, _beginDate, _endDate, checkListRows);
                if (!result.IsOK)
                {
                    MsgBox.Show(this.Text, result.GetErrorAsString("ServiceHistoryBus.UpdateChecklist"), IconType.Error);
                    Utility.WriteToTraceLog(result.GetErrorAsString("ServiceHistoryBus.UpdateChecklist"));
                    return;
                }
            }

            MsgBox.Show(this.Text, "Đã cập nhật thành công.", IconType.Information);
        }
Beispiel #3
0
        private void OnDisplayCheckList()
        {
            Cursor.Current = Cursors.WaitCursor;
            if (dgDSNV.SelectedRows == null || dgDSNV.SelectedRows.Count <= 0)
            {
                return;
            }
            DataRow drMember = (dgDSNV.SelectedRows[0].DataBoundItem as DataRowView).Row;

            string patientGUID = drMember["PatientGUID"].ToString();
            Result result      = CompanyContractBus.GetCheckList(_contractGUID, patientGUID);

            if (result.IsOK)
            {
                dgService.DataSource = result.QueryResult as DataTable;
                RefreshUsingService();
            }
            else
            {
                MsgBox.Show(this.Text, result.GetErrorAsString("CompanyContractBus.GetCheckList"), IconType.Error);
                Utility.WriteToTraceLog(result.GetErrorAsString("CompanyContractBus.GetCheckList"));
            }
        }