示例#1
0
        private void GetCheckListByPatient(string patientGUID)
        {
            Result result = CompanyContractBus.GetCheckListByPatient(patientGUID);
            if (result.IsOK)
            {
                if (_dtCheckList != null)
                {
                    _dtCheckList.Rows.Clear();
                    _dtCheckList = null;
                }

                _dtCheckList = result.QueryResult as DataTable;
            }
            else
            {
                MsgBox.Show(this.Text, result.GetErrorAsString("CompanyBus.GetCompanyMemberList"), IconType.Error);
                Utility.WriteToTraceLog(result.GetErrorAsString("CompanyBus.GetCompanyMemberList"));
            }
        }
示例#2
0
        private void OnDisplayCheckList(string patientGUID)
        {
            Result result = CompanyContractBus.GetCheckListByPatient(patientGUID);

            if (result.IsOK)
            {
                MethodInvoker method = delegate
                {
                    DataTable dt = result.QueryResult as DataTable;
                    lvService.Visible = dt.Rows.Count > 0 ? true : false;

                    foreach (DataRow row in dt.Rows)
                    {
                        string code        = row["Code"].ToString();
                        string name        = row["Name"].ToString();
                        string nguoiNhanCN = row["NguoiChuyenNhuong"].ToString();
                        bool   isChecked   = Convert.ToBoolean(row["Checked"]);
                        int    imgIndex    = isChecked ? 0 : 1;

                        ListViewItem item = new ListViewItem(string.Empty, imgIndex);
                        item.SubItems.Add(code);
                        item.SubItems.Add(name);
                        item.SubItems.Add(nguoiNhanCN);
                        lvService.Items.Add(item);
                    }
                };

                if (InvokeRequired)
                {
                    BeginInvoke(method);
                }
                else
                {
                    method.Invoke();
                }
            }
            else
            {
                lvService.Visible = false;
                MsgBox.Show(this.Text, result.GetErrorAsString("CompanyBus.GetCompanyMemberList"), IconType.Error);
                Utility.WriteToTraceLog(result.GetErrorAsString("CompanyBus.GetCompanyMemberList"));
            }
        }