public ActionResult ListMaritalStatus(bool? showInactive,int? page)
        {
            try
            {
                bool showinactive = false;
                if (showInactive != null)
                    showinactive = (bool)showInactive;

                ViewBag.showInactive = showinactive;

                if (TempData["msg"] != null)
                {
                    ViewBag.msg = TempData["msg"].ToString();
                    TempData["msg"] = null;
                }
                var ls = _maritalStatusViewModelBuilder.GetAll(showinactive);
                int currentPageIndex = page.HasValue ? page.Value - 1 : 0;
                return View(ls.ToPagedList(currentPageIndex, defaultPageSize));
            }
            catch (Exception ex)
            {
                var exception = new MaritalStatusViewModel();
                exception.ErrorText = ex.Message;
                return View(exception);
            }
        }
 public void Save(MaritalStatusViewModel mStatusVM)
 {
     MaritalStatus mStatus = new MaritalStatus(mStatusVM.Id)
     {
         MStatus=mStatusVM.Status,
         Description=mStatusVM.Description,
         Code=mStatusVM.Code,
     };
    // _maritalStatusRepository.Save(mStatus);
 }
 public ActionResult CreateMaritalStatus(MaritalStatusViewModel mStatusVM)
 {
     try
     {
         mStatusVM.Id = Guid.NewGuid();
         _maritalStatusViewModelBuilder.Save(mStatusVM);
         TempData["msg"] = "MaritalStatus Successfully Created";
         _auditLogViewModelBuilder.AddAuditLog(this.User.Identity.Name, "Create", "MaritalStatus", DateTime.Now);
        return RedirectToAction("ListMaritalStatus");
     }
     catch (DomainValidationException dve)
     {
         ValidationSummary.DomainValidationErrors(dve,ModelState);
         return View();
     }
     catch (Exception ex)
     {
         ViewBag.msg = "";
         ViewBag.msg = ex.Message;
         return View();
     }
 }