public JsonResult CreateProduct(Product pr) { FashionShopDbContext db = new FashionShopDbContext(); Product temp = db.Product.Find(pr.maSanPham); if (temp == null) { Product pro = new Product(); pro.maSanPham = pr.maSanPham; pro.moTa = pr.moTa; pro.giaSanPham = pr.giaSanPham; pro.chatLieu = pr.chatLieu; pro.loaiSanPhamMa = pr.loaiSanPhamMa; pro.soLuongDatMua = 0; pro.mauSac = pr.mauSac; pro.urlAnh = pr.urlAnh; pro.tenSanPham = pr.tenSanPham; db.Product.Add(pro); db.SaveChanges(); return(Json(new { status = true })); } return(Json(new { status = false })); }
public JsonResult loadChiTiet(string id) { FashionShopDbContext db = new FashionShopDbContext(); GroupDetail gr = db.GroupDetail.Find(id); return(Json(new { data = gr.nhomMa })); }
public JsonResult DeleteProduct(string maSanPham) { FashionShopDbContext db = new FashionShopDbContext(); Product pr = db.Product.Find(maSanPham); if (pr != null) { db.Product.Remove(pr); db.SaveChanges(); } return(Json(new { status = true })); }
public JsonResult DeleteGroupDetail(string id) { FashionShopDbContext db = new FashionShopDbContext(); GroupDetail grDetail = db.GroupDetail.Find(id); if (grDetail != null) { db.GroupDetail.Remove(grDetail); db.SaveChanges(); } return(Json(new { status = true })); }
public ActionResult Register(User us) { FashionShopDbContext db = new FashionShopDbContext(); if (ModelState.IsValid) { //Thêm dữ liệu vào bảng User db.User.Add(us); //Lưu vào CSDL db.SaveChanges(); ViewBag.ThongBao = "Đăng kí thành công"; } return(View()); }
public JsonResult UpdateGroupPr(string maNhom, string tenNhom, string tittle) { FashionShopDbContext db = new FashionShopDbContext(); GroupPr gr = db.GroupPr.Find(maNhom); if (gr != null) { gr.tenNhom = tenNhom; gr.meta_tittle = tittle; db.SaveChanges(); } return(Json(new { status = true })); }
public JsonResult UpdateGroupDetail(string maLoai, string tenLoai, string tittle, string maNhom) { FashionShopDbContext db = new FashionShopDbContext(); GroupDetail grDetail = db.GroupDetail.Find(maLoai); if (grDetail != null) { grDetail.tenLoaiSanPham = tenLoai; grDetail.meta_tittle = tittle; grDetail.nhomMa = maNhom; db.SaveChanges(); } return(Json(new { status = true })); }
public JsonResult UpdateProduct(Product product) { FashionShopDbContext db = new FashionShopDbContext(); Product pr = db.Product.Find(product.maSanPham); if (pr != null) { pr.tenSanPham = product.tenSanPham; pr.soLuongDatMua = product.soLuongDatMua; pr.moTa = product.moTa; pr.mauSac = product.mauSac; pr.loaiSanPhamMa = product.loaiSanPhamMa; pr.giaSanPham = product.giaSanPham; pr.chatLieu = product.chatLieu; db.SaveChanges(); } return(Json(new { status = true })); }
public JsonResult CreateGroupDetail(string maLoai, string tenLoai, string tittle, string manhom) { FashionShopDbContext db = new FashionShopDbContext(); GroupDetail temp = db.GroupDetail.Find(maLoai); if (temp == null) { var list = db.GroupDetail.Where(x => x.meta_tittle == tittle).ToList(); if (list.Count() == 0) { GroupDetail grDetail = new GroupDetail(); grDetail.maLoaiSanPham = maLoai; grDetail.tenLoaiSanPham = tenLoai; grDetail.meta_tittle = tittle; grDetail.nhomMa = manhom; db.GroupDetail.Add(grDetail); db.SaveChanges(); return(Json(new { status = 1 })); } else { return(Json(new { status = 3 })); } } else { return(Json(new { status = 2 })); } }
public JsonResult DeleteGroupPr(string id) { FashionShopDbContext db = new FashionShopDbContext(); GroupPr gr = db.GroupPr.Find(id); int st = 1; if (gr != null) { try { db.GroupPr.Remove(gr); db.SaveChanges(); } catch { st = 2; } } return(Json(new { status = st })); }
public JsonResult CreateGroupPr(string maNhom, string tenNhom, string tittle) { FashionShopDbContext db = new FashionShopDbContext(); GroupPr temp = db.GroupPr.Find(maNhom); if (temp == null) { var list = db.GroupPr.Where(x => x.meta_tittle == tittle).ToList(); if (list.Count() == 0) { GroupPr gr = new GroupPr(); gr.maNhom = maNhom; gr.tenNhom = tenNhom; gr.meta_tittle = tittle; db.GroupPr.Add(gr); db.SaveChanges(); return(Json(new { status = 1 })); } else { return(Json(new { status = 3 })); } } else { return(Json(new { status = 2 })); } }
public adminGroupDao() { db = new FashionShopDbContext(); }
public AdminDAO() { db = new FashionShopDbContext(); }
public GroupDetailDao() { db = new FashionShopDbContext(); }
public OrderDetailDao() { db = new FashionShopDbContext(); }
public UserDAO() { db = new FashionShopDbContext(); }
public ProductDAO() { db = new FashionShopDbContext(); }
public SlideDAO() { db = new FashionShopDbContext(); }
public adminProductDao() { db = new FashionShopDbContext(); }
public HomeController(FashionShopDbContext context, IHttpContextAccessor httpContextAccessor) { _context = context; _httpContextAccessor = httpContextAccessor; }
public FeedBackDao() { db = new FashionShopDbContext(); }
public ProductsDao() { db = new FashionShopDbContext(); }
public MenuDao() { db = new FashionShopDbContext(); }
public AdminController(FashionShopDbContext context) { _context = context; }
public AccountModel() { context = new FashionShopDbContext(); }
public ProductCategoryDao() { db = new FashionShopDbContext(); }
public ReceiptDao() { db = new FashionShopDbContext(); }