string typeHD = "Lẻ";//loại hóa đơn ban đầu là lẻ //void Clear(Control Parent) //{ // //Group box 1 // tb_maKH.ResetText(); // tb_Coupon.ResetText(); // dgv_KhachHang.DataSource= null; // // Group box 2 // dgv_HoaDon.DataSource=null; // lb_ThongBao.Text = "[Mã HĐ]"; // lb_TongTien.Text = "0"; // //Group box 3 // tbTN_tenSP.ResetText(); // dgvTN_TimKiem.DataSource = null; // //Group box 4 // tbTN_maSP.ResetText(); // tb_tenSP.ResetText(); // tbTN_donGia.Text = "0"; // tbTN_soLuong.Text = "0"; // lbTN_thanhTien.Text = "0"; //} private void btTN_TimKiem_Click(object sender, EventArgs e) { switch (cb_loaiSP.Text) { case "Tất cả": { dgvTN_TimKiem.DataSource = SanPham_BUS.timKiemSanPham(tb_tenSP.Text, ""); break; } case "Điện thoại": { dgvTN_TimKiem.DataSource = SanPham_BUS.timKiemSanPham(tb_tenSP.Text, "ĐTDĐ"); break; } case "Phụ kiện": { dgvTN_TimKiem.DataSource = SanPham_BUS.timKiemSanPham(tb_tenSP.Text, cb_loaiSP.Text); break; } default: { dgvTN_TimKiem.DataSource = SanPham_BUS.timKiemSanPham(tb_tenSP.Text, ""); break; } } }
private void btnThemSanPham_Click(object sender, EventArgs e) { if (txtTenSanPham.Text.Trim() == "" || txtLoaiSanPham.Text.Trim() == "" || txtDonGia.Text.Trim() == "") { MessageBox.Show("Bạn chưa nhập đầy đủ thông tin", "Thông báo"); } else { SanPham_DTO sp = new SanPham_DTO(); sp.TenSP = txtTenSanPham.Text; sp.LoaiSP = txtLoaiSanPham.Text; sp.DonGia = decimal.Parse(txtDonGia.Text); sp.IconUrl = imageName; sp.NgayTao = dateTimeNgayTapSP.Value; if (imagePath != "") { DirectoryInfo di = Directory.CreateDirectory("data/hinhanh"); string path = System.IO.Path.Combine(di.FullName, imageName); System.IO.File.Copy(imagePath, path, true); } SanPham_BUS dtBus = new SanPham_BUS(); dtBus.ThemSanPham(sp, 1); MessageBox.Show("Đã Thêm 1 Sản Phẩm mới"); LoadDSSP(); ResetSP(); } }
private void button1_Click(object sender, EventArgs e) { string masp = txtTim.Text; SanPham_BUS.timkiem(masp); dataGridView1.DataSource = SanPham_BUS.timkiem(masp); }
private void btnXacNhanSuaThongTinXanPham_Click(object sender, EventArgs e) { SanPham sanpham = KT_SanPhamTonTai(SanPham_BUS.getAllSanPham(), txtMaSanPhamCanSua.Text); if (getDataOnChangeSanPham()) { sanpham.TenSP = txtTenSanPhamCanSua.Text; sanpham.GiaBan = Convert.ToDouble(txtGiaBanSanPhamCanSua.Text); sanpham.GiamGia = Convert.ToDouble(txtGiamGiaSanPhamCanSua.Text); sanpham.LoaiSP = txtLoaiSanPhamCanSua.Text; if (SanPham_BUS.ChangeSanPham(sanpham)) { MessageBox.Show("Thay đổi thông tin thành công !"); txtMaSanPhamCanSua.Text = ""; txtTenSanPhamCanSua.Text = ""; txtGiaBanSanPhamCanSua.Text = ""; txtGiamGiaSanPhamCanSua.Text = ""; txtLoaiSanPhamCanSua.Text = ""; } else { MessageBox.Show("Thay đổi thất bại !"); } } else { MessageBox.Show("Vui lòng đập đúng định dạng thông tin !"); } }
private void btnGrThemSanPhamMoi_Click(object sender, EventArgs e) { if (txtTenSanPhamMoi.Text.Trim().Length == 0 || txtGiaNhapSanPhamMoi.Text.Trim().Length == 0 || txtGiaBanSanPhamMoi.Text.Trim().Length == 0 || txtSoLuongSanPhamMoi.Text.Trim().Length == 0 || txtLoaiSanPhamMoi.Text.Trim().Length == 0) { lblthemSanPhamMoiLoi.Text = "Vui lòng nhập đầy đủ thông tin !"; } else { if (KT_ThongTinThemSanPhamMoi()) { SanPham sanphamNew = new SanPham(SanPham_BUS.createMaSP(SanPham_BUS.getAllSanPham()), txtTenSanPhamMoi.Text, Convert.ToInt32(txtSoLuongSanPhamMoi.Text), DateTime.Now, Convert.ToDouble(txtGiaNhapSanPhamMoi.Text), Convert.ToDouble(txtGiaBanSanPhamMoi.Text), 0, 0, txtLoaiSanPhamMoi.Text, 1); if (SanPham_BUS.InsertSanPham(sanphamNew)) { MessageBox.Show("Thêm thành công !"); txtTenSanPhamMoi.Text = ""; txtSoLuongSanPhamMoi.Text = ""; txtGiaNhapSanPhamMoi.Text = ""; txtGiaBanSanPhamMoi.Text = ""; txtLoaiSanPhamMoi.Text = ""; } else { MessageBox.Show("Thêm sản phẩm không thành công !"); } } else { lblthemSanPhamMoiLoi.Text = "Vui lòng nhập đúng định dạng thông tin !"; } } }
private void btnSanPhamKhongBanDuoc_Click(object sender, EventArgs e) { grFullSanPham.Controls.Add(listView1); grFullSanPham.Controls.Remove(grThemSanPham); grFullSanPham.Controls.Remove(grXoaSanPham); grFullSanPham.Controls.Remove(grSuaThongTinSanPham); grFullSanPham.Controls.Remove(grNhapHang); listView1.Columns.Clear(); listView1.Items.Clear(); listView1.Columns.Add("MaSP", 120); listView1.Columns.Add("Tên", 120); listView1.Columns.Add("Giá nhập", 120); listView1.Columns.Add("Giá bán", 120); listView1.Columns.Add("Giảm giá", 120); string[] arr = new string[5]; LinkedList <SanPham> list = SanPham_BUS.getAllSanPham(); for (LinkedListNode <SanPham> p = list.First; p != list.Last; p = p.Next) { if (p.Value.TrangThai == 1) { if (p.Value.SoLuongBanRa == 0) { arr[0] = p.Value.MaSP; arr[1] = p.Value.TenSP; arr[2] = p.Value.GiaNhap.ToString(); arr[3] = p.Value.GiaBan.ToString(); arr[4] = p.Value.GiamGia.ToString(); ListViewItem item = new ListViewItem(arr); listView1.Items.Add(item); } } } }
private void btnTimKiemSP_Click(object sender, EventArgs e) { List <SanPham_DTO> listsp = new List <SanPham_DTO>(); SanPham_BUS sp = new SanPham_BUS(); listsp = sp.TimSanPhamTheoMa(txtTimKiemSP.Text); dataGridViewQlSanPham.DataSource = listsp; }
private void SP_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'bakeryDataSet1.NHASX' table. You can move, or remove it, as needed. this.nHASXTableAdapter.Fill(this.bakeryDataSet1.NHASX); // TODO: This line of code loads data into the 'bakeryDataSet.LOAI' table. You can move, or remove it, as needed. this.lOAITableAdapter.Fill(this.bakeryDataSet.LOAI); dataGridView1.DataSource = SanPham_BUS.hienthi(); }
private void frmReportSanPham_Load(object sender, EventArgs e) { CrystalReportSanPham cry = new CrystalReportSanPham(); DataTable table = new DataTable(); table = SanPham_BUS.getAllDataTable(); cry.SetDataSource(table); crystalReportViewer1.ReportSource = cry; }
private void LoadFrom() { HoaDon_BUS hd = new HoaDon_BUS(); listhd = hd.LayDanhSachHoaDonChoTN(); dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect; dataGridView1.RowHeadersVisible = false; dataGridView1.AutoGenerateColumns = false; dataGridView1.DataSource = hd.LayDanhSachHoaDonChoQl(); CTHoaDon_BUS cthd = new CTHoaDon_BUS(); listCTHD = cthd.LayDanhSachCTHoaDon(); dataGridView2.SelectionMode = DataGridViewSelectionMode.FullRowSelect; dataGridView2.RowHeadersVisible = false; dataGridView2.AutoGenerateColumns = false; dataGridView2.DataSource = listCTHD; SanPham_BUS sp = new SanPham_BUS(); listsp = sp.LayDanhSachSanPham(); ilsLagre = new ImageList(); ilsLagre.ColorDepth = ColorDepth.Depth24Bit; ilsLagre.ImageSize = new Size(100, 100); lvSP.LargeImageList = ilsLagre; ilsSmall = new ImageList(); ilsSmall.ColorDepth = ColorDepth.Depth8Bit; ilsSmall.ImageSize = new Size(30, 30); lvSP.SmallImageList = ilsSmall; foreach (SanPham_DTO mySPTemp in listsp) { ListViewItem lvi = new ListViewItem(mySPTemp.TenSP.ToString()); lvi.SubItems.Add(mySPTemp.MaSP.ToString()); lvi.SubItems.Add(mySPTemp.LoaiSP.ToString()); lvi.SubItems.Add(mySPTemp.DonGia.ToString()); string strFileName = "data/hinhanh/" + mySPTemp.IconUrl; Bitmap bm = new Bitmap(strFileName); ilsLagre.Images.Add(strFileName, bm); ilsSmall.Images.Add(strFileName, bm); lvi.ImageKey = strFileName; lvSP.Items.Add(lvi); lvSP.FullRowSelect = true; } if (listhd.Count == 0) { txtMaHD.Text = "501"; } else { txtMaHD.Text = (int.Parse(listhd[listhd.Count - 1].MaHD.ToString()) + 1).ToString(); } }
private void button6_Click(object sender, EventArgs e) { this.txtMaSP.Clear(); this.txtTenSP.Clear(); this.txtGia.Clear(); this.txtsl.Clear(); this.txtTim.Clear(); dataGridView1.DataSource = SanPham_BUS.hienthi(); }
public void PostSanPham([FromBody] SanPham_OBJ obj) { if (!ModelState.IsValid) { return; } SanPham_BUS bus = new SanPham_BUS(); bus.ThemMoiSanPham(obj); }
private void button5_Click(object sender, EventArgs e) { string masp = dataGridView1.CurrentCell.Value.ToString(); if (MessageBox.Show("Chắc chắn xóa chứ ?", "Title", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { SanPham_BUS.XoaSP(masp); } dataGridView1.DataSource = SanPham_BUS.hienthi(); }
public IHttpActionResult GetId(int MaSanPham) { SanPham_BUS bus = new SanPham_BUS(); if (bus.HienThiSanPhamTheoID(MaSanPham) == null) { return(NotFound()); } return(Ok(bus.HienThiSanPhamTheoID(MaSanPham))); }
public IHttpActionResult PutSanPham([FromBody] SanPham_OBJ obj) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } SanPham_BUS bus = new SanPham_BUS(); bus.CapNhapSanPham(obj); return(StatusCode(HttpStatusCode.NoContent)); }
private void LoadDSSP() { SanPham_BUS sp = new SanPham_BUS(); List <SanPham_DTO> dssp = sp.LayDanhSachSanPham(); dataGridViewQlSanPham.MultiSelect = false; dataGridViewQlSanPham.AutoGenerateColumns = false; dataGridViewQlSanPham.DataSource = dssp; dataGridViewQlSanPham.SelectionMode = DataGridViewSelectionMode.FullRowSelect; //dataGridViewQlSanPham.ReadOnly = true; dataGridViewQlSanPham.RowHeadersVisible = false; }
private void frmChonBaoCao_Load(object sender, EventArgs e) { loaispnbus = new LoaiSP_BUS(); lsloaiSP = loaispnbus.DanhSachLoaiSP(); cboSPtheoLoai.DataSource = lsloaiSP; cboSPtheoLoai.DisplayMember = "TenLoaiSP"; cboSPtheoLoai.ValueMember = "MaLoaiSP"; //load danh sach san pham sanpham = new SanPham_BUS(); lsSP = sanpham.DanhSachSanPham(); }
public IHttpActionResult Delete(int MaSanPham) { SanPham_BUS bus = new SanPham_BUS(); if (bus.XoaSanPham(MaSanPham) == null) { return(NotFound()); } else { return(Ok(bus.XoaSanPham(MaSanPham))); } }
private void txtMaHangHoaNhapVe_Leave(object sender, EventArgs e) { SanPham sanpham = KT_SanPhamTonTai(SanPham_BUS.getAllSanPham(), txtMaHangHoaNhapVe.Text); if (sanpham == null) { MessageBox.Show("Sản phẩm không tồn tại !"); txtMaHangHoaNhapVe.Text = ""; } else { txtTenSanPhamNhapHang.Text = sanpham.TenSP; txtSoHangHienDangCo.Text = sanpham.SoLuong.ToString(); } }
private void button3_Click(object sender, EventArgs e) { string from = txtGia.Text; if (IsNumber(from) == false) { MessageBox.Show("Giá phải là số nguyên", "Thông báo"); return; } string soluong = txtsl.Text; if (IsNumber(soluong) == false) { MessageBox.Show("Số lượng phải là số nguyên", "Thông báo"); return; } string to = txtto.Text; if (IsNumber(to) == false) { MessageBox.Show("Giá phải là số nguyên", "Thông báo"); return; } string loai; string nhasx; SqlConnection cnn = sqlConnectionData.Ketnoi(); cnn.Open(); SqlCommand cmd = new SqlCommand("select * from LOAI where MaLoai='" + cbLoai.SelectedValue.ToString() + "'", cnn); SqlDataReader r = cmd.ExecuteReader(); r.Read(); loai = r.GetString(0).ToString(); r.Close(); SqlCommand cmd1 = new SqlCommand("select * from NHASX where MaSX='" + cbSX.SelectedValue.ToString() + "'", cnn); SqlDataReader r1 = cmd1.ExecuteReader(); r1.Read(); nhasx = r1.GetString(0).ToString(); r1.Close(); string masp = txtMa.Text; string tensp = txtTenSP.Text; SanPham_BUS.timkiemNC(masp, tensp, loai, from, to, nhasx, soluong); dataGridView1.DataSource = SanPham_BUS.timkiemNC(masp, tensp, loai, from, to, nhasx, soluong); }
private void btnXoaSanPham_Click(object sender, EventArgs e) { if (dataGridViewQlSanPham.SelectedRows.Count > 0) { SanPham_DTO sp = (SanPham_DTO)dataGridViewQlSanPham.SelectedRows[0].DataBoundItem; if (MessageBox.Show("Bạn có chắc muốn xóa sản phẩm " + sp.MaSP + " không?", "Cảnh báo", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { SanPham_BUS sp1 = new SanPham_BUS(); sp1.XoaSanPham(sp); MessageBox.Show("Đã xóa thành công sản phẩm"); LoadDSSP(); ResetSP(); } } }
private void btnOKSearchSanPhamSua_Click(object sender, EventArgs e) { SanPham sanphamcansua = KT_SanPhamTonTai(SanPham_BUS.getAllSanPham(), txtMaSanPhamCanSua.Text); if (sanphamcansua == null) { MessageBox.Show($"{txtMaSanPhamCanSua.Text} không tìm thấy !"); } else { txtTenSanPhamCanSua.Text = sanphamcansua.TenSP; txtGiaBanSanPhamCanSua.Text = sanphamcansua.GiaBan.ToString(); txtGiamGiaSanPhamCanSua.Text = sanphamcansua.GiamGia.ToString(); txtLoaiSanPhamCanSua.Text = sanphamcansua.LoaiSP; btnXacNhanSuaThongTinXanPham.Enabled = true; } }
private void btnDanhSachSanPham_Click(object sender, EventArgs e) { loai = 1; dgvDanhSach.DataSource = SanPham_BUS.getAllDataTable(); cboLoc.Items.Clear(); cboLoc.Text = ""; LinkedList <SanPham> listSanpham = SanPham_BUS.getAllSanPham(); if (listSanpham != null) { for (LinkedListNode <SanPham> p = listSanpham.First; p != null; p = p.Next) { if (KT_TrungCbo(p.Value.LoaiSP.ToString()) == false) { cboLoc.Items.Add(p.Value.LoaiSP); } } } }
private void btnSuaSanPham_Click(object sender, EventArgs e) { if (dataGridViewQlSanPham.SelectedRows.Count > 0) { SanPham_DTO sp = (SanPham_DTO)dataGridViewQlSanPham.SelectedRows[0].DataBoundItem; sp.TenSP = txtTenSanPham.Text; sp.LoaiSP = txtLoaiSanPham.Text; sp.DonGia = decimal.Parse(txtDonGia.Text); sp.NgayTao = dateTimeNgayTapSP.Value; SanPham_BUS spBus = new SanPham_BUS(); spBus.SuaThongTinSanPham(sp); MessageBox.Show("Đã Sửa 1 Sản Phẩm "); LoadDSSP(); ResetSP(); } }
private void btnXoaSanPhamWithMaSP_Click(object sender, EventArgs e) { bool check = false; if (txtMaSanPhamXoa.Text.Trim().Length != 0) { LinkedList <SanPham> list = SanPham_BUS.getAllSanPham(); for (LinkedListNode <SanPham> p = list.First; p != null; p = p.Next) { if (txtMaSanPhamXoa.Text == p.Value.MaSP) { if (p.Value.TrangThai == 0) { MessageBox.Show("Sản phẩm này đã bị xóa !"); txtMaSanPhamXoa.Text = ""; check = true; } else { DialogResult result = MessageBox.Show($"Bạn thật sự muốn xóa : {p.Value.TenSP}", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { if (SanPham_BUS.DeleteSanPham(txtMaSanPhamXoa.Text)) { MessageBox.Show("Xóa thành công !"); txtMaSanPhamXoa.Text = ""; } } check = true; break; } } } if (check == false) { MessageBox.Show($"Không tìm thấy sản phẩm {txtMaSanPhamXoa.Text}"); txtMaSanPhamXoa.Text = ""; } } else { lblXoaSanPhamLoi.Text = "Vui lòng nhập thông tin !"; } }
private void frmXemHD_Load(object sender, EventArgs e) { LinkedList <HoaDon_SanPham> listSP = HoaDon_SanPham_BUS.getAllSanPhamInHoaDon(frmAdmin.mahd.ToString()); HoaDon hoadon = HoaDon_BUS.SearchHD(frmAdmin.mahd.ToString()); NhanVien nhanvien = NhanVien_BUS.getNhanVienWithMaNV(hoadon.MaNV1.ToString()); KhachHang khachhang = KhachHang_BUS.searchKHWithMaKH(hoadon.MaKH1); txtNgayLapHoaDon.Text = hoadon.NgayLap1.ToString(); txtNhanVienLapHoaDon.Text = nhanvien.HoTen1; txtMaNhanVienLapHoaDon.Text = hoadon.MaNV1.ToString(); listView1.Columns.Add("MaSP", 120); listView1.Columns.Add("Tên SP", 100); listView1.Columns.Add("Giá bán", 50); listView1.Columns.Add("Số lượng", 60); listView1.Columns.Add("Tổng tiền", 50); listView1.GridLines = true; listView1.View = View.Details; listView1.FullRowSelect = true; for (LinkedListNode <HoaDon_SanPham> p = listSP.First; p != null; p = p.Next) { SanPham sp = SanPham_BUS.getDataSanPhamWithMaSP(p.Value.MaSP1); string[] arr = new string[5]; arr[0] = p.Value.MaSP1.ToString(); arr[1] = sp.TenSP; arr[2] = (sp.GiaBan - (sp.GiaBan * sp.GiamGia) / 100).ToString(); arr[3] = p.Value.SoLuong1.ToString(); arr[4] = (Convert.ToDouble(p.Value.SoLuong1) * Convert.ToDouble(arr[2])).ToString(); ListViewItem item = new ListViewItem(arr); listView1.Items.Add(item); } txtTongTien.Text = hoadon.GiaTriHD1.ToString(); txtSoLuongHang.Text = listSP.Count.ToString(); txtMaKH.Text = khachhang.MaKH1; txtHoTenKhachHang.Text = khachhang.HoTen1; txtMaHD.Text = hoadon.MaHD1; Barcode barcode = new Barcode(); Color forecolor = Color.Black; Color backcolor = Color.Transparent; Image img = barcode.Encode(TYPE.CODE128, txtMaHD.Text, forecolor, backcolor, (int)(pictureBox1.Width * 0.8), (int)(pictureBox1.Height * 0.8)); pictureBox1.Image = img; pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; }
private void btnTimKiem_Click(object sender, EventArgs e) { if (loai == 1) // Tìm kiếm theo sản phẩm: { dgvDanhSach.DataSource = SanPham_BUS.SearchOnMaSP(txtTimKiem.Text); } else if (loai == 2)//Tìm kiếm theo hóa đơn: { dgvDanhSach.DataSource = HoaDon_BUS.SearchOnMaHD(txtTimKiem.Text); } else if (loai == 3)//Tìm kiếm theo nhân viên: { dgvDanhSach.DataSource = NhanVien_BUS.SearchOnMaNV(txtTimKiem.Text); } else if (loai == 4) // Tìm kiếm theo khách hàng: { dgvDanhSach.DataSource = KhachHang_BUS.SearchOnMaKH(txtTimKiem.Text); } }
private void cboLoc_SelectedIndexChanged(object sender, EventArgs e) { if (loai == 1) // Tìm kiếm theo sản phẩm: { dgvDanhSach.DataSource = SanPham_BUS.LocSanPham(cboLoc.Text); } else if (loai == 2)//Tìm kiếm theo hóa đơn: { dgvDanhSach.DataSource = HoaDon_BUS.LocHoaDon(Convert.ToDateTime(cboLoc.Text)); } else if (loai == 3)//Tìm kiếm theo nhân viên: { dgvDanhSach.DataSource = NhanVien_BUS.LocNhanVien(cboLoc.Text); } else if (loai == 4) // Tìm kiếm theo khách hàng: { dgvDanhSach.DataSource = KhachHang_BUS.LocKhachHang(cboLoc.Text); } }
private void button3_Click(object sender, EventArgs e) { if (kiemtratrungdl() == true) { MessageBox.Show("Mã bánh không được trùng", "Thông Báo"); return; } if (txtMaSP.Text == "" || txtGia.Text == "" || txtsl.Text == "" || txtTenSP.Text == "") { MessageBox.Show("Vui lòng điền đầy đủ thông tin", "Thông Báo"); return; } string loai; string nhasx; SqlConnection cnn = sqlConnectionData.Ketnoi(); cnn.Open(); SqlCommand cmd = new SqlCommand("select * from LOAI where MaLoai='" + cbLoai.SelectedValue.ToString() + "'", cnn); SqlDataReader r = cmd.ExecuteReader(); r.Read(); loai = r.GetString(0).ToString(); r.Close(); SqlCommand cmd1 = new SqlCommand("select * from NHASX where MaSX='" + cbSX.SelectedValue.ToString() + "'", cnn); SqlDataReader r1 = cmd1.ExecuteReader(); r1.Read(); nhasx = r1.GetString(0).ToString(); r1.Close(); string masp = txtMaSP.Text; string tensp = txtTenSP.Text; int gia = int.Parse(txtGia.Text); int soluong = int.Parse(txtsl.Text); SanPham_DTO sp = new SanPham_DTO(masp, tensp, loai, gia, nhasx, soluong); SanPham_BUS.ThemSP(sp); dataGridView1.DataSource = SanPham_BUS.hienthi(); cnn.Close(); }
//[Route("getall")] public PhanTrang <SanPham_OBJ> GetAll(int trang, int SoBanGhi) { int DoDaiDanhSach = 0; SanPham_BUS bus = new SanPham_BUS(); var DanhSach = bus.HienThiDanhSachSanPham(); DoDaiDanhSach = DanhSach.Count(); var TrangSanPham = DanhSach.OrderByDescending(x => x.MaSanPham).Skip(trang * SoBanGhi).Take(SoBanGhi); var PhanTrang = new PhanTrang <SanPham_OBJ>() { DanhSach = TrangSanPham, Trang = trang, SoBanGhi = SoBanGhi, SoTrang = (int)Math.Ceiling((decimal)DoDaiDanhSach / SoBanGhi) }; return(PhanTrang); }