public string AddSellingPoint([Bind(Include = "Address,ShawarmaTitle")] SellingPoint sellingPoint) { return(DatabaseQueries.AddSellingPoint(sellingPoint.ShawarmaTitle, sellingPoint.Address, Request.Form["SellingPointCategory"]) ? "Success" : "Error"); }
public void Create(DalSellingPoint e) { var SellingPoint = new SellingPoint() { SellingPointID = e.Id, Address = e.Address, ShawarmaTitile = e.ShawarmaTitile, SellingPointCategoryID = e.SellingPointCategoryID }; Context.Set <SellingPoint>().Add(SellingPoint); }
public async Task <ActionResult> Create([Bind(Include = "SellingPointId,Address,SellingPointCategory,ShawarmaTitle")] SellingPoint sellingPoint) { if (ModelState.IsValid) { db.SellingPoints.Add(sellingPoint); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.SellingPointCategory = new SelectList(db.SellingPointCategories, "SellingPointCategoryId", "SellingPointCategoryName", sellingPoint.SellingPointCategory); return(View(sellingPoint)); }
// GET: SellingPoints/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SellingPoint sellingPoint = await db.SellingPoints.FindAsync(id); if (sellingPoint == null) { return(HttpNotFound()); } return(View(sellingPoint)); }
public void Update(DalSellingPoint e) { var SellingPoint = new SellingPoint() { SellingPointID = e.Id, Address = e.Address, ShawarmaTitile = e.ShawarmaTitile, SellingPointCategoryID = e.SellingPointCategoryID }; SellingPoint = Context.Set <SellingPoint>().Single(i => i.SellingPointID == e.Id); SellingPoint.Address = e.Address; SellingPoint.ShawarmaTitile = e.ShawarmaTitile; SellingPoint.SellingPointCategoryID = e.SellingPointCategoryID; }