public ActionResult _partialEditState(int?id)
        {
            ListStateViewModel model = new ListStateViewModel();

            if (id.HasValue)
            {
                model.stateObj = _serviceFacade.GetStateById(id.Value);
            }

            return(View(model));
        }
 public ActionResult _partialEditState(ListStateViewModel stateViewModelObj)
 {
     try
     {
         _serviceFacade.saveState(stateViewModelObj.stateObj);
         TempData["Success"] = true;
     }
     catch (Exception ex)
     {
         TempData["Success"] = false;
     }
     return(RedirectToAction("State"));
 }
        public ActionResult State(bool?exportCsv)
        {
            var model = new ListStateViewModel();
            var State = _serviceFacade.GetStates().OrderByDescending(s => s.Id);

            foreach (var item in State)
            {
                model.ListState.Add(item);
            }

            if (exportCsv.HasValue)
            {
                model.ListState.ExportCSV("StatesList_" + DateTime.Now.ToString());
            }

            return(View(model));
        }