public ActionResult SaveMeasure(MeasureViewModel model) { Measure measure = new Measure(); measure = Mapper.Map <MeasureViewModel, Measure>(model); var measureRepo = new MeasureRepository(); var item = measureRepo.SaveMeasure(measure); if (item.Success) { return(Json(item.Value)); } else { return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, "An error has occured !!!")); } }
public static int SaveMeasure(Measure item) { return(MeasureRepository.SaveMeasure(item)); }