Exemplo n.º 1
0
        public void SaveComments(MapComponentSummaryVM summary)
        {
            if (summary == null)
            {
                throw new PhenotypeException("Invalid viewModel");
            }
            if (summary.Id < 0)
            {
                throw new PhenotypeException("Invalid viewModel");
            }

            MapComponentYears mapcompyears = u_repo.GetMapComponentYear(summary.Id);

            mapcompyears.Comments = summary.Comments;
            try
            {
                u_repo.DoSaveMapComponentYear(mapcompyears);
            }
            catch (ArgumentNullException)
            {
                throw new PhenotypeException("Invalid mapcompyears to save");
            }
        }
Exemplo n.º 2
0
        public ActionResult SaveComments(MapComponentSummaryViewModel viewModel)
        {
            ActionResult      view         = null;
            MapComponentYears mapcompyears = m_repo.GetMapComponentYear(viewModel.Id);

            mapcompyears.Comments = viewModel.Comments;

            try
            {
                m_repo.SaveMapComponentYearComment(mapcompyears);
            }
            catch (Exception e)
            {
                view = Json(new { Error = true, Message = e.Message });
            }

            ViewBag.FlatTypes = new SelectList(m_repo.GetFlatTypes(), "Id", "Name");

            return(view);
        }