Esempio n. 1
0
        public ActionResult NeedAssessmentUpdate([DataSourceRequest] DataSourceRequest request,
                                                 [Bind(Prefix = "models")] List <NeedAssessmentDetail> needAssessmentlDetails)
        {
            List <NeedAssessmentDetail> result = new List <NeedAssessmentDetail>();

            if (needAssessmentlDetails != null && ModelState.IsValid)
            {
                foreach (NeedAssessmentDetail details in needAssessmentlDetails)
                {
                    // details.
                    _needAssessmentDetailService.EditNeedAssessmentDetail(details);
                    //details.
                    NeedAssessmentDetail record = _needAssessmentDetailService.FindById(details.NAId);
                    if (record != null)
                    {
                        result.Add(record);
                    }
                }
            }
            var needAssesmentsViewModel = NeedAssessmentViewModelBinder.ReturnNeedAssessmentDetailViewModel(result);

            return(Json(new[] { needAssessmentlDetails }.ToDataSourceResult(request), JsonRequestBehavior.AllowGet));
            //return Json(needAssessmentlDetails.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
            // return Json(ModelState.ToDataSourceResult());
        }
Esempio n. 2
0
        public ActionResult NeedAssessmentDetailRead([DataSourceRequest] DataSourceRequest request, int region)              //, string season)
        {
            var woredas = _needAssessmentDetailService.FindBy(z => z.NeedAssessmentHeader.NeedAssessment.NeedAID == region); // .NeedAssessmentHeader.AdminUnit.ParentID == region);
            var needAssesmentsViewModel = NeedAssessmentViewModelBinder.ReturnNeedAssessmentDetailViewModel(woredas);

            return(Json(needAssesmentsViewModel.ToDataSourceResult(request), JsonRequestBehavior.AllowGet));
        }