コード例 #1
0
        public IHttpActionResult SendCustomerRateCardAsEmail(CustomerRate Customer)
        {
            FrayteResult result = new FrayteResult();

            try
            {
                var filepath = new CustomerBaseRateReport().CustomerBaseRate(Customer);
                result = new ShipmentEmailRepository().EmailCustomerRateCard(Customer, filepath.FileName, filepath.FilePath);
            }
            catch (Exception ex)
            {
                Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            }
            return(Ok(result));
        }
コード例 #2
0
 public IHttpActionResult SendCustomerQuoteMail(FrayteQuotationEmailMail CustomerEmailDetail)
 {
     try
     {
         FrayteQuotationResult result = new FrayteQuotationResult();
         var fileResult = new QuoteReport().GetQuotation(CustomerEmailDetail.QuotationDetail.QuotationShipmentId, CustomerEmailDetail.Name, CustomerEmailDetail.QuotationDetail.QuotationFromAddress.PostCode, CustomerEmailDetail.QuotationDetail.QuotationToAddress.PostCode, CustomerEmailDetail.LoginUserId);
         var ratecard   = new CustomerBaseRateReport().CustomerQuoteRateCard(CustomerEmailDetail.QuotationDetail.QuotationShipmentId);
         result = new ShipmentEmailRepository().SendCustomerQuoteMail(CustomerEmailDetail, fileResult, ratecard);
         return(Ok(result));
     }
     catch (Exception ex)
     {
         Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
         return(BadRequest());
     }
 }
コード例 #3
0
        public IHttpActionResult GenerateCustomerBaseRateCard(CustomerRate Rate)
        {
            FrayteManifestName result = new FrayteManifestName();

            if (Rate.FileType == FrayteCustomerBaseRateFileType.Excel)
            {
                result = new CustomerBaseRateReport().CustomerBaseRate(Rate);
            }
            else if (Rate.FileType == FrayteCustomerBaseRateFileType.Pdf)
            {
                result = new CustomerBaseRateReport().CustomerBaseRate(Rate);
            }
            else if (Rate.SendingOption == FrayteCustomerBaseRateFileType.Summery)
            {
                result = new CustomerBaseRateReport().CustomerBaseRateSummery(Rate);
            }
            return(Ok(result));
        }
コード例 #4
0
        internal static void SendExcelRateCardMail(List <FryateUserSettingDetail> _customerlogistics, int UserId, string UserName, int OperationZoneId)
        {
            try
            {
                int           n = 0;
                CustomerRate  rate;
                List <string> filepath = new List <string>();
                List <string> filename = new List <string>();
                foreach (var Obj in _customerlogistics)
                {
                    rate                   = new CustomerRate();
                    rate.UserId            = UserId;
                    rate.CustomerName      = UserName;
                    rate.LogisticServiceId = Obj.LogisticService.LogisticServiceId;
                    rate.LogisticType      = Obj.LogisticService.LogisticType;
                    rate.RateType          = Obj.LogisticService.RateType;
                    rate.FileType          = FrayteCustomerBaseRateFileType.Excel;
                    FrayteManifestName file = new CustomerBaseRateReport().CustomerBaseRate(rate);

                    filepath.Add(file.FilePath);
                    filename.Add(file.FileName);
                    n++;
                }

                //Sened Mail
                if (filepath.Count > 0)
                {
                    FrayteResult result = new ShipmentEmailRepository().EmailCustomerRateCard(UserId, filename, filepath, OperationZoneId);
                    Logger       _log   = Get_Log();
                    _log.Info("(" + n + ") " + filepath.Count + "\n");
                    _log.Error(result.Status.ToString() + "\n" + result.Errors);
                }
            }
            catch (Exception ex)
            {
                Logger _log = Get_Log();
                _log.Info("Error sending customer rate card excel " + ex.Message);
                _log.Error(ex);
            }
        }
コード例 #5
0
 public IHttpActionResult SendQuotationMail(FrayteQuotationEmailMail quotationEmailDetail)
 {
     try
     {
         FrayteQuotationResult result = new FrayteQuotationResult();
         if (quotationEmailDetail.QuotationDetail.QuotationShipmentId > 0)
         {
             //Step 1: Get Surcharge Detail According Choose Service
             var fileResult = new QuoteReport().GetQuotation(quotationEmailDetail.QuotationDetail.QuotationShipmentId, quotationEmailDetail.Name, quotationEmailDetail.QuotationDetail.QuotationFromAddress.PostCode, quotationEmailDetail.QuotationDetail.QuotationToAddress.PostCode, quotationEmailDetail.LoginUserId);
             var ratecard   = new CustomerBaseRateReport().CustomerQuoteRateCard(quotationEmailDetail.QuotationDetail.QuotationShipmentId);
             result = new ShipmentEmailRepository().SendQuotationMail(quotationEmailDetail, fileResult, ratecard);
             return(Ok(result));
         }
         else
         {
             return(BadRequest());
         }
     }
     catch (Exception ex)
     {
         Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
         return(BadRequest());
     }
 }