ArgumentNullExceptioncan not be handeled by user. Value cannot be null. Parameter name: entity
[NonAction] private FinancilInstituteWrappergetData(int id) { FinancilInstituteWrapper temp = newFinancilInstituteWrapper(); var details = from i indb.IIDBS join a indb.ACDBS oni.Idequalsa.Id join b indb.BIDBSoni.Idequalsb.Id wherei.Id==id selectnewFinancilInstituteWrapper { II = i, AC = a, BI = b }; foreach (FinancilInstituteWrapper a in details) { temp.II = a.II; temp.BI = a.BI; temp.AC = a.AC; } return temp; }
// // GET: /FinancilInstitute/Delete/5 publicActionResult Delete(int id=0) { return View(getData(id)); } // // POST: /FinancilInstitute/Delete/5 [HttpPost,ActionName("Delete")] publicActionResultDeleteConfirmed(int id = 0) { FinancilInstituteWrapper wrapper = newFinancilInstituteWrapper(); db.IIDBS.Remove(wrapper.II); db.ACDBS.Remove(wrapper.AC); db.BIDBS.Remove(wrapper.BI); db.SaveChanges(); returnRedirectToAction("Index"); }
<%@PageTitle=""Language="C#"MasterPageFile="~/Views/Shared/Site.Master"Inherits="System.Web.Mvc.ViewPage<BachatGatProjectFinal.Controllers.FinancilInstituteWrapper>"%> <h2>Delete</h2> <h3>Are you sure you want to delete this?</h3> <fieldset> <legend>FinancilInstituteWrapper</legend> <div> <%:Html.HiddenFor(m=>m.II.Id) %> </div> <div> Institute Name <%:Html.DisplayFor(m=>m.II.InstituteName) %> </div> <div> Owners First Name <%:Html.DisplayFor(m=>m.II.OwnersFirstName) %> </div> <div> Owners Last Name <%:Html.DisplayFor(m=>m.II.OwnersLastName) %> </div> <div> <%:Html.HiddenFor(m=>m.AC.Id) %> </div> <div> Address <%:Html.DisplayFor(m=>m.AC.Address) %> </div> <div> City <%:Html.DisplayFor(m=>m.AC.City) %> </div> <div> State <%:Html.DisplayFor(m=>m.AC.State) %> </div> <div> PinCode <%:Html.DisplayFor(m=>m.AC.PinCode) %> </div> <div> Phone <%:Html.DisplayFor(m=>m.AC.Phone) %> </div> <div> Email <%:Html.DisplayFor(m=>m.AC.Email) %> </div> <div> <%:Html.HiddenFor(m=>m.BI.Id) %> </div> <div> BankName <%:Html.DisplayFor(m=>m.BI.BankName) %> </div> <div> Branch <%:Html.DisplayFor(m=>m.BI.Branch) %> </div> <div> Account Number <%:Html.DisplayFor(m=>m.BI.AccountNumber) %> </div> <div> MICR <%:Html.DisplayFor(m=>m.BI.MICR) %> </div> <div> IFSC <%:Html.DisplayFor(m=>m.BI.IFSC) %> </div> </fieldset> <%using (Html.BeginForm()) { %> <p> <inputtype="submit"value="Delete"/> | <%:Html.ActionLink("Back to List", "Index") %> </p> <% } %>
join b indb.BIDBSoni.Idequalsb.Id where i.Id==id
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)