public ActionResult DeleteConfirmed( Int32?InvoiceID ) { Invoice Invoice = new Invoice(); Invoice.InvoiceID = System.Convert.ToInt32(InvoiceID); Invoice = InvoiceData.Select_Record(Invoice); bool bSucess = false; bSucess = InvoiceData.Delete(Invoice); if (bSucess == true) { return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Can Not Delete"); } return(null); }