public int DeleteSubCategory(int id) { tblProductManagement cat = _db.tblProductManagements.Where(u => u.id == id).FirstOrDefault(); _db.tblProductManagements.Remove(cat); return(_db.SaveChanges()); }
public int UpdateSubCategory(ProductManagement model) { tblProductManagement cat = _db.tblProductManagements.Where(u => u.id == model.id).FirstOrDefault(); cat.id = model.id; cat.categoryid = model.categoeyid; cat.subcategoryid = model.subcategoryid; cat.name = model.name; cat.description = model.description; cat.features = model.features; cat.price = model.price; cat.quality = model.quality; cat.code = model.code; return(_db.SaveChanges()); }
public int CreateProductManagement(ProductManagement model) { tblProductManagement cat = new tblProductManagement(); cat.id = model.id; cat.categoryid = model.categoeyid; cat.subcategoryid = model.subcategoryid; cat.name = model.name; cat.description = model.description; cat.features = model.features; cat.price = model.price; cat.quality = model.quality; cat.code = model.code; _db.tblProductManagements.Add(cat); return(_db.SaveChanges()); }