Example #1
0
        public void NapDatCho()
        {
            if (!XuLyGiaoDien.wait.IsSplashFormVisible)
            {
                XuLyGiaoDien.wait.ShowWaitForm();
            }
            string query = "LoaiGiaoDich in (0,1,5,6,7,10,11,12)";

            if (query.Length > 0)
            {
                if (chk2.Checked)
                {
                    if (bdtpTu.EditValue != null && bdtpDen.EditValue != null)
                    {
                        query   = string.Format("({2}) AND (convert(date, NgayGD) BETWEEN '{0}' AND '{1}')", ((DateTime)bdtpTu.EditValue).ToString("yyyyMMdd"), ((DateTime)bdtpDen.EditValue).ToString("yyyyMMdd"), query);
                        lstGDDC = new D_GIAODICH().DuLieu(query, DuLieuTaoSan.Q.VeAdmin);
                    }
                }
                else if (chk1.Checked)
                {
                    query   = string.Format("({0}) {1}", query, DuLieuTaoSan.ThoiGianRutGon("NgayGD")[idThoiGian]);
                    lstGDDC = new D_GIAODICH().DuLieu(query, DuLieuTaoSan.Q.VeAdmin);
                }
                giaoDichOBindingSource.DataSource = lstGDDC;
            }
            if (XuLyGiaoDien.wait.IsSplashFormVisible)
            {
                XuLyGiaoDien.wait.CloseWaitForm();
            }
        }
Example #2
0
        void DuLieu()
        {
            string _Query = string.Empty;

            if (chk1.Checked)
            {
                _Query += DuLieuTaoSan.ThoiGianRutGon("TuNgay")[_IDThoiGian];
            }
            else if (chk2.Checked)
            {
                if (bdtpTu.EditValue != null && bdtpDen.EditValue != null)
                {
                    _Query += string.Format("AND (convert(date, TuNgay) BETWEEN '{0}' AND '{1}')", ((DateTime)bdtpTu.EditValue).ToString("yyyyMMdd"), ((DateTime)bdtpDen.EditValue).ToString("yyyyMMdd"));
                }
            }
            khoaNgayOBindingSource.DataSource = new D_KHOANGAY().DuLieu(_Query);
        }
Example #3
0
        public void DuLieu()
        {
            string _Query = string.Empty;

            if (!XuLyGiaoDien.wait.IsSplashFormVisible)
            {
                XuLyGiaoDien.wait.ShowWaitForm();
            }

            if (chk1.Checked)
            {
                _Query = DuLieuTaoSan.ThoiGianRutGon("NgayThucHien")[idThoiGian].Substring(3);
            }
            else if (chk2.Checked)
            {
                if (bdtpTu.EditValue != null && bdtpDen.EditValue != null)
                {
                    _Query = string.Format("(convert(date, NgayThucHien) BETWEEN '{0}' AND '{1}')", ((DateTime)bdtpTu.EditValue).ToString("yyyyMMdd"), ((DateTime)bdtpDen.EditValue).ToString("yyyyMMdd"));
                }
            }
            else if (chk3.Checked && _SV_MC.Length > 0)
            {
                _Query += string.Format("REPLACE(COALESCE(SoVe,''),' ','') in ('{0}')", String.Join("' ,'", _SV_MC));
            }
            else if (chk4.Checked && _SV_MC.Length > 0)
            {
                _Query += string.Format("REPLACE(COALESCE(MaCho,''),' ','') in ('{0}')", String.Join("' ,'", _SV_MC));
            }
            else if (chk5.Checked && _SV_MC.Length > 0)
            {
                _Query += string.Format("REPLACE(COALESCE(MaHD,''),' ','') in ('{0}')", String.Join("' ,'", _SV_MC));
            }

            if (_Query.Length > 0)
            {
                hoaDonOs = hoaDonD.DuLieu(_Query);
                hoaDonOBindingSource.DataSource = hoaDonOs;
                GVHD.BestFitColumns();
            }

            if (XuLyGiaoDien.wait.IsSplashFormVisible)
            {
                XuLyGiaoDien.wait.CloseWaitForm();
            }
        }
Example #4
0
        public void LayDLCTNganHang()
        {
            string CTV = "SMS = 1 ";

            if (chk1.Checked)
            {
                CTV += DuLieuTaoSan.ThoiGianRutGon("NgayCuonChieu")[idThoiGian];
            }
            else if (bdtpTu.EditValue != null && bdtpDen.EditValue != null)
            {
                CTV += string.Format("AND (convert(date, NgayCuonChieu) BETWEEN '{0}' AND '{1}')", ((DateTime)bdtpTu.EditValue).ToString("yyyyMMdd"), ((DateTime)bdtpDen.EditValue).ToString("yyyyMMdd"));
            }
            if (chkDD.Checked)
            {
                CTV += "OR (SMS = 1 and Khoa = 0)";
            }
            lstGD = new D_GIAODICH().DuLieu(CTV, DuLieuTaoSan.Q.VeAdmin);
            giaoDichOBindingSource.DataSource = lstGD;
            GVKLN.BestFitColumns();
        }
Example #5
0
        public void DuLieu()
        {
            if (!XuLyGiaoDien.wait.IsSplashFormVisible)
            {
                XuLyGiaoDien.wait.ShowWaitForm();
            }
            string _Query = string.Empty;

            if (chk1.Checked)
            {
                _Query = DuLieuTaoSan.ThoiGianRutGon("NgayGD")[_IDThoiGian];
            }
            else if (chk2.Checked)
            {
                if (bdtpTu.EditValue != null && bdtpDen.EditValue != null)
                {
                    _Query = string.Format("AND (convert(date, NgayGD) BETWEEN '{0}' AND '{1}')", ((DateTime)bdtpTu.EditValue).ToString("yyyyMMdd"), ((DateTime)bdtpDen.EditValue).ToString("yyyyMMdd"));
                }
            }
            else if (chk3.Checked && _SV_MC.Length > 0)
            {
                _Query = string.Format("AND REPLACE(COALESCE(SoVeVN,''),' ','') in ('{0}')", String.Join("' ,'", _SV_MC));
            }
            else if (chk4.Checked && _SV_MC.Length > 0)
            {
                _Query = string.Format("AND REPLACE(COALESCE(MaCho,''),' ','') in ('{0}')", String.Join("' ,'", _SV_MC));
            }

            if (_Query != string.Empty)
            {
                _ListGiaoDichO = new D_GIAODICH().DuLieu(string.Format("TheoDoi = 1 AND ({0}{1})", _Query.Substring(3), chkAll.Checked ? " or TinhCongNo = 0" : string.Empty), DuLieuTaoSan.Q.VeAdmin);
                giaoDichOBindingSource.DataSource = _ListGiaoDichO;
            }
            if (XuLyGiaoDien.wait.IsSplashFormVisible)
            {
                XuLyGiaoDien.wait.CloseWaitForm();
            }
        }