private void InitData()
        {
            Result result = XetNghiemTayBus.GetXetNghiemList();

            if (result.IsOK)
            {
                _dtXetNghiem = result.QueryResult as DataTable;
            }
            else
            {
                MsgBox.Show(Application.ProductName, result.GetErrorAsString("XetNghiemTayBus.GetXetNghiemList"), IconType.Error);
                Utility.WriteToTraceLog(result.GetErrorAsString("XetNghiemTayBus.GetXetNghiemList"));
            }

            dtpkNgayXetNghiem.Value = DateTime.Now;
        }
Example #2
0
        private void OnDisplayXetNghiemList()
        {
            Result result = XetNghiemTayBus.GetXetNghiemList();

            if (result.IsOK)
            {
                MethodInvoker method = delegate
                {
                    ClearData();
                    _dataSource = result.QueryResult as DataTable;

                    if (_dictXetNghiemTay == null)
                    {
                        _dictXetNghiemTay = new Dictionary <string, DataRow>();
                    }
                    foreach (DataRow row in _dataSource.Rows)
                    {
                        string xetNghiem_ManualGUID = row["XetNghiem_ManualGUID"].ToString();
                        _dictXetNghiemTay.Add(xetNghiem_ManualGUID, row);
                    }

                    OnSearchXetNghiem();
                };

                if (InvokeRequired)
                {
                    BeginInvoke(method);
                }
                else
                {
                    method.Invoke();
                }
            }
            else
            {
                MsgBox.Show(Application.ProductName, result.GetErrorAsString("XetNghiemTayBus.GetXetNghiemList"), IconType.Error);
                Utility.WriteToTraceLog(result.GetErrorAsString("XetNghiemTayBus.GetXetNghiemList"));
            }
        }