コード例 #1
0
 public bool DeleteGiftCertificateDetail(GiftCertificateDetail giftCertificateDetail)
 {
     if (giftCertificateDetail == null) return false;
     _unitOfWork.GiftCertificateDetailRepository.Delete(giftCertificateDetail);
     _unitOfWork.Save();
     return true;
 }
コード例 #2
0
        public static GiftCertificateDetailsViewModel GenerateGiftCertificateDetailsViewModel(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;
        }
コード例 #3
0
        public static GiftCertificateDetailsViewModel GenerateGiftCertificateDetailsViewModel(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);
        }
コード例 #4
0
 private string GetValue(string key, GiftCertificateDetail detail)
 {
     LetterTemplateService letterService = new LetterTemplateService();
     if (!string.IsNullOrEmpty(key) && detail != null)
     {
         switch (key.ToUpper())
         {
             case CertificateDetailFields.CURRENCY:
                 return letterService.FindById(detail.DCurrencyID).Name;
             case CertificateDetailFields.ACCOUNTNUMBER:
                 return detail.AccountNumber.ToString();
             case CertificateDetailFields.BILLOFLOADING:
                 return detail.BillOfLoading;
             case CertificateDetailFields.COMMODITY:
                 return detail.Commodity.Name;
             case CertificateDetailFields.BUDGETTYPE:
                 return letterService.FindById(detail.DBudgetTypeID).Name;
             case CertificateDetailFields.FUNDSOURCE:
                 return letterService.FindById(detail.DFundSourceID).Name;
             case CertificateDetailFields.ESTIMATEDPRICE:
                 return detail.EstimatedPrice.ToString("N3");
             case CertificateDetailFields.ESTIMATEDTAX:
                 return detail.EstimatedPrice.ToString("N3");
             case CertificateDetailFields.WEIGHTINMT:
                 return detail.WeightInMT.ToString("N3");
             case CertificateDetailFields.YEARPURCHASED:
                 return detail.YearPurchased.ToString();
             case CertificateFields.DONOR:
                 return detail.GiftCertificate.Donor.Name;
             case CertificateFields.ETA:
                 return detail.GiftCertificate.ETA.ToShortDateString();
             case CertificateFields.GIFTDATE:
                 return detail.GiftCertificate.GiftDate.ToShortDateString();
             case CertificateFields.REFERENCENO:
                 return detail.GiftCertificate.ReferenceNo;
             case CertificateFields.SINUMBER:
                 return detail.GiftCertificate.ShippingInstruction.Value;
             case CertificateFields.VESSEL:
                 return detail.GiftCertificate.Vessel;
         }
     }
     return string.Empty;
 }
コード例 #5
0
 public bool EditGiftCertificateDetail(GiftCertificateDetail giftCertificateDetail)
 {
     _unitOfWork.GiftCertificateDetailRepository.Edit(giftCertificateDetail);
     _unitOfWork.Save();
     return true;
 }