public ActionResult _partialAreaFactor(int?id) { ListAreaFactorViewModel model = new ListAreaFactorViewModel(); if (id.HasValue) { model.areaFactorObj = _serviceFacade.getAreaFactorById(id.Value); } return(View(model)); }
public ActionResult _partialAreaFactor(ListAreaFactorViewModel areaFactorViewModel) { try { _serviceFacade.saveAreaFactor(areaFactorViewModel.areaFactorObj); TempData["Success"] = true; } catch (Exception ex) { TempData["Success"] = false; } return(RedirectToAction("AreaFactor")); }
public ActionResult AreaFactor(bool?exportCsv) { var model = new ListAreaFactorViewModel(); var AreaFactor = _serviceFacade.GetAreaFactor(); foreach (var item in AreaFactor) { model.ListAreaFactor.Add(item); } if (exportCsv.HasValue) { model.ListAreaFactor.ExportCSV("AreaFactor_" + DateTime.Now.ToString()); } return(View(model)); }