public ActionResult DeletePostConfirmed(int id) { InvoicePosts post = db.InvoicePosts.Find(id); db.InvoicePosts.Remove(post); db.SaveChanges(); return(RedirectToAction("Details", new { id = post.InvoiceID })); }
// GET: InvoicePosts/Delete/5 public ActionResult DeletePost(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } InvoicePosts post = db.InvoicePosts.Find(id); if (post == null) { return(HttpNotFound()); } return(View(post)); }
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 }); }
public ActionResult _AddPost(InvoicePosts contractPost, string selectedContractPost) { ViewBag.ContractPosts = GetContractPosts(); if (ModelState.IsValid) { //var curUser = GetCurrentUser(); //hour.user = curUser; contractPost.ContractPostID = System.Convert.ToInt32(selectedContractPost); contractPost.InvoiceID = currentInvoiceModel.ID; db.InvoicePosts.Add(contractPost); db.SaveChanges(); return(View()); } return(View()); }