示例#1
0
        public void Chay()
        {
            clsLan ptLog = new clsLan();

            ptLog.ThoiGianBatDau = DateTime.Now;

            daCauHinh dCH = new daCauHinh();

            dCH.Lay(dCH.TimMaThamSo((int)daCauHinh.eCauHinh.Mã_Bưu_Cục));
            if (dCH.CauHinh != null)
            {
                ptLog.MaBuuCuc = dCH.CauHinh.GiaTri;
            }


            daThongTinMay dTTM = new daThongTinMay();

            ptLog.MAC      = dTTM.MAC;
            ptLog.DiaChiIP = dTTM.DiaChiIP;

            daPhatHanhPayPost dPHPP = new daPhatHanhPayPost();

            daDuLieuPayPost    dPP       = new daDuLieuPayPost();
            List <clsDuLieuPP> lstTruyen = new List <clsDuLieuPP>();

            lstTruyen           = dPP.LayDanhSachChuaTruyen();
            ptLog.SoLuong       = 0;
            ptLog.TongTien      = 0;
            dPHPP.PaPo.MaBuuCuc = ptLog.MaBuuCuc;
            //dPHPP.Xoa();
            foreach (clsDuLieuPP ptPP in lstTruyen)
            {
                dPHPP.PaPo.NgayPhatHanh    = ptPP.NgayPhatHanh;
                dPHPP.PaPo.MAC             = dTTM.MAC;
                dPHPP.PaPo.TranTime        = ptPP.TranTime;
                dPHPP.PaPo.TranCat         = ptPP.TranCat;
                dPHPP.PaPo.InvokedFrom     = ptPP.InvokedFrom;
                dPHPP.PaPo.TranID          = ptPP.TranID;
                dPHPP.PaPo.PAC             = ptPP.PAC;
                dPHPP.PaPo.AccountID       = ptPP.AccountID;
                dPHPP.PaPo.TranAmount      = ptPP.TranAmount;
                dPHPP.PaPo.SenderName      = ptPP.SenderName;
                dPHPP.PaPo.AddInfo1        = ptPP.AddInfo1;
                dPHPP.PaPo.AddInfo2        = ptPP.AddInfo2;
                dPHPP.PaPo.AddInfo3        = ptPP.AddInfo3;
                dPHPP.PaPo.AddInfo4        = ptPP.AddInfo4;
                dPHPP.PaPo.AddInfo5        = ptPP.AddInfo5;
                dPHPP.PaPo.AddInfo6        = ptPP.AddInfo6;
                dPHPP.PaPo.AddInfo7        = ptPP.AddInfo7;
                dPHPP.PaPo.AddInfo8        = ptPP.AddInfo8;
                dPHPP.PaPo.Fee             = ptPP.Fee;
                dPHPP.PaPo.Add_Info_Fee_01 = ptPP.Add_Info_Fee_01;
                dPHPP.PaPo.Add_Info_Fee_02 = ptPP.Add_Info_Fee_02;
                dPHPP.PaPo.Add_Info_Fee_03 = ptPP.Add_Info_Fee_03;
                dPHPP.PaPo.Add_Info_Fee_04 = ptPP.Add_Info_Fee_04;
                dPHPP.PaPo.Add_Info_Fee_05 = ptPP.Add_Info_Fee_05;

                dPHPP.Them();

                //Danh dau da truyen
                ptPP.DaTruyen = true;
                dPP.Them(ptPP);

                ptLog.SoLuong  = ptLog.SoLuong + 1;
                ptLog.TongTien = ptLog.TongTien.Value + Convert.ToDecimal(ptPP.TranAmount.Value);

                Day(ptPP, null);
            }

            daLogLanLayDuLieu dLog = new daLogLanLayDuLieu();

            ptLog.DichVu          = "PayPost";
            ptLog.ThoiGianKetThuc = DateTime.Now;
            dLog.Them(ptLog);

            if (ptLog.SoLuong != 0)
            {
                daLanLayDuLieu dLan = new daLanLayDuLieu();
                dLan.LanLay.MaBuuCuc        = ptLog.MaBuuCuc;
                dLan.LanLay.MAC             = ptLog.MAC;
                dLan.LanLay.DiaChiIP        = ptLog.DiaChiIP;
                dLan.LanLay.DichVu          = ptLog.DichVu;
                dLan.LanLay.SoLuong         = ptLog.SoLuong;
                dLan.LanLay.TongTien        = ptLog.TongTien;
                dLan.LanLay.ThoiGianBatDau  = ptLog.ThoiGianBatDau;
                dLan.LanLay.ThoiGianKetThuc = ptLog.ThoiGianKetThuc;
                dLan.Them();
            }

            DayXong(null, null);
        }
