예제 #1
0
 public ActionResult InsertDetail(DetailViewModel detail)
 {
     try
     {
         if (detail != null)
         {
             if (ModelState.IsValid)
             {
                 Mapper.Initialize(cfg => cfg.CreateMap <DetailViewModel, DetailDTO>());
                 var detailDTO = Mapper.Map <DetailViewModel, DetailDTO>(detail);
                 detailService.InsertDetail(detailDTO);
                 return(PartialView("SuccessDetail"));
             }
         }
     }
     catch (ValidationException ex)
     {
         ModelState.AddModelError(ex.Property, ex.Message);
     }
     GetSelectListStockmen();
     return(PartialView(detail));
 }