예제 #1
0
        public FrayteResult SetShipmentHSCode(int eCommerceShipmentDetailid, string HSCode, string Description, int HsCodeId)
        {
            try
            {
                FrayteResult result = new HsCodeJobRepository().SetShipmentHSCode(eCommerceShipmentDetailid, HSCode, Description, HsCodeId);
                if (result.Status)
                {
                    var Status = new HSCodeRepository().ISAllHSCodeMapped(eCommerceShipmentDetailid);
                    if (Status.Status)
                    {
                        // Get Shipment Detail
                        FrayteeCommerceShipmentDetail shipmentDetail = new eCommerceShipmentRepository().GeteCommerceBookingDetail(Status.Id, "");

                        var IsInVoiceCreated = new eCommerceShipmentRepository().IsInvoiceCreated(Status.Id);
                        if (!IsInVoiceCreated)
                        {
                            // Generate model for invoice
                            eCommerceTaxAndDutyInvoiceReport invoiceReport = new eCommerceShipmentRepository().GeteCommerceInvoiceObj(Status.Id);

                            // Generate Invoice Report

                            var reportResult = new Report.Generator.ManifestReport.eCommerceInvoiceReport().GenerateInvoiceReport(Status.Id, invoiceReport);
                            if (reportResult.Status)
                            {
                                // Save Invoice Info
                                var status = new eCommerceShipmentRepository().SaveeCommerceInvoice(Status.Id, invoiceReport);
                                try
                                {
                                    // send mail to receiver with attached invoice
                                    new ShipmentEmailRepository().sendInVoiceMail(Status.Id);
                                }
                                catch (Exception ex)
                                {
                                    Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
                                }
                            }
                        }
                    }
                }
                return(result);
            }
            catch (Exception ex)
            {
                Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
                return(new FrayteResult
                {
                    Status = false
                });
            }
        }
예제 #2
0
 public FrayteResult SetShipmentHSCode(int eCommerceShipmentDetailid, string HSCode)
 {
     try
     {
         FrayteResult result = new HSCodeRepository().SetShipmentHSCode(eCommerceShipmentDetailid, HSCode);
         return(result);
     }
     catch (Exception ex)
     {
         return(new FrayteResult
         {
             Status = false
         });
     }
 }
예제 #3
0
        public IHttpActionResult GetHSCodes(string serachTerm, int countryId)
        {
            var data = new HSCodeRepository().GetHSCodes(serachTerm, countryId);

            return(Ok(data));
        }
예제 #4
0
        public List <NonHsCodeShipments> GetNonHSCodeShipments(TrackHSCodeShipment obj)
        {
            var data = new HSCodeRepository().GetNonHSCodeShipments(obj);

            return(data);
        }