示例#2
0
        public void Chay()
        {
            daCauHinh dCH = new daCauHinh();

            dCH.Lay(dCH.TimMaThamSo((int)daCauHinh.eCauHinh.Lấy_BCCP));
            bool _LayBCCP = false;

            if (dCH.CauHinh != null)
            {
                try
                {
                    _LayBCCP = bool.Parse(dCH.CauHinh.GiaTri);
                }
                catch { }
            }
            if (!_LayBCCP)
            {
                //May nay khong lay BCCP
                return;
            }

            clsLan ptLog = new clsLan();

            ptLog.ThoiGianBatDau = DateTime.Now;

            dCH.Lay(dCH.TimMaThamSo((int)daCauHinh.eCauHinh.Mã_Bưu_Cục));
            if (dCH.CauHinh != null)
            {
                ptLog.MaBuuCuc = dCH.CauHinh.GiaTri;
            }


            daThongTinMay dTTM = new daThongTinMay();

            ptLog.MAC      = dTTM.MAC;
            ptLog.DiaChiIP = dTTM.DiaChiIP;

            daPhatHanhBCCP dPHBCCP = new daPhatHanhBCCP();

            daDuLieuBCCP         dBCCP     = new daDuLieuBCCP();
            List <clsDuLieuBCCP> lstTruyen = new List <clsDuLieuBCCP>();

            lstTruyen = dBCCP.LayDanhSachChuaTruyen();

            foreach (clsDuLieuBCCP ptBCCP in lstTruyen)
            {
                dPHBCCP.PH.MaBuuCuc         = ptLog.MaBuuCuc;
                dPHBCCP.PH.NgayPhatHanh     = ptBCCP.NgayPhatHanh;
                dPHBCCP.PH.MAC              = ptBCCP.MAC;
                dPHBCCP.PH.SoHieu           = ptBCCP.SoHieu;
                dPHBCCP.PH.MaDichVu         = ptBCCP.MaDichVu;
                dPHBCCP.PH.TenDichVu        = ptBCCP.TenDichVu;
                dPHBCCP.PH.LoaiBuuGui       = ptBCCP.LoaiBuuGui;
                dPHBCCP.PH.SoChuyen         = ptBCCP.SoChuyen;
                dPHBCCP.PH.SoTui            = ptBCCP.SoTui;
                dPHBCCP.PH.MaDuongThu       = ptBCCP.MaDuongThu;
                dPHBCCP.PH.MaBuuCucChapNhan = ptBCCP.MaBuuCucChapNhan;
                dPHBCCP.PH.NgayGioChapNhan  = ptBCCP.NgayGioChapNhan;
                dPHBCCP.PH.MaBuuCucDong     = ptBCCP.MaBuuCucDong;
                dPHBCCP.PH.NgayGioDong      = ptBCCP.NgayGioDong;
                dPHBCCP.PH.TrongLuong       = ptBCCP.TrongLuong;
                dPHBCCP.PH.TrongLuongQuiDoi = ptBCCP.TrongLuongQuiDoi;
                dPHBCCP.PH.MaTinhPhat       = ptBCCP.MaTinhPhat;
                dPHBCCP.PH.MaNuocPhat       = ptBCCP.MaNuocPhat;
                dPHBCCP.PH.MaKhachHang      = ptBCCP.MaKhachHang;
                dPHBCCP.PH.TenKhachHang     = ptBCCP.TenKhachHang;
                dPHBCCP.PH.DiaChiKhachHang  = ptBCCP.DiaChiKhachHang;
                dPHBCCP.PH.TenNguoiNhan     = ptBCCP.TenNguoiNhan;
                dPHBCCP.PH.DiaChiNguoiNhan  = ptBCCP.DiaChiNguoiNhan;
                dPHBCCP.PH.CuocChinh        = ptBCCP.CuocChinh;
                dPHBCCP.PH.PhuPhiXD         = ptBCCP.PhuPhiXD;
                dPHBCCP.PH.PhuPhiVX         = ptBCCP.PhuPhiVX;
                dPHBCCP.PH.CuocCongThem     = ptBCCP.CuocCongThem;
                dPHBCCP.PH.DichVuCongThem   = ptBCCP.DichVuCongThem;
                dPHBCCP.PH.SoTienCOD        = ptBCCP.SoTienCOD;
                dPHBCCP.PH.CuocCOD          = ptBCCP.CuocCOD;
                dPHBCCP.PH.VAT              = ptBCCP.VAT;
                dPHBCCP.PH.CuocCODVAT       = ptBCCP.CuocCODVAT;
                dPHBCCP.PH.ThanhTien        = ptBCCP.ThanhTien;
                dPHBCCP.PH.TongCuoc         = ptBCCP.TongCuoc;
                dPHBCCP.PH.GhiNo            = ptBCCP.GhiNo;
                dPHBCCP.PH.NoiDungBuuGui    = ptBCCP.NoiDungBuuGui;
                dPHBCCP.PH.GuiLo            = ptBCCP.GuiLo;
                dPHBCCP.PH.SoLo             = ptBCCP.SoLo;

                dPHBCCP.ThemPH();

                //Danh dau da truyen
                ptBCCP.DaTruyen = true;
                dBCCP.CapNhat(ptBCCP);

                Day(ptBCCP, null);
            }

            ptLog.SoLuong = lstTruyen.Count;

            daLogLanLayDuLieu dLog = new daLogLanLayDuLieu();

            ptLog.DichVu          = "BCCP";
            ptLog.ThoiGianKetThuc = DateTime.Now;
            dLog.Them(ptLog);

            if (ptLog.SoLuong != 0)
            {
                daLanLayDuLieu dLan = new daLanLayDuLieu();
                dLan.LanLay.MaBuuCuc        = ptLog.MaBuuCuc;
                dLan.LanLay.MAC             = ptLog.MAC;
                dLan.LanLay.DiaChiIP        = ptLog.DiaChiIP;
                dLan.LanLay.DichVu          = ptLog.DichVu;
                dLan.LanLay.SoLuong         = ptLog.SoLuong;
                dLan.LanLay.TongTien        = ptLog.TongTien;
                dLan.LanLay.ThoiGianBatDau  = ptLog.ThoiGianBatDau;
                dLan.LanLay.ThoiGianKetThuc = ptLog.ThoiGianKetThuc;

                dCH.Lay(dCH.TimMaThamSo((int)daCauHinh.eCauHinh._Chuỗi_Kết_nối_Chạy));
                if (dCH.CauHinh != null)
                {
                    dLan.LanLay.ChuoiKetNoi = dCH.CauHinh.GiaTri;
                }
                dLan.LanLay.ChuoiKetNoi = "";

                dLan.Them();
            }
            try
            {
                DayXong(null, null);
            }
            catch { }
        }