public ActionResult Create()
 {
     var editViewModel = new EditViewModel
                             {
                                 CreditStatusId = 0,
                                 CreditStatusDescription = string.Empty
                             };
     return View("Edit", editViewModel);
 }
        private static CreditStatus Map(EditViewModel editViewModel)
        {
            var creditStatus = new CreditStatus
                                   {
                                       CreditStatusId = editViewModel.CreditStatusId,
                                       CreditStatusDescription = editViewModel.CreditStatusDescription
                                   };

            return creditStatus;
        }
        public ActionResult Save(EditViewModel editFormModel)
        {
            if (ModelState.IsValid)
            {
                _creditStatusManagement.Save(editFormModel);
                return RedirectToAction("Index");
            }

            return View("Edit", editFormModel);
        }
 public ActionResult Edit(int id)
 {
     var creditStatusInformation = _creditStatusManagement.GetCreditStatus(id);
     var editViewModel = new EditViewModel
                             {
                                 CreditStatusId = creditStatusInformation.CreditStatusId,
                                 CreditStatusDescription = creditStatusInformation.CreditStatusDescription
                             };
     return View(editViewModel);
 }
        public void Save(EditViewModel editViewModel)
        {
            var creditStatus = Map(editViewModel);

            if (editViewModel.CreditStatusId.Equals(0))
            {
                AddCreditStatus(creditStatus);
            }
            else
            {
                EditCreditStatus(creditStatus);
            }
        }