public void Update(SurveyGeographyDTO surveyGeographyDTO) { SurveyGeography surveyGeography = Mapper.Map <SurveyGeography>(surveyGeographyDTO); _unitOfWork.SurveyGeographies.Update(surveyGeography); _unitOfWork.Save(); }
public ActionResult Create([Bind(Include = "Name")] SurveyGeographyVM surveyGeographyVM) { if (ModelState.IsValid) { SurveyGeographyDTO surveyGeographyDTO = Mapper.Map <SurveyGeographyDTO>(surveyGeographyVM); SurveyGeographyService.Add(surveyGeographyDTO); return(RedirectToAction("Index")); } return(View()); }
public ActionResult Edit(int?id) { try { SurveyGeographyDTO surveyGeographyDTO = SurveyGeographyService.Get(id); SurveyGeographyVM surveyGeographyVM = Mapper.Map <SurveyGeographyVM>(surveyGeographyDTO); return(View(surveyGeographyVM)); } catch (ArgumentNullException) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } catch (NotFoundException) { return(HttpNotFound()); } }