public async Task <ActionResult> DeleteConfirmed(int id) { QuoteHdr quoteHdr = await db.QuoteHdrs.FindAsync(id); db.QuoteHdrs.Remove(quoteHdr); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
// GET: QuoteHdrs/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } QuoteHdr quoteHdr = await db.QuoteHdrs.FindAsync(id); if (quoteHdr == null) { return(HttpNotFound()); } return(View(quoteHdr)); }
public async Task <ActionResult> Edit([Bind(Include = "QuoteID,QuoteRef,UserID,CompanyID,CustomerID,TrailerID,ItemNo,ItemDescriptionShort,ItemDescriptionLong,ItemSalesDescription,DrawingNo,Hours,TareWeight,Length,Width,Height,SellPrice,CostMaterial,CreatedDateTime,AllowReprint,DeliveryTermId,QuoteFile,SpecialRequirement,Discount,Quantity,SpecReqSellPrice,SpecReqSellCost,CostedBy,Timestamp,RegistrationId,TransportationId,WarrantyPeriod,Comment,CubicCapacity,QuoteRefId,DiscountAmount,DiscountType,ShowRequirementOnQuote,SpecialRequirementB,SpecReqSellPriceB,SpecReqSellCostB")] QuoteHdr quoteHdr) { if (ModelState.IsValid) { db.Entry(quoteHdr).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.CompanyID = new SelectList(db.Companies, "CompanyID", "CompanyName", quoteHdr.CompanyID); ViewBag.CustomerID = new SelectList(db.Customers, "CustomerID", "ContactFirstName", quoteHdr.CustomerID); ViewBag.DeliveryTermId = new SelectList(db.DeliveryTerms, "Id", "DeliveryTerm1", quoteHdr.DeliveryTermId); ViewBag.TrailerID = new SelectList(db.Trailers, "TrailerID", "ItemNo", quoteHdr.TrailerID); ViewBag.RegistrationId = new SelectList(db.Registrations, "RegistrationID", "RegistrationDescription", quoteHdr.RegistrationId); ViewBag.TransportationId = new SelectList(db.Transportations, "TransportationID", "TransportationDescription", quoteHdr.TransportationId); return(View(quoteHdr)); }
// GET: QuoteHdrs/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } QuoteHdr quoteHdr = await db.QuoteHdrs.FindAsync(id); if (quoteHdr == null) { return(HttpNotFound()); } ViewBag.CompanyID = new SelectList(db.Companies, "CompanyID", "CompanyName", quoteHdr.CompanyID); ViewBag.CustomerID = new SelectList(db.Customers, "CustomerID", "ContactFirstName", quoteHdr.CustomerID); ViewBag.DeliveryTermId = new SelectList(db.DeliveryTerms, "Id", "DeliveryTerm1", quoteHdr.DeliveryTermId); ViewBag.TrailerID = new SelectList(db.Trailers, "TrailerID", "ItemNo", quoteHdr.TrailerID); ViewBag.RegistrationId = new SelectList(db.Registrations, "RegistrationID", "RegistrationDescription", quoteHdr.RegistrationId); ViewBag.TransportationId = new SelectList(db.Transportations, "TransportationID", "TransportationDescription", quoteHdr.TransportationId); return(View(quoteHdr)); }