Exemplo n.º 1
0
        private void LoadGrid()
        {
            Cursor = Cursors.Wait;
            try
            {
                #region Điều kiện tìm kiếm
                RadTreeViewItem item = tvwTree.SelectedItem as RadTreeViewItem;
                string          loai = item.Uid.ToString();
                string          ma   = item.Tag.ToString();
                #endregion

                HuyDongVonProcess HuyDongVonProcess = new HuyDongVonProcess();

                DataTable dt = null;

                LDatatable.MakeParameterTable(ref dt);
                LDatatable.AddParameter(ref dt, "@USER_NAME", "String", ClientInformation.TenDangNhap);
                LDatatable.AddParameter(ref dt, "@MA_DVI_QLY", "String", ClientInformation.MaDonViQuanLy);
                LDatatable.AddParameter(ref dt, "@MA", "String", ma);
                LDatatable.AddParameter(ref dt, "@LOAI", "String", loai);
                DataSet ds = HuyDongVonProcess.GetDanhSachDangKyRutGocQB(dt);
                if (ds != null && ds.Tables.Count > 0)
                {
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        ds.Tables[0].Rows[i]["TTHAI_NVU"] = BusinessConstant.layNgonNguNghiepVu(ds.Tables[0].Rows[i]["TTHAI_NVU"].ToString());
                    }

                    grDanhSach.DataContext = ds.Tables[0].DefaultView;

                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        lblTongSo.Content = ds.Tables[0].Rows.Count;
                    }
                    else
                    {
                        lblTongSo.Content = "0";
                    }
                }
                else
                {
                    grDanhSach.Items.Clear();
                    lblTongSo.Content = 0;
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
            finally
            {
                Mouse.OverrideCursor = Cursors.Arrow;
            }
        }