public static TruckSummary DoSum(this IEnumerable <TruckSummary> tss) { var ts = new TruckSummary(); foreach (var ti in tss) { ts.TongCuocDen += ti.TongCuocDen; ts.DienThoaiCoKhach += ti.DienThoaiCoKhach; ts.ThueBao += ti.ThueBao; ts.KhaiThac += ti.KhaiThac; ts.MoCua += ti.MoCua; ts.Truot += ti.Truot; ts.TBDuongDai += ti.TBDuongDai; ts.TongCuocHang += ti.TongCuocHang; ts.GiucXe += ti.GiucXe; ts.HoanXe += ti.HoanXe; ts.KhieuNai += ti.KhieuNai; ts.XinLoi += ti.XinLoi; ts.BocXep += ti.BocXep; ts.GoiLai += ti.GoiLai; ts.KhachHen += ti.KhachHen; ts.HoiGia += ti.HoiGia; ts.GoiKhac += ti.GoiKhac; ts.NoiBo += ti.NoiBo; ts.NhayMay += ti.NhayMay; ts.HetXe += ti.HetXe; ts.KhongCapNhat += ti.KhongCapNhat; } return(ts); }
/// <summary> /// Tổng hợp cuốc hàng - cuộc gọi /// </summary> /// <param name="ti"></param> /// <returns></returns> public static TruckSummary ToTruckSummary(this TruckInfo ti) { var ts = new TruckSummary(); if (ti.KhongCapNhat) { ts.KhongCapNhat = 1; } ts.Ca = ti.Ca; if (ti.TongGoiDen) { ts.TongCuocDen = 1; } //Nếu là dữ liệu bảng Truck thì không cần tính các thông số sau if (ti.CuocKhongCapNhat == 1) { return(ts); } if (ti.ThueBao) { ts.ThueBao = 1; } if (ti.KhaiThac) { ts.KhaiThac = 1; } if (ti.MoCua) { ts.MoCua = 1; } if (ti.Truot) { ts.Truot = 1; } if (ti.TBDuongDai) { ts.TBDuongDai = 1; } if (ti.CuocHang) { ts.TongCuocHang = 1; } if (ti.DienThoaiCoKhach) { ts.DienThoaiCoKhach = 1; } if (ti.HetXe) { ts.HetXe = 1; } if (ti.GiucXe) { ts.GiucXe = 1; } if (ti.HoanXe) { ts.HoanXe = 1; } if (ti.KhieuNai) { ts.KhieuNai = 1; } if (ti.XinLoi) { ts.XinLoi = 1; } if (ti.BocXep) { ts.BocXep = 1; } if (ti.GoiLai) { ts.GoiLai = 1; } if (ti.KhachHen) { ts.KhachHen = 1; } if (ti.NhayMay) { ts.NhayMay = 1; } if (ti.NoiBo) { ts.NoiBo = 1; } if (ti.GoiKhac) { ts.GoiKhac = 1; } if (ti.HoiGia) { ts.HoiGia = 1; } return(ts); }
public List <TruckSummary> GetTongKetDienThoai(DateTime?from, DateTime?to) { var list = new List <TruckSummary> { }; var thangnay = ExeStore("EnVang_Report_T_TAXIOPERATION_TRUCK_END_BaoCaoTongKetDieuHanh2", from, to).ToList <TruckInfo>(); var thangtruoc = ExeStore("EnVang_Report_T_TAXIOPERATION_TRUCK_END_BaoCaoTongKetDieuHanh2", from.Value.AddMonths(-1), from.Value.AddSeconds(-1)).ToList <TruckInfo>(); var ts = new TruckSummary { }; foreach (var tn in thangnay) { if (tn.DienThoaiCoKhach) { ts.CoHang++; } if (tn.GoiLai) { ts.GoiLai++; } if (tn.HoiGia) { ts.HoiGia++; } if (tn.BocXep) { ts.BocXep++; } if (tn.KhachHen) { ts.KhachHen++; } if (tn.NhayMay) { ts.NhayMay++; } if (tn.NoiBo) { ts.NoiBo++; } if (tn.GoiKhac) { ts.GoiKhac++; } if (tn.XinLoi) { ts.XinLoi++; } if (tn.TongGoiDen) { ts.TongCuoc++; } if (tn.GoiNho) { ts.GoiNho++; } if (tn.PhanAnh) { ts.PhanAnh++; } if (tn.KhachHoan) { ts.KhachHoan++; } if (tn.HetXe) { ts.HetXe++; } if (tn.GiucXe) { ts.GiucXe++; } } foreach (var tt in thangtruoc) { if (tt.DienThoaiCoKhach) { ts.CoHang_t++; } if (tt.GoiLai) { ts.GoiLai_t++; } if (tt.HoiGia) { ts.HoiGia_t++; } if (tt.BocXep) { ts.BocXep_t++; } if (tt.KhachHen) { ts.KhachHen_t++; } if (tt.NhayMay) { ts.NhayMay_t++; } if (tt.NoiBo) { ts.NoiBo_t++; } if (tt.GoiKhac) { ts.GoiKhac_t++; } if (tt.XinLoi) { ts.XinLoi_t++; } if (tt.TongGoiDen) { ts.TongCuoc_t++; } if (tt.GoiNho) { ts.GoiNho_t++; } if (tt.PhanAnh) { ts.PhanAnh_t++; } if (tt.KhachHoan) { ts.KhachHoan_t++; } if (tt.HetXe) { ts.HetXe_t++; } if (tt.GiucXe) { ts.GiucXe_t++; } } ts.CoHang_s = ts.CoHang - ts.CoHang_t; ts.GoiLai_s = ts.GoiLai - ts.GoiLai_t; ts.HoiGia_s = ts.HoiGia - ts.HoiGia_t; ts.BocXep_s = ts.BocXep - ts.BocXep_t; ts.KhachHen_s = ts.KhachHen - ts.KhachHen_t; ts.NhayMay_s = ts.NhayMay - ts.NhayMay_t; ts.NoiBo_s = ts.NoiBo - ts.NoiBo_t; ts.GoiKhac_s = ts.GoiKhac - ts.GoiKhac_t; ts.XinLoi_s = ts.XinLoi - ts.XinLoi_t; ts.GoiNho_s = ts.GoiNho - ts.GoiNho_t; ts.PhanAnh_s = ts.PhanAnh - ts.PhanAnh_t; ts.KhachHoan_s = ts.KhachHoan - ts.KhachHoan_t; ts.HetXe_s = ts.HetXe - ts.HetXe_t; ts.GiucXe_s = ts.GiucXe - ts.GiucXe_t; //ts.TongCuoc = thangnay.Count; //ts.TongCuoc_t = thangtruoc.Count; ts.TongCuoc_s = ts.TongCuoc - ts.TongCuoc_t; list.Add(ts); return(list); }