public DataTable DanhSachBuuGui_TrangThai_PhatThanhCong() { //Lay tat ca so lieu cua mot buu cuc db.ChuoiKetNoi = ChuoiKetNoi; db.TaoKetNoi(); DataSet ds; ds = db.ChayThuTuc("select DeliveryDate as NgayDoiSoat, ItemCode as SoHieu, DeliveryDate as NgayGioPhat,DeliveryNote GhiChu, " + "RealReciverName NguoiKyNhan, InputDate as NgayGioNhap, InputingUser NguoiNhap, ToPosCode as MaBuuCucNhap " + "from Delivery " + "where IsDeliverable=1 and DeliveryDate between '" + TuNgay.ToString("MM/dd/yyyy") + "' and '" + DenNgay.AddDays(1).ToString("MM/dd/yyyy") + "'"); return(ds.Tables[0]); }
public DataTable DanhSachBuuGui_ChuyenHoan() { //Lay tat ca so lieu cua mot buu cuc db.TaoKetNoi(FileConfigBCCP); DataSet ds; ds = db.ChayThuTuc("select A.ReturnDate as NgayDoiSoat, A.ItemCode as SoHieu,E.VietnameseCauseName as LyDo, A.ReturnDate as NgayNhanChuyenHoan, " + "A.ReceiverFullname TenNguoiNhan, A.ReceiverAddress DiaChiNguoiNhan, A.ReceiverTel,B.Weight,D.Value, " + "A.MainFreight as CuocChinh, A.FuelSurchargeFreight as PhuPhiXD, A.Freight TongCuoc, A.VATFreight VAT, A.FreightVAT ThanhTien, A.POSCode as MaBuuCucNhap " + "from ItemReturn A " + "left join Item B on A.ItemCode=B.ItemCode " + "inner join ItemVASPropertyValue D " + "on D.ItemCode = A.ItemCode " + "left join Cause E on A.Reason=E.CauseCode " + "where A.ReturnDate between '" + TuNgay.ToString("MM/dd/yyyy") + "' and '" + DenNgay.AddDays(1).ToString("MM/dd/yyyy") + "'" + " and D.PropertyCode = 'Amount' and isnull(D.Value, 0) <> 0 "); return(ds.Tables[0]); }
public DataTable BaoCaoDonViCot() { daDB dDB = new daDB(); dDB.TaoKetNoiTuConfig(); return(dDB.ChayThuTuc("sp_tblDoanhThuKhachHangDichVu_BaoCao_DonViCot '" + TuNgay.ToString() + "','" + DenNgay.ToString() + "','" + MaDonVi + "'").Tables[0]); }
private void ReadCallLog(string fileName) { if (System.IO.File.Exists(fileName)) { string[] CallLog = System.IO.File.ReadAllLines(fileName); for (int i = CallLog.Length - 1; i > 0; i = i - 1) { try { string MaPhong; DateTime Ngayct; DateTime DenNgay; string Tg; string Call = CallLog[i]; Call = RemovedSpace(Call); string[] c = Call.Split((" ").ToCharArray()); if (c.Length < 6) { continue; } string[] t = c[0].Split("=".ToCharArray()); if (t.Length < 2) { continue; } string[] dmy = t[1].Split("/".ToCharArray()); if (dmy.Length < 3) { continue; } Ngayct = DateTime.Parse(dmy[1] + "/" + dmy[0] + "/" + dmy[2] + " " + t[0]); MaPhong = c[2]; Tg = c[5]; Tg = Tg.Replace("'", ":"); string[] hms = Tg.Split(":".ToCharArray()); if (hms.Length < 3) { continue; } TimeSpan tg = new TimeSpan(int.Parse(hms[0]), int.Parse(hms[1]), int.Parse(hms[2])); DenNgay = Ngayct.Add(tg); if (!CheckReaded(Ngayct, MaPhong)) { string sql = "insert into ctCuocgoi(NgayCt, std, Soden, MaPhong, DenNgay) values('" + Ngayct.ToLongDateString() + "','" + MaPhong + "','" + c[4] + "','" + MaPhong + "','" + DenNgay.ToLongDateString() + "')"; _db.UpdateByNonQuery(sql); //_db.HasErrors = false; if (_db.HasErrors) { timer1.Enabled = false; return; } } else { return; } } catch (Exception e) { } } } }
public BaoCaoDoanhThu() { InitializeComponent(); lbltitle1.Text = "TỪ NGÀY " + TuNgay.ToString("dd/MM/yyyy") + " - " + DenNgay.ToString("dd/MM/yyyy"); lblNhanVienLap.Text = NhanVienLap; lblNgayLap.Text = DateTime.Now.Date.ToString("dd/MM/yyyy"); }