public ActionResult _partialStateFactor(int?id) { ListStateFactorViewModel model = new ListStateFactorViewModel(); model.lstStates = _masterFacade.GetStates(); if (id.HasValue) { model.stateFactorObj = _serviceFacade.getStateFactorById(id.Value); } return(View(model)); }
public ActionResult _partialStateFactor(ListStateFactorViewModel objStateFactorViewModel) { try { _serviceFacade.saveStateFactor(objStateFactorViewModel.stateFactorObj); TempData["Success"] = true; } catch (Exception ex) { TempData["Success"] = false; } return(RedirectToAction("StateFactor")); }
public ActionResult StateFactor(bool?exportCsv) { var model = new ListStateFactorViewModel(); var StateFactor = _serviceFacade.GetStateFactor(); foreach (var item in StateFactor) { model.ListStateFactor.Add(item); } if (exportCsv.HasValue) { model.ListStateFactor.ExportCSV("StateFactor_" + DateTime.Now.ToString()); } return(View(model)); }