Exemple #1
0
        public ERPInvoiceInfo CheckStatusForPickedOrdersAsync(string orderNumber)
        {
            var invoice = new ERPInvoiceInfo();

            var httpClient = SetUpHeadersAndAuthentication();

            using (httpClient)
            {
                try
                {
                    var url             = Utilities.Config("CheckPickedOrdersStatus");
                    var httpResponseMsg = httpClient.GetAsync(url).Result;

                    using (var responseHelper = new HttpResponseHelper(httpResponseMsg))
                    {
                        invoice = httpResponseMsg.IsSuccessStatusCode
                                    ? responseHelper.GetPickedOrderStatus()
                                    : null;
                    }
                }
                catch (Exception ex)
                {
                    invoice = null;
                }
            }

            return(invoice);
        }
Exemple #2
0
        private void UpdateProjectsToShippedStatus(long projectId, ERPInvoiceInfo invoiceData)
        {
            var projectToUpdate = Db.Projects?.FirstOrDefault(x => x.ProjectId == projectId &&
                                                              (x.ProjectLeadStatusTypeId == ProjectLeadStatusTypeEnum.OpenOrder));

            if (projectToUpdate != null)
            {
                projectToUpdate.ERPFirstInvoiceDate     = invoiceData.InvoiceDate;
                projectToUpdate.ERPFirstShipDate        = invoiceData.ShipmentDate;
                projectToUpdate.ERPFirstInvoiceNumber   = invoiceData.InvoiceNumber;
                projectToUpdate.ProjectLeadStatusTypeId = ProjectLeadStatusTypeEnum.Shipped;
                projectToUpdate.ProjectOpenStatusTypeId = 6;
                projectToUpdate.ProjectStatusTypeId     = ProjectStatusTypeEnum.ClosedWon;
                projectToUpdate.Deleted = false;
                projectToUpdate.WebServiceImportStatus = "PickedOrdersUpdate";

                UpdateAndLogProjectsInDC(projectToUpdate);
            }
        }