public ActionResult GiftCertificateDetail_Destroy([DataSourceRequest] DataSourceRequest request,
                                                          GiftCertificateDetailsViewModel giftCertificateDetailsViewModel)
        {
            if (giftCertificateDetailsViewModel != null)
            {
                _giftCertificateDetailService.DeleteById(giftCertificateDetailsViewModel.GiftCertificateDetailID);
            }

            return(Json(ModelState.ToDataSourceResult()));
        }
 public static GiftCertificateDetail BindGiftCertificateDetail(GiftCertificateDetail giftCertificateDetail, GiftCertificateDetailsViewModel giftCertificateDetailsViewModel)
 {
     giftCertificateDetail.CommodityID = giftCertificateDetailsViewModel.CommodityID;
     giftCertificateDetail.BillOfLoading = giftCertificateDetailsViewModel.BillOfLoading;
     giftCertificateDetail.YearPurchased = giftCertificateDetailsViewModel.YearPurchased;
     giftCertificateDetail.AccountNumber = giftCertificateDetailsViewModel.AccountNumber;
     giftCertificateDetail.WeightInMT = giftCertificateDetailsViewModel.WeightInMT;
     giftCertificateDetail.EstimatedPrice = giftCertificateDetailsViewModel.EstimatedPrice;
     giftCertificateDetail.EstimatedTax = giftCertificateDetailsViewModel.EstimatedTax;
     giftCertificateDetail.DCurrencyID = giftCertificateDetailsViewModel.DCurrencyID;
     giftCertificateDetail.DFundSourceID = giftCertificateDetailsViewModel.DFundSourceID;
     giftCertificateDetail.DBudgetTypeID = giftCertificateDetailsViewModel.DBudgetTypeID;
     giftCertificateDetail.GiftCertificateDetailID = giftCertificateDetailsViewModel.GiftCertificateDetailID;
     giftCertificateDetail.GiftCertificateDetailID = giftCertificateDetailsViewModel.GiftCertificateDetailID;
     giftCertificateDetail.GiftCertificateID = giftCertificateDetailsViewModel.GiftCertificateID;
     giftCertificateDetail.TransactionGroupID = giftCertificateDetailsViewModel.TransactionGroupID;
     giftCertificateDetail.ExpiryDate = giftCertificateDetailsViewModel.ExpiryDate;
     return giftCertificateDetail;
 }
        public static GiftCertificateDetailsViewModel BindGiftCertificateDetailsViewModel(GiftCertificateDetail giftCertificateDetail, string pref)
        {
            var model = new GiftCertificateDetailsViewModel();

            model.GiftCertificateID = giftCertificateDetail.GiftCertificateID;
            model.GiftCertificateDetailID = giftCertificateDetail.GiftCertificateDetailID;
            model.CommodityID = giftCertificateDetail.CommodityID;
            model.BillOfLoading = giftCertificateDetail.BillOfLoading;
            model.YearPurchased = giftCertificateDetail.YearPurchased;//.ToCTSPreferedDateFormat(pref);
            model.AccountNumber = giftCertificateDetail.AccountNumber;
            model.WeightInMT = giftCertificateDetail.WeightInMT;
            model.EstimatedPrice = giftCertificateDetail.EstimatedPrice;
            model.EstimatedTax = giftCertificateDetail.EstimatedTax;
            model.DBudgetTypeID = giftCertificateDetail.DBudgetTypeID;
            model.DFundSourceID = giftCertificateDetail.DFundSourceID;
            model.DCurrencyID = giftCertificateDetail.DCurrencyID;
            model.ExpiryDate = giftCertificateDetail.ExpiryDate;
            model.FundSource = giftCertificateDetail.Detail.Name;
            model.CommodityName = giftCertificateDetail.Commodity.Name;
            model.ExpiryDate = giftCertificateDetail.ExpiryDate;
            model.YearPurchasedPrefered = giftCertificateDetail.YearPurchased;//.ToCTSPreferedDateFormat(pref);

            return model;
        }
        public static GiftCertificateDetailsViewModel BindGiftCertificateDetailsViewModel(GiftCertificateDetail giftCertificateDetail, string pref)
        {
            var model = new GiftCertificateDetailsViewModel();

            model.GiftCertificateID       = giftCertificateDetail.GiftCertificateID;
            model.GiftCertificateDetailID = giftCertificateDetail.GiftCertificateDetailID;
            model.CommodityID             = giftCertificateDetail.CommodityID;
            model.BillOfLoading           = giftCertificateDetail.BillOfLoading;
            model.YearPurchased           = giftCertificateDetail.YearPurchased;//.ToCTSPreferedDateFormat(pref);
            model.AccountNumber           = giftCertificateDetail.AccountNumber;
            model.WeightInMT            = giftCertificateDetail.WeightInMT;
            model.EstimatedPrice        = giftCertificateDetail.EstimatedPrice;
            model.EstimatedTax          = giftCertificateDetail.EstimatedTax;
            model.DBudgetTypeID         = giftCertificateDetail.DBudgetTypeID;
            model.DFundSourceID         = giftCertificateDetail.DFundSourceID;
            model.DCurrencyID           = giftCertificateDetail.DCurrencyID;
            model.ExpiryDate            = giftCertificateDetail.ExpiryDate;
            model.FundSource            = giftCertificateDetail.Detail.Name;
            model.CommodityName         = giftCertificateDetail.Commodity.Name;
            model.ExpiryDate            = giftCertificateDetail.ExpiryDate;
            model.YearPurchasedPrefered = giftCertificateDetail.YearPurchased;//.ToCTSPreferedDateFormat(pref);

            return(model);
        }
        public ActionResult GiftCertificateDetail_Update([DataSourceRequest]DataSourceRequest request, GiftCertificateDetailsViewModel giftCertificateDetailsViewModel)
        {
            if (giftCertificateDetailsViewModel != null )
            {
                var target = _giftCertificateDetailService.FindById(giftCertificateDetailsViewModel.GiftCertificateDetailID);
                if (target != null)
                {
                    target = GiftCertificateViewModelBinder.BindGiftCertificateDetail(target, giftCertificateDetailsViewModel);

                    _giftCertificateDetailService.EditGiftCertificateDetail(target);
                }
                return RedirectToAction("Index");
            }

            return Json(new[] { giftCertificateDetailsViewModel }.ToDataSourceResult(request, ModelState));
        }
        public ActionResult GiftCertificateDetail_Destroy([DataSourceRequest] DataSourceRequest request,
                                                  GiftCertificateDetailsViewModel giftCertificateDetailsViewModel)
        {
            if (giftCertificateDetailsViewModel != null)
            {
                _giftCertificateDetailService.DeleteById(giftCertificateDetailsViewModel.GiftCertificateDetailID);
            }

            return Json(ModelState.ToDataSourceResult());
        }
 public ActionResult GiftCertificateDetail_Create([DataSourceRequest] DataSourceRequest request, GiftCertificateDetailsViewModel giftCertificateDetailsViewModel, int? id)
 {
     if (giftCertificateDetailsViewModel != null  && id.HasValue)
     {
         giftCertificateDetailsViewModel.GiftCertificateID = id.Value;
         var giftcertifiateDtail = GiftCertificateViewModelBinder.BindGiftCertificateDetail(giftCertificateDetailsViewModel);
         _giftCertificateDetailService.AddGiftCertificateDetail(giftcertifiateDtail);
         return RedirectToAction("Index");
     }
     //return RedirectToAction("Index");
     return Json(new[] { giftCertificateDetailsViewModel }.ToDataSourceResult(request, ModelState));
 }
 public static GiftCertificateDetail BindGiftCertificateDetail(GiftCertificateDetailsViewModel giftCertificateDetailsViewModel)
 {
     return BindGiftCertificateDetail(new GiftCertificateDetail(), giftCertificateDetailsViewModel);
 }
 public static GiftCertificateDetail BindGiftCertificateDetail(GiftCertificateDetail giftCertificateDetail, GiftCertificateDetailsViewModel giftCertificateDetailsViewModel)
 {
     giftCertificateDetail.CommodityID             = giftCertificateDetailsViewModel.CommodityID;
     giftCertificateDetail.BillOfLoading           = giftCertificateDetailsViewModel.BillOfLoading;
     giftCertificateDetail.YearPurchased           = giftCertificateDetailsViewModel.YearPurchased;
     giftCertificateDetail.AccountNumber           = giftCertificateDetailsViewModel.AccountNumber;
     giftCertificateDetail.WeightInMT              = giftCertificateDetailsViewModel.WeightInMT;
     giftCertificateDetail.EstimatedPrice          = giftCertificateDetailsViewModel.EstimatedPrice;
     giftCertificateDetail.EstimatedTax            = giftCertificateDetailsViewModel.EstimatedTax;
     giftCertificateDetail.DCurrencyID             = giftCertificateDetailsViewModel.DCurrencyID;
     giftCertificateDetail.DFundSourceID           = giftCertificateDetailsViewModel.DFundSourceID;
     giftCertificateDetail.DBudgetTypeID           = giftCertificateDetailsViewModel.DBudgetTypeID;
     giftCertificateDetail.GiftCertificateDetailID = giftCertificateDetailsViewModel.GiftCertificateDetailID;
     giftCertificateDetail.GiftCertificateDetailID = giftCertificateDetailsViewModel.GiftCertificateDetailID;
     giftCertificateDetail.GiftCertificateID       = giftCertificateDetailsViewModel.GiftCertificateID;
     giftCertificateDetail.TransactionGroupID      = giftCertificateDetailsViewModel.TransactionGroupID;
     giftCertificateDetail.ExpiryDate              = giftCertificateDetailsViewModel.ExpiryDate;
     return(giftCertificateDetail);
 }
 public static GiftCertificateDetail BindGiftCertificateDetail(GiftCertificateDetailsViewModel giftCertificateDetailsViewModel)
 {
     return(BindGiftCertificateDetail(new GiftCertificateDetail(), giftCertificateDetailsViewModel));
 }
        public ActionResult GiftCertificateDetail_Update([DataSourceRequest] DataSourceRequest request, GiftCertificateDetailsViewModel giftCertificateDetailsViewModel)
        {
            if (giftCertificateDetailsViewModel != null)
            {
                var target = _giftCertificateDetailService.FindById(giftCertificateDetailsViewModel.GiftCertificateDetailID);
                if (target != null)
                {
                    target = GiftCertificateViewModelBinder.BindGiftCertificateDetail(target, giftCertificateDetailsViewModel);

                    _giftCertificateDetailService.EditGiftCertificateDetail(target);
                }
            }

            return(Json(new[] { giftCertificateDetailsViewModel }.ToDataSourceResult(request, ModelState)));
        }
        public ActionResult GiftCertificateDetail_Create([DataSourceRequest] DataSourceRequest request, GiftCertificateDetailsViewModel giftCertificateDetailsViewModel, int?id)
        {
            if (giftCertificateDetailsViewModel != null && id.HasValue)
            {
                giftCertificateDetailsViewModel.GiftCertificateID = id.Value;
                var giftcertifiateDtail = GiftCertificateViewModelBinder.BindGiftCertificateDetail(giftCertificateDetailsViewModel);
                _giftCertificateDetailService.AddGiftCertificateDetail(giftcertifiateDtail);
            }

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