Ejemplo n.º 1
0
        private InKindContributionDetail BindInKindContributionDetail(InKindContributionDetailViewModel inKindContributionDetailViewModel)
        {
            if (inKindContributionDetailViewModel == null) return null;
            var inkindContributionDetail = new InKindContributionDetail()
                {
                    InKindContributionDetailID = inKindContributionDetailViewModel.InKindContributionDetailID,
                    ContributionID = inKindContributionDetailViewModel.ContributionID,
                    ReferenceNumber = inKindContributionDetailViewModel.ReferencNumber,
                    ContributionDate = inKindContributionDetailViewModel.ContributionDate,
                    CommodityID = inKindContributionDetailViewModel.CommodityID,
                    Amount = inKindContributionDetailViewModel.Amount

                };
            return inkindContributionDetail;
        }
Ejemplo n.º 2
0
 public ActionResult InKindContributionDetail_Destroy([DataSourceRequest] DataSourceRequest request, InKindContributionDetailViewModel inKindContributionDetailViewModel)
 {
     if (inKindContributionDetailViewModel != null && ModelState.IsValid)
     {
         _inkindContributionDetailService.DeleteById(inKindContributionDetailViewModel.InKindContributionDetailID);
     }
     return Json(ModelState.ToDataSourceResult());
 }
Ejemplo n.º 3
0
        public ActionResult InKindContributionDetail_Update([DataSourceRequest] DataSourceRequest request, InKindContributionDetailViewModel inKindContributionDetailViewModel)
        {
            if (inKindContributionDetailViewModel != null && ModelState.IsValid)
            {
                var origin = _inkindContributionDetailService.FindById(inKindContributionDetailViewModel.InKindContributionDetailID);
                if (origin != null)
                {
                    origin.InKindContributionDetailID = inKindContributionDetailViewModel.InKindContributionDetailID;
                    origin.ContributionID = inKindContributionDetailViewModel.ContributionID;
                    origin.ReferenceNumber = inKindContributionDetailViewModel.ReferencNumber;
                    origin.ContributionDate = inKindContributionDetailViewModel.ContributionDate;
                    origin.CommodityID = inKindContributionDetailViewModel.CommodityID;
                    origin.Amount = inKindContributionDetailViewModel.Amount;
                    _inkindContributionDetailService.EditInKindContributionDetail(origin);
                }

            }
            return Json(new[] { inKindContributionDetailViewModel }.ToDataSourceResult(request, ModelState));
        }
Ejemplo n.º 4
0
        public ActionResult InKindContributionDetail_Create([DataSourceRequest] DataSourceRequest request, InKindContributionDetailViewModel inKindDetails, int id)
        {
            if (inKindDetails != null && ModelState.IsValid)
            {
                inKindDetails.ContributionID = id;

                _inkindContributionDetailService.AddInKindContributionDetail(BindInKindContributionDetail(inKindDetails));
            }

            return Json(new[] { inKindDetails }.ToDataSourceResult(request, ModelState));
        }