Ejemplo n.º 1
0
        /// <summary>
        /// Gifts the certificate model.
        /// </summary>
        /// <param name="GiftCertificateModel">The gift certificate model.</param>
        /// <returns></returns>
        public static Models.GiftCertificateViewModel GiftCertificateModel(BLL.GiftCertificate GiftCertificateModel)
        {
            GiftCertificateViewModel giftCertificateViewModel = new GiftCertificateViewModel();

            giftCertificateViewModel.GiftCertificateID = GiftCertificateModel.GiftCertificateID;
            giftCertificateViewModel.GiftDate          = GiftCertificateModel.GiftDate;
            giftCertificateViewModel.DonorID           = GiftCertificateModel.DonorID;
            giftCertificateViewModel.SINumber          = GiftCertificateModel.SINumber;
            giftCertificateViewModel.ReferenceNo       = GiftCertificateModel.ReferenceNo;
            giftCertificateViewModel.Vessel            = GiftCertificateModel.Vessel;
            giftCertificateViewModel.ETA              = GiftCertificateModel.ETA;
            giftCertificateViewModel.ProgramID        = GiftCertificateModel.ProgramID;
            giftCertificateViewModel.PortName         = GiftCertificateModel.PortName;
            giftCertificateViewModel.DModeOfTransport = GiftCertificateModel.DModeOfTransport;
            var giftCertificateDetail = GiftCertificateModel.GiftCertificateDetails.FirstOrDefault();

            if (giftCertificateDetail != null)
            {
                giftCertificateViewModel.CommodityTypeID = giftCertificateDetail.Commodity.CommodityTypeID;
            }
            else
            {
                giftCertificateViewModel.CommodityTypeID = 1;//by default 'food'
            }
            giftCertificateViewModel.GiftCertificateDetails =
                GiftCertificateDetailsViewModel.GenerateListOfGiftCertificateDetailsViewModel(
                    GiftCertificateModel.GiftCertificateDetails.ToList());


            return(giftCertificateViewModel);
        }
Ejemplo n.º 2
0
        public static GiftCertificateDetailsViewModel GenerateGiftCertificateDetailsViewModel(BLL.GiftCertificateDetail giftCertificateDetail)
        {
            GiftCertificateDetailsViewModel model = new GiftCertificateDetailsViewModel();

            model.CommodityID    = giftCertificateDetail.CommodityID;
            model.BillOfLaoading = giftCertificateDetail.BillOfLaoading;
            model.YearPurchased  = giftCertificateDetail.YearPurchased;
            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;

            return(model);
        }
Ejemplo n.º 3
0
        public static Models.GiftCertificateViewModel GiftCertificateModel(BLL.GiftCertificate GiftCertificateModel)
        {
            GiftCertificateViewModel giftCertificateViewModel = new GiftCertificateViewModel();

            giftCertificateViewModel.GiftCertificateID = GiftCertificateModel.GiftCertificateID;
            giftCertificateViewModel.GiftDate          = GiftCertificateModel.GiftDate;
            giftCertificateViewModel.DonorID           = GiftCertificateModel.DonorID;
            giftCertificateViewModel.SINumber          = GiftCertificateModel.SINumber;
            giftCertificateViewModel.ReferenceNo       = GiftCertificateModel.ReferenceNo;
            giftCertificateViewModel.Vessel            = GiftCertificateModel.Vessel;
            giftCertificateViewModel.ETA                    = GiftCertificateModel.ETA;
            giftCertificateViewModel.ProgramID              = GiftCertificateModel.ProgramID;
            giftCertificateViewModel.PortName               = GiftCertificateModel.PortName;
            giftCertificateViewModel.DModeOfTransport       = GiftCertificateModel.DModeOfTransport;
            giftCertificateViewModel.GiftCertificateDetails =
                GiftCertificateDetailsViewModel.GenerateListOfGiftCertificateDetailsViewModel(
                    GiftCertificateModel.GiftCertificateDetails);

            return(giftCertificateViewModel);
        }
        public static GiftCertificateDetailsViewModel GenerateGiftCertificateDetailsViewModel(BLL.GiftCertificateDetail giftCertificateDetail)
        {
            GiftCertificateDetailsViewModel model = new GiftCertificateDetailsViewModel();

            model.GiftCertificateID = giftCertificateDetail.GiftCertificateID;
            model.CommodityID = giftCertificateDetail.CommodityID;
            model.BillOfLoading = giftCertificateDetail.BillOfLoading;
            model.YearPurchased = giftCertificateDetail.YearPurchased;
            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;

            return model;
        }