Exemple #1
0
 public IHttpActionResult GetJobsDetails(int userId)
 {
     try
     {
         JobDetail data = new HsCodeJobRepository().GetJobsDetails(userId);
         return(Ok(data));
     }
     catch (Exception ex)
     {
         return(BadRequest("Can not complete the request"));
     }
 }
Exemple #2
0
 public IHttpActionResult GetAssignedJobs(TrackAssignedJob obj)
 {
     try
     {
         List <FrayteMappedJobs> list = new List <FrayteMappedJobs>();
         list = new HsCodeJobRepository().GetAssignedJobs(obj);
         return(Ok(list));
     }
     catch (Exception ex)
     {
         return(BadRequest("Request can not be completed."));
     }
 }
Exemple #3
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
                });
            }
        }
Exemple #4
0
 public IHttpActionResult AsssignJobs(OpeartorJob jobs)
 {
     try
     {
         FrayteResult result = new FrayteResult();
         result = new HsCodeJobRepository().AssignJobToOperator(jobs);
         return(Ok(result));
     }
     catch (Exception ex)
     {
         Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
         return(BadRequest("Couls not Complete the request."));
     }
 }
Exemple #5
0
 public IHttpActionResult GetOperatorsWithJobs(int userId)
 {
     try
     {
         List <OperatorWithJobs> list = new List <OperatorWithJobs>();
         list = new HsCodeJobRepository().GetOperatorsWithJobs(userId);
         return(Ok(list));
     }
     catch (Exception ex)
     {
         Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
         return(BadRequest("Couls not Complete the request."));
     }
 }
Exemple #6
0
        public IHttpActionResult HSCodeOutputPerOperatorPerHour(int userId)
        {
            try
            {
                List <HSCodeAvgOutput> list = new List <HSCodeAvgOutput>();
                list = new HsCodeJobRepository().HSCodeOutputPerOperatorPerHour(userId);

                return(Ok(list));
            }
            catch (Exception ex)
            {
                return(BadRequest("Request could not be completed at the moment."));
            }
        }
Exemple #7
0
 public IHttpActionResult GetJobsInProgressCount()
 {
     try
     {
         JobsInProgressCount jobsCount = new JobsInProgressCount();
         jobsCount = new HsCodeJobRepository().GetJobsInProgressCount();
         return(Ok(jobsCount));
     }
     catch (Exception ex)
     {
         Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
         return(BadRequest("Could not Complete the request."));
     }
 }
Exemple #8
0
 public IHttpActionResult ReAssignJobs(OpeartorReAssignedJob jobs)
 {
     try
     {
         FrayteResult result = new FrayteResult();
         result = new HsCodeJobRepository().ReAssignJobs(jobs);
         return(Ok(result));
     }
     catch (Exception ex)
     {
         Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
         return(BadRequest("Could not complete the request at the moment."));
     }
 }