public void Save(OutletVisitReasonsTypeViewModel outletVisitReasonsType)
 {
     
     OutletVisitReasonsType outletVrt = new OutletVisitReasonsType(outletVisitReasonsType.id)
                                            {Name = outletVisitReasonsType.Name ,
                                                Description = outletVisitReasonsType.Description ,
                                                OutletVisitAction = outletVisitReasonsType.outletVisitAction 
                                             };
     if (outletVisitReasonsType.outletVisitAction == null)
     {
         outletVisitReasonsType.outletVisitAction = OutletVisitAction.NoAction;
     }
     _outletVisitReasonsTypeRepository.Save(outletVrt);
 }
        public ActionResult CreateOutletVisitReasonsTypes(OutletVisitReasonsTypeViewModel ovrtvm)
        { 

             try
             {
                 
                 ovrtvm.id = Guid.NewGuid();
                 _outletVisitReasonsTypeViewModelBuilder.Save(ovrtvm);
                 TempData["msg"] = "OutletVisitReasonsType Successfully Created";
                 return RedirectToAction("ListOutletVisitReasonsTypes");
             }
             catch (DomainValidationException dve)
             {

                 ValidationSummary.DomainValidationErrors(dve, ModelState);
                 _log.Debug("Failed to create OutletVisitReasonsType" + dve.Message);
                 _log.Error("Failed to create OutletVisitReasonsType" + dve.ToString());
                 return View(ovrtvm);
             }
             catch(Exception ex)
             {
                 ViewBag.msg = ex.Message;
                 _log.Debug("Failed to create OutletVisitReasonsType" + ex.Message);
                 _log.Error("Failed to create OutletVisitReasonsType" + ex.ToString());
                 return View();

             }
            
        }
         public ActionResult EditOutletVisitReasonsTypess(OutletVisitReasonsTypeViewModel pvm)
         {
             ViewBag.OutletVisitReasonsTypeAction = _outletVisitReasonsTypeViewModelBuilder.OutletVisitReasonsTypeAction();
             try
             {
                 _outletVisitReasonsTypeViewModelBuilder.Save(pvm);
                 _auditLogViewModelBuilder.AddAuditLog(this.User.Identity.Name, "Edit", "OutletVisitReasonsType", DateTime.Now);
                 TempData["msg"] = "OutletVisitReasonsType Successfully Edited";
                 return RedirectToAction("ListOutletVisitReasonsTypes");
             }

             catch (DomainValidationException dve)
             {

                 ValidationSummary.DomainValidationErrors(dve, ModelState);
                 //ViewBag.msg = msg;
                 return View();
             }
             catch (Exception ex)
             {
                 ViewBag.msg = ex.Message;

                 return View();
             }
         }