private void LoadGrid()
        {
            try
            {
                HuyDongVonProcess huyDongVonProcess = new HuyDongVonProcess();
                DataSet           ds = null;
                if (function == DatabaseConstant.Function.HDV_LAI_NHAP_GOC_THEO_SO || function == DatabaseConstant.Function.HDV_LAI_NHAP_GOC_THEO_DANH_SACH)
                {
                    ds = huyDongVonProcess.GetDanhSachSoLNG(ClientInformation.MaDonViGiaoDich, sSanPham, sIDNhom, ClientInformation.NgayLamViecHienTai);
                }
                else if (function == DatabaseConstant.Function.HDV_RUT_BOT_GOC || function == DatabaseConstant.Function.HDV_RUT_GOC_THEO_DANH_SACH)
                {
                    ds = huyDongVonProcess.GetDanhSachSoRutGocNhom(ClientInformation.MaDonViGiaoDich, sSanPham, sIDNhom, ClientInformation.NgayLamViecHienTai);
                }
                else if (function == DatabaseConstant.Function.HDV_DU_CHI)
                {
                    ds = huyDongVonProcess.GetDanhSachSoDuChi(ClientInformation.MaDonViGiaoDich, sSanPham, sIDNhom, ClientInformation.NgayLamViecHienTai);
                }
                else if (function == DatabaseConstant.Function.HDV_TRA_LAI || function == DatabaseConstant.Function.HDV_TRA_LAI_THEO_DANH_SACH)
                {
                    ds = huyDongVonProcess.GetDanhSachSoTraLaiNhom(ClientInformation.MaDonViGiaoDich, sSanPham, sIDNhom, ClientInformation.NgayLamViecHienTai);
                }
                else if (function == DatabaseConstant.Function.HDV_TAT_TOAN || function == DatabaseConstant.Function.HDV_TAT_TOAN_THEO_DANH_SACH)
                {
                    ds = huyDongVonProcess.GetDanhSachSoTatToanNhom(ClientInformation.MaDonViGiaoDich, sSanPham, sIDNhom, ClientInformation.NgayLamViecHienTai);
                }
                else if (function == DatabaseConstant.Function.HDV_DIEU_CHINH_LS)
                {
                    ds = huyDongVonProcess.GetDanhSachSoThayDoiLS(ClientInformation.MaDonViGiaoDich, sSanPham, sIDNhom, ClientInformation.NgayLamViecHienTai);
                }
                else
                {
                    ds = huyDongVonProcess.GetDanhSachSoTGuiNhom(ClientInformation.MaDonViGiaoDich, sSanPham, sIDNhom);
                }

                if (ds != null)
                {
                    dtSoTGui = ds.Tables[0];
                    grSoTienGuiDS.ItemsSource = dtSoTGui;

                    int     soSoTgui     = 0;
                    decimal tongSoDu     = 0;
                    decimal soDuBinhQuan = 0;
                    if (dtSoTGui.Rows.Count > 0)
                    {
                        soSoTgui = dtSoTGui.Rows.Count;
                        for (int i = 0; i < dtSoTGui.Rows.Count; i++)
                        {
                            tongSoDu += Convert.ToDecimal(dtSoTGui.Rows[i]["SO_DU"]);
                        }
                        soDuBinhQuan = tongSoDu / soSoTgui;
                    }

                    lblSumSoSo.Content = String.Format("{0:#,#}", soSoTgui);
                    lblSumSoDu.Content = String.Format("{0:#,#}", tongSoDu);
                    lblSoDuBQ.Content  = String.Format("{0:#,#}", soDuBinhQuan);
                }
                else
                {
                    dtSoTGui.Rows.Clear();
                    grSoTienGuiDS.ItemsSource = dtSoTGui;
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
        }