public void LuuBangDuLieu() { if (BangDuLieu.Rows.Count > 0) { daDuLieuBCCP dBCCP = new daDuLieuBCCP(); dBCCP.Xoa(MaBuuCuc); for (int i = 0; i < BangDuLieu.Rows.Count; i++) { dBCCP.Them(Chuyen1Dong(BangDuLieu.Rows[i], i + 1)); Luu(i, null); } KetThucLuu(BangDuLieu, null); } }
public void LayNoiTinh() { clsSoLieu pt; daDuLieuBCCP dBCCP = new daDuLieuBCCP(); List <clsBaoCaoKeToan> lstNT; lstNT = dBCCP.PhatHanhNoiTinh(TuNgay); //daLayBangCuoc dLay = new daLayBangCuoc(); int j; if (lstNT.Count > 0) { foreach (clsBaoCaoKeToan nt in lstNT) { pt = new clsSoLieu(); pt.MaDichVu = nt.Ma; pt.TenDichVu = nt.Ten; pt.MaDichVuCT = ""; pt.SoLuong = nt.SoLuong; pt.TrongLuong = pt.TrongLuong; pt.Cuoc = nt.ThanhTien; pt.CuocCOD = nt.ThanhTienCOD; //pt.TenDichVu = pt.TenDichVu + "_" + pt.MaDichVuCT; //KetQua.Rows.Add(pt.MaDichVu, pt.MaDichVuCT, pt.TenDichVu + (pt.MaDichVuCT==""?"":("_" + pt.MaDichVuCT)), pt.SoLuong, pt.TrongLuong, pt.Cuoc, pt.CuocCOD, 0, 0, 0, 0, 0, 0, 0, 0); j = TimTen(pt.MaDichVu, pt.MaDichVuCT == null ? "" : pt.MaDichVuCT); if (j == -1) { KetQua.Rows.Add(pt.MaDichVu, pt.MaDichVuCT, pt.TenDichVu + (pt.MaDichVuCT == ""?"":("_" + pt.MaDichVuCT)), pt.SoLuong, pt.TrongLuong, pt.Cuoc, pt.CuocCOD, 0, 0, 0, 0, 0, 0, 0, 0); } else { KetQua.Rows[j]["SoLuongNT"] = Convert.ToInt32(KetQua.Rows[j]["SoLuongNT"]) + pt.SoLuong; KetQua.Rows[j]["TrongNT"] = Convert.ToDecimal(KetQua.Rows[j]["TrongNT"]) + pt.TrongLuong; KetQua.Rows[j]["CuocNT"] = Convert.ToDecimal(KetQua.Rows[j]["CuocNT"]) + pt.Cuoc; KetQua.Rows[j]["CuocCODNT"] = Convert.ToDecimal(KetQua.Rows[j]["CuocCODNT"]) + pt.CuocCOD; } } } }
public void LayQuocTe() { clsSoLieu pt; int j; daDuLieuBCCP dBCCP = new daDuLieuBCCP(); List <clsBaoCaoKeToan> lstQT; lstQT = dBCCP.PhatHanhQuocTe(TuNgay); if (lstQT.Count > 0) { foreach (clsBaoCaoKeToan nt in lstQT) { pt = new clsSoLieu(); pt.MaDichVu = nt.Ma; pt.TenDichVu = nt.Ten; pt.MaDichVuCT = ""; pt.SoLuong = nt.SoLuong; pt.TrongLuong = pt.TrongLuong; pt.Cuoc = nt.ThanhTien; pt.CuocCOD = nt.ThanhTienCOD; j = TimTen(pt.MaDichVu, pt.MaDichVuCT == null ? "" : pt.MaDichVuCT); if (j == -1) { KetQua.Rows.Add(pt.MaDichVu, pt.MaDichVuCT == null ? "" : pt.MaDichVuCT, pt.TenDichVu + (pt.MaDichVuCT == null ? "" : ("_" + pt.MaDichVuCT)), 0, 0, 0, 0, 0, 0, 0, 0, pt.SoLuong, pt.TrongLuong, pt.Cuoc, pt.CuocCOD); } else { KetQua.Rows[j]["SoLuongQT"] = pt.SoLuong; KetQua.Rows[j]["TrongQT"] = pt.TrongLuong; KetQua.Rows[j]["CuocQT"] = pt.Cuoc; KetQua.Rows[j]["CuocCODQT"] = pt.CuocCOD; } } } }