public IActionResult Edit(FeeTermModel feeTermModel) { if (string.IsNullOrEmpty(HttpContext.Session.GetString("Session1"))) { return(RedirectToAction("UserLogin", "Login")); } try { var response = JsonConvert.DeserializeObject <List <AdTypeFee> >(feeTermModel.AdTypeFees); feetype.Update(feeTermModel.FeeTypes); foreach (var item in response) { item.FTId = feeTermModel.FeeTypes.FTId; admissionType.Update(item); } } catch (Exception E) { } var routeValues = new RouteValueDictionary { { "ID", feeTermModel.FeeTypes.FTId } }; return(RedirectToAction("Index", "FeeTerm", routeValues)); }
public IActionResult Edit(int?id) { if (string.IsNullOrEmpty(HttpContext.Session.GetString("Session1"))) { return(RedirectToAction("UserLogin", "Login")); } if (id == null) { return(NotFound()); } var fee_Type = feetype.GetById(id.Value); FeeTermModel fmodel = new FeeTermModel(); if (id == null) { return(NotFound()); } fmodel.FeeTypes = fee_Type; ICollection <AdTypeFee> res = admissionType.GetRecordById(id); if (res == null) { return(NotFound()); } else { fmodel.adtypes = (List <AdTypeFee>)res; } return(View(fmodel)); }