public List <HoaDon> DSHoaDonTheoPhong(string ma) { HoaDonDAL dal = new HoaDonDAL(); HopDongDAL hddal = new HopDongDAL(); return(dal.TimHDTheoPhong(ma)); }
private void LoadHoaDon() { HoaDonDAL db = new HoaDonDAL(); DataTable dt = db.SelectChiTiet(IDHoaDon); DataTable dt2 = db.Select(IDHoaDon); gcChiTietHoaDon.DataSource = dt; lueBan.EditValue = dt2.Rows[0]["IDBan"]; lbTongTien.Text = double.Parse(dt2.Rows[0]["TongTien"].ToString()).ToString("C", CultureInfo.CreateSpecificCulture("vi-VN")); }
protected void btnTaoHoaDon_Click1(object sender, EventArgs e) { if (rbKHThanhVien.Checked == true) { //ClientScript.RegisterStartupScript(this.GetType(), "Notification", "Đã tạo hóa đơn thành công", true); foreach (GridViewRow row in gvKHThanhVien.Rows) { RadioButton rbSelected = (RadioButton)row.FindControl("rbSelectedKH"); if (rbSelected.Checked) { string tienCCK = lbTongTienCCKValue.Text; tienCCK = tienCCK.Trim(new char[] { ' ', ',', 'V', 'N', 'D' }); string tienSCK = lbTongTienValue.Text; tienSCK = tienSCK.Trim(new char[] { ' ', ',', 'V', 'N', 'D' }); int chietkhau = int.Parse(tienCCK) - int.Parse(tienSCK); HoaDonDAL hoadon = new HoaDonDAL(); hoadon.AddHoaDon(int.Parse(ngYear.Text), int.Parse(ngMonth.Text), int.Parse(ngDay.Text), int.Parse(nlpYear.Text), int.Parse(nlpMonth.Text), int.Parse(nlpDay.Text), chietkhau, int.Parse(row.Cells[0].Text)); DataTable lastestbill = new DataTable(); lastestbill = hoadon.RetrieveLastMaHD(); string maHD = lastestbill.Rows[0][0].ToString(); foreach (GridViewRow tbrow in gvSelectedItemBill.Rows) { hoadon.AddCTHD(int.Parse(tbrow.Cells[0].Text), int.Parse(maHD), int.Parse(tbrow.Cells[3].Text)); } //ClientScript.RegisterStartupScript(this.GetType(), "Notification", "Đã tạo hóa đơn thành công", true); /*KhachHangDTO._makh = int.Parse(row.Cells[0].Text); * KhachHangDTO._tenkh = row.Cells[1].Text; * KhachHangDTO._diachi = row.Cells[2].Text; * KhachHangDTO._sdt = row.Cells[3].Text; * string queryString = "FormHoaDon.aspx"; * string newWin = "window.open('" + queryString + "');"; * ClientScript.RegisterStartupScript(this.GetType(), "pop", newWin, true);*/ } } } else { KhachHangDAL addKhachHang = new KhachHangDAL(); int maKHMoi = addKhachHang.themKHVangLai(txbTenKHMoi.Text, txbDiaChiKHMoi.Text, txbSDT.Text); string tienCCK = lbTongTienCCKValue.Text; tienCCK = tienCCK.Trim(new char[] { ' ', ',', 'V', 'N', 'D' }); string tienSCK = lbTongTienValue.Text; tienSCK = tienSCK.Trim(new char[] { ' ', ',', 'V', 'N', 'D' }); int chietkhau = int.Parse(tienCCK) - int.Parse(tienSCK); HoaDonDAL hoadon = new HoaDonDAL(); hoadon.AddHoaDon(int.Parse(ngYear.Text), int.Parse(ngMonth.Text), int.Parse(ngDay.Text), int.Parse(nlpYear.Text), int.Parse(nlpMonth.Text), int.Parse(nlpDay.Text), chietkhau, maKHMoi); DataTable lastestbill = new DataTable(); lastestbill = hoadon.RetrieveLastMaHD(); string maHD = lastestbill.Rows[0][0].ToString(); foreach (GridViewRow tbRow in gvSelectedItemBill.Rows) { hoadon.AddCTHD(int.Parse(tbRow.Cells[0].Text), int.Parse(maHD), int.Parse(tbRow.Cells[3].Text)); } ClientScript.RegisterStartupScript(this.GetType(), "Notification", "Đã tạo hóa đơn thành công", true); } }
public bool ThemHD(HoaDon hd) { HoaDonDAL dal = new HoaDonDAL(); if (TimHDTheoMaHoaDon(hd.MaHoaDon) == null) { return(dal.ThemHD(hd)); } else { return(false); } }
private void btnAdd_Click(object sender, EventArgs e) { HoaDonDAL db = new HoaDonDAL(); if (!KiemTra()) { MessageBox.Show("Bạn phải điền đủ thông tin", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } if (IDHoaDon == 0) { if ((String.IsNullOrWhiteSpace(lueBan.Text) && !checkMangVe.Checked)) { MessageBox.Show("Bạn phải điền đủ thông tin", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } IDHoaDon = db.Insert(checkMangVe.Checked ? 0 : (int)lueBan.EditValue, frmMain.TenTaiKhoan); IDBan = lueBan.EditValue == null ? 0 : (int)lueBan.EditValue; } db.InsertChiTiet(IDHoaDon, (int)lueDo.EditValue, (int)txtSoLuong.Value); LoadDanhSachBan(); LoadBanTrong(); LoadHoaDon(); }
public List <HoaDon> DSHoaDonTheoThang(int thang) { HoaDonDAL dal = new HoaDonDAL(); return(dal.TimHDTheoThang(thang)); }
public List <HoaDon> DSHoaDon() { HoaDonDAL dal = new HoaDonDAL(); return(dal.DSHoaDon()); }
public DataTable DTDS() { HoaDonDAL dal = new HoaDonDAL(); return(dal.DTDS()); }
public static bool XoaHDTheoMa(string sHD) { bool kq = HoaDonDAL.XoaHDTheoMa(sHD); return(kq); }
public static bool ThemHD(HoaDon hd) { bool kq = HoaDonDAL.ThemHD(hd); return(kq); }
public static DataTable LayDSHD() { DataTable dt = HoaDonDAL.LayDSHD(); return(dt); }
public HoaDonBUS() { hdDAL = new HoaDonDAL(); }
public static DataTable LayDoanhThuTheoNam(int nam) { return(HoaDonDAL.LayDoanhThuTheoNam(nam)); }
public static bool LuuThongTinHoaDon(HoaDonDTO hoaDonDTO) { return(HoaDonDAL.LuuThongTinHoaDon(hoaDonDTO)); }
public static bool LuuThongTinThuePhong(ThuePhongDTO thuePhongDTO, HoaDonDTO hoaDonDTO) { return(HoaDonDAL.LuuThongTinHoaDon(hoaDonDTO) && ThuePhongBUS.LuuThongTinThuePhong(thuePhongDTO)); }
public List <HoaDon> DSHoaDonTheoThangVaPhong(int t, string ma) { HoaDonDAL dal = new HoaDonDAL(); return(dal.TimHDTheoThangVaPhong(t, ma)); }
public bool ThemHD(HoaDon hd) { HoaDonDAL dal = new HoaDonDAL(); return(dal.ThemHD(hd)); }
public static DataTable TraCuuHDTheoKyHieu(string keyword) { DataTable kq = HoaDonDAL.TraCuuHDTheoKyHieu(keyword); return(kq); }
public static bool UpdateHD(HoaDon hd) { bool kq = HoaDonDAL.UpdateHD(hd); return(kq); }
public HoaDonBUS() { hdContext = new HoaDonDAL(); }
public HoaDonBUS() { bdal = new HoaDonDAL(); }
public HoaDonBLL() { this.hddal = new HoaDonDAL(); }