public DTO_DotCuoc getdotcuoc() { DTO_DotCuoc dc = new DTO_DotCuoc(); DataTable dt = daldotcuoc.getDotCuocCuoi(); dc.DotCuoc = int.Parse(dt.Rows[0][0].ToString()); dc.NgayBD = DateTime.Parse(dt.Rows[0][1].ToString()); dc.NgayKT = DateTime.Parse(dt.Rows[0][2].ToString()); return(dc); }
public void insert(DateTime NgayBD, DateTime NgayKT, DTO_DotCuoc dotcuoc) { DAL_CTHDSD ctsd = new DAL_CTHDSD(); DataTable dt = ctsd.getPhi(NgayBD, NgayKT); DTO_DotCuoc dtodotcuoc = new DTO_DotCuoc(); dtodotcuoc.DotCuoc = dotcuoc.DotCuoc + 1; dtodotcuoc.NgayBD = NgayBD; dtodotcuoc.NgayKT = NgayKT; new DAL_DotCuoc().insert(dtodotcuoc); foreach (DataRow row in dt.Rows) { DTO_HoaDon hd = new DTO_HoaDon(); hd.IDSIM = row["IDSIM"].ToString(); hd.TongTien = int.Parse(row["TONG"].ToString()); hd.TrangThai = 0; hd.Ngay = DateTime.Today; hd.DotCuoc = dtodotcuoc.DotCuoc; hdct.insert(hd); } }
public bool insert(DTO_DotCuoc dc) { string sql = "insert into " + table + " values(" + dc.DotCuoc + ",' " + dc.NgayBD + "','" + dc.NgayKT + "')"; return(Update(sql)); }
private void loaddata() { dtodotcuoc = busdotcuoc.getdotcuoc(); lblngay.Text = "*Tính đến " + dtodotcuoc.NgayKT.ToString("dd.MM.yyyy"); dgvHD.DataSource = bushdct.getall_kh(); }
public GUI_HoaDonTinhcuoc() { InitializeComponent(); dtodotcuoc = busdotcuoc.getdotcuoc(); }