public ActionResult NewProduct() { LoaiSPDAO sp = new LoaiSPDAO(); var model = sp.GetNewProduct(); return(PartialView(model)); }
public ActionResult Detail(int LoaiSpID, int SanPhamID) { LoaiSPDAO sp = new LoaiSPDAO(); var model = sp.Detail(LoaiSpID, SanPhamID); var recent = sp.RecentProduct(LoaiSpID); List <int?> listKLSP = (from p in db.SANPHAM where p.LOAISP_ID == LoaiSpID select p.KHOILUONG ).ToList(); ViewBag.listKLSP = listKLSP; ViewBag.LoaiSpId = LoaiSpID; var product = Session[ProductSession]; if (product != null) { var list = (List <HOMELOAISP>)product; if (list.Exists(x => x.ID == LoaiSpID) == false) { list.Add(recent); } Session[ProductSession] = list; } else { var list = new List <HOMELOAISP>(); list.Add(recent); Session[ProductSession] = list; } return(View(model)); }
private void setViewBagLoaiSP(int?id = null) { List <LoaiSP> listLoai = LoaiSPDAO.getListLoaiSP(); SelectList slLoai = new SelectList(listLoai, "MaLoaiSP", "TenLoaiSP", id); ViewBag.slLoai = slLoai; }
public JsonResult DetailKL(int LoaiSpID, int KhoiLuong) { LoaiSPDAO sp = new LoaiSPDAO(); int SanPhamID = db.SANPHAM.Find(x => x.KHOILUONG == KhoiLuong).ID; ViewBag.SanPhamID = SanPhamID; var model = sp.Detail(LoaiSpID, SanPhamID); return(Json(model)); }
public string LayMaLoaiSPTiepTheo() { // string strKQ; LoaiSPDAO suaDao = new LoaiSPDAO(); string MaxMaLoaiSP = suaDao.MaLoaiSPLonNhat(); if (string.IsNullOrEmpty(MaxMaLoaiSP)) { return("LSP001"); } else { int ChuyenSo = int.Parse(MaxMaLoaiSP.Replace("LSP", "")); return("LSP" + (ChuyenSo + 1).ToString("000")); } }
static LoaiSPBUS() { db = new LoaiSPDAO(); }
public static void XoaLoaiSP(LoaiSPDTO lspDTO) { LoaiSPDAO.XoaLoaiSP(lspDTO); }
public static void SuaThongTin(LoaiSPDTO lspDTO) { LoaiSPDAO.SuaThongTin(lspDTO); }
public static bool ThemLoaiSanPham(LoaiSPDTO lspDTO) { return(LoaiSPDAO.ThemLoaiSanPham(lspDTO)); }
public static bool suaLoaiSP(LoaiSPDTO lsp) { return(LoaiSPDAO.suaLoaiSP(lsp)); }
public static bool themLoaiSP(LoaiSPDTO lsp) { return(LoaiSPDAO.themLoaiSP(lsp)); }
public static List <LoaiSPDTO> layDanhSachLoaiSP(int TThai) { return(LoaiSPDAO.layDanhSachLoaiSP(TThai)); }
public LoaiSPDTO LayLoaiSanPham(string maLoai) { LoaiSPDAO dao = new LoaiSPDAO(); return(dao.LayLoaiSanPham(maLoai)); }
public bool XoaLoaiSP(LoaiSPDTO DTO) { LoaiSPDAO dao = new LoaiSPDAO(); return(dao.XoaLoaiSP(DTO)); }
public bool ThemLoaiSP(LoaiSPDTO dto) { LoaiSPDAO dao = new LoaiSPDAO(); return(dao.ThemLOAISP(dto)); }
public static DataTable LayThongTinLoaiSanPham() { return(LoaiSPDAO.LayThongTinLoaiSanPham()); }
public List <LoaiSPDTO> layDSLoaiSP() { LoaiSPDAO DAO = new LoaiSPDAO(); return(DAO.layDSLoaiSP()); }