public ActionResult DeleteConfirmed(int id) { SumaryPime sumaryPime = db.SumaryPime.Find(id); db.SumaryPime.Remove(sumaryPime); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,Email,Phone,Address")] SumaryPime sumaryPime) { if (ModelState.IsValid) { db.Entry(sumaryPime).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sumaryPime)); }
public ActionResult Create([Bind(Include = "Id,Name,Email,Phone,Address")] SumaryPime sumaryPime) { if (ModelState.IsValid) { db.SumaryPime.Add(sumaryPime); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sumaryPime)); }
// GET: SumaryPimes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SumaryPime sumaryPime = db.SumaryPime.Find(id); if (sumaryPime == null) { return(HttpNotFound()); } return(View(sumaryPime)); }
// GET: Products/Details/5 public ActionResult SumaryDetails(int?id) { if (id == null) { return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest)); } SumaryPime sumaryPime = db.SumaryPime.Find(id); if (sumaryPime == null) { return(HttpNotFound()); } return(View(sumaryPime)); }
public ActionResult Sumary([Bind(Include = "Name,Email,Phone,Address,NameProduct,UnitPrice,IdBillingType,Reference")] FullSumary fullSumary) { if (ModelState.IsValid) { SumaryPime sumaryPime = new SumaryPime { Name = fullSumary.Name, Email = fullSumary.Email, Phone = fullSumary.Phone, Address = fullSumary.Address }; db.SumaryPime.Add(sumaryPime); db.SaveChanges(); Product product = new Product { NameProduct = fullSumary.NameProduct, UnitPrice = fullSumary.UnitPrice, IdSumaryPime = sumaryPime.Id }; db.Product.Add(product); db.SaveChanges(); BillingTypeUser billingTypeUser = new BillingTypeUser { IdSumaryPime = sumaryPime.Id, IdBillingType = fullSumary.IdBillingType, Reference = fullSumary.Reference }; db.BillingTypeUser.Add(billingTypeUser); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IdBillingType = new SelectList(db.BillingType, "Id", "TYPE"); return(View()); }