public IHttpActionResult GetId(int MaSanPham, int MaMay) { ThongSoKyThuat_BUS bus = new ThongSoKyThuat_BUS(); if (bus.GetMa(MaSanPham, MaMay) == null) { return(NotFound()); } return(Ok(bus.GetMa(MaSanPham, MaMay))); }
public IHttpActionResult Delete(int MaSanPham, int MaMay) { ThongSoKyThuat_BUS bus = new ThongSoKyThuat_BUS(); if (bus.Xoa(MaSanPham, MaMay) == null) { return(NotFound()); } else { return(Ok(bus.Xoa(MaSanPham, MaMay))); } }
// GET: api/ThongSoKyThuats public PhanTrang <ThongSoKyThuat_OBJ> GetALL(int trang, int SoBanGhi) { ThongSoKyThuat_BUS bus = new ThongSoKyThuat_BUS(); int DoDaiDanhSach = 0; var DanhSach = bus.HienThiThongSoKyThuat(); DoDaiDanhSach = DanhSach.Count(); var TrangSanPham = DanhSach.OrderByDescending(x => x.MaSanPham).Skip(trang * SoBanGhi).Take(SoBanGhi); var PhanTrang = new PhanTrang <ThongSoKyThuat_OBJ>() { DanhSach = TrangSanPham, Trang = trang, SoBanGhi = SoBanGhi, SoTrang = (int)Math.Ceiling((decimal)DoDaiDanhSach / SoBanGhi) }; return(PhanTrang); }
// GET: api/ThongSoKyThuats public IEnumerable <ThongSoKyThuat_OBJ> GetALL() { ThongSoKyThuat_BUS bus = new ThongSoKyThuat_BUS(); return(bus.HienThiThongSoKyThuat()); }