private void loadKhuyenMai() { DataTable dt = HoaDonBanControl.layThongTinHDB(HDB.Id); HDB.KhuyenMai = new KhuyenMai(dt.Rows[0]["MaKM"].ToString().Length == 0 ? 0 : Convert.ToInt32(dt.Rows[0]["MaKM"].ToString())); if (HDB.KhuyenMai.TenKM.Length > 0) { cbKhuyenMai.Text = HDB.KhuyenMai.TenKM; return; } cbKhuyenMai.SelectedItem = "-----none-----"; }
public HoaDonBan(int id) { chiTiet = new ChiTietHDB(id); this.id = id; DataTable dt = HoaDonBanControl.layThongTinHDB(id); idKH = dt.Rows[0]["MaKH"].ToString().Length == 0 ? 0 : Convert.ToInt32(dt.Rows[0]["MaKH"].ToString()); idNV = dt.Rows[0]["MaNV"].ToString().Length == 0 ? 0 : Convert.ToInt32(dt.Rows[0]["MaNV"].ToString()); trangThai = Convert.ToInt32(dt.Rows[0]["TrangThai"].ToString()); khuyenMai = new KhuyenMai(dt.Rows[0]["MaKM"].ToString().Length == 0 ? 0 : Convert.ToInt32(dt.Rows[0]["MaKM"].ToString())); thanhToan = double.Parse(dt.Rows[0]["ThanhToan"].ToString()); ngayLap = DateTime.Parse(dt.Rows[0]["NgayLap"].ToString()); }
private void loadNhanVien() { DataTable dt = HoaDonBanControl.layThongTinHDB(HDB.Id); HDB.IdNV = dt.Rows[0]["MaNV"].ToString().Length == 0 ? 0 : Convert.ToInt32(dt.Rows[0]["MaNV"].ToString()); NhanVien nv = new NhanVien(HDB.IdNV); if (nv.TenNV.Length > 0) { cbNhanVien.Text = nv.TenNV; return; } }