public ActionResult DeleteConfirmed(int id) { InvoiceModelNEAS invoiceModelNEAS = db.InvoiceNEAS.Find(id); db.InvoiceNEAS.Remove(invoiceModelNEAS); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,DateCreated,InvoiceNumber,Controlled,ControlDate,Approved,ApproveDate")] InvoiceModelNEAS invoiceModelNEAS) { if (ModelState.IsValid) { db.Entry(invoiceModelNEAS).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(invoiceModelNEAS)); }
// GET: InvoiceNEAS/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } InvoiceModelNEAS invoiceModelNEAS = db.InvoiceNEAS.Find(id); if (invoiceModelNEAS == null) { return(HttpNotFound()); } return(View(invoiceModelNEAS)); }
public ActionResult _AddPost(int postID) { ViewBag.ContractPosts = GetContractPosts(); var newPost = new InvoicePosts(); InvoiceModelNEAS invoiceModel = db.InvoiceNEAS.Find(postID); //Change names here newPost.InvoiceID = invoiceModel.ID; // this will be sent from the ArticleDetails View, hold on :). return(View()); //return RedirectToAction("Details", new { id = newPost.InvoiceID }); }
//[ValidateAntiForgeryToken] //[Bind(Include = "ID,DateCreated,InvoiceNumber,Controlled,ControlDate,Approved,ApproveDate,BelongsToProject")] public ActionResult Create(InvoiceModelNEAS invoiceModelNEAS, string selectedProject) { ViewBag.Projects = GetProjects(); if (ModelState.IsValid) { invoiceModelNEAS.ProjectID = System.Convert.ToInt32(selectedProject); db.InvoiceNEAS.Add(invoiceModelNEAS); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(invoiceModelNEAS)); }