protected void Td_Click(object sender, EventArgs e)
        {
            string xml2 = File.ReadAllText("D:\\Suraj\\Suraj\\Code\\TazWorksCom\\Tazzwork_request.xml");

            //string xmlEnquiry = File.ReadAllText("D:\\EknowID\\Code\\TazWorksCom\\Res.xml");

            //string[] Titles = { "first-name", "last-name", "relation-to-viewer", "num-recommenders", "current-status", "current-status-timestamp", "start-date", "is-current", "school-name", "end-date", "member-url-resources", "member-url", "api-standard-profile-request", "http-header", "site-standard-profile-request", "picture-url", "field-of-study", "phone-numbers","phone-type", "main-address" };
            //string[] Titles1 = { "FirstName", "LastName", "RelationToViewer", "NumRecommenders", "CurrentStatus", "CurrentStatusTimestamp", "StartDate", "IsCurrent", "SchoolName", "EndDate", "MemberUrlResources", "MemberUrl", "ApiStandardProfileRequest", "HttpHeader", "SiteStandardProfileRequest", "PictureUrl", "FieldOfStudy", "phonenumbers","phonetype", "MainAddress" };
            //for (int loopCount = 0; loopCount < Titles.Count(); loopCount++)
            //{
            //    xmlEnquiry = xmlEnquiry.Replace(Titles[loopCount], Titles1[loopCount]);
            //}

            //var regex = new Regex("phone-number");
            //xmlEnquiry = regex.Replace(xmlEnquiry, "phonenumber", 1);
            //xmlEnquiry = regex.Replace(xmlEnquiry, "phoneNumber", 2);
            //xmlEnquiry = regex.Replace(xmlEnquiry, "phonenumber", 1);



            //ResumeParserData person = (ResumeParserData)SerializationHelper.XmlDeserializeFromString(xmlEnquiry, typeof(ResumeParserData));


            //FillSessionValues(person);

            //if (SessionWrapper.LinkedinData.EmploymentDetailes.Count != 0)
            //{
            //    for (int i = 0; i < SessionWrapper.LinkedinData.EmploymentDetailes.Count; i++)
            //    {
            //        SessionWrapper.LinkedinData.EmploymentDetailes[i].UserId = SessionWrapper.LoggedUser.UserId;
            //    }
            //    UserEmploymentDetailsHelper.SaveUserEmpDetails(SessionWrapper.LinkedinData.EmploymentDetailes);
            //}
            //if (SessionWrapper.LinkedinData.EducationalDetail != null)
            //{
            //    SessionWrapper.LinkedinData.EducationalDetail.UserId = SessionWrapper.LoggedUser.UserId;
            //    UserEducationalDetailHelper.SaveUserEducationDetail(SessionWrapper.LinkedinData.EducationalDetail);
            //}

            ProcessRequest proRequest = new ProcessRequest();

            string response = proRequest.HttpPost(xml2);

            ConstructRequest req = new ConstructRequest();

            req.GetResponse(37, 3);
        }
        static void Main(string[] args)
        {
            log.Info("Starting the application...");
            Console.WriteLine("Starting the application...");
            try
            {
                #region Main
                ConstructRequest con = new ConstructRequest();

                //Get the List of Pending Order Ids
                List <int> pendingOrderId = OrderStatusHelper.GetPendingOrders();
                OrderState pendingOrder;

                //For Each Record in order Id Check for the Response
                foreach (int orderId in pendingOrderId)
                {
                    try
                    {
                        pendingOrder = new OrderState();

                        //Get Last Order Status of the orderID
                        pendingOrder = OrderStatusHelper.GetOrderState(orderId);

                        if (pendingOrder.TazWorksStatus != 10 && pendingOrder.TazWorksStatus != 4)
                        {
                            // Send the Xml Reponse and Receive the Status Enquiry and Save it to DataBase
                            OrderState newOrderState = con.XMLStatusEnquiry(orderId);

                            if (newOrderState.TazWorksStatus == (int)TazWorksStatus.READY || newOrderState.TazWorksStatus == (int)TazWorksStatus.COMPLETED)
                            {
                                //Create the Pdf If Status is Complete
                                CreatePDF pdf = new CreatePDF(orderId);
                                pdf.UrlTOPDF(newOrderState.URL);


                                //Send Mail To the User
                                if (SendMail.Sendmail(newOrderState.OrderId, true))
                                {
                                    // Mail Sent
                                    Console.WriteLine("Mail Sent...");
                                }
                                else
                                {   // Mail Not Sent
                                    Console.Write("Not Sent...");
                                }
                            }
                        }
                    }
                    catch (Exception Ex)
                    {
                        log.Error(Ex.Message);
                        Console.WriteLine(Ex.Message);
                    }
                }
                #endregion

                log.Info("Stop the application...");
                Console.WriteLine("Stop the application...");
            }
            catch (Exception ex)
            {
                log.Error(ex.Message);
                Console.WriteLine(ex.Message);
            }
        }
        private void saveOrderStateTask(int orderID, int userID)
        {
            ConstructRequest con = new ConstructRequest();

            con.GetResponse(orderID, userID);
        }
        private void GetOrderStatusEnquiry(int orderID, int userID)
        {
            ConstructRequest con = new ConstructRequest();

            orderstate = con.XMLStatusEnquiry(orderID, userID);
        }
Beispiel #5
0
        private void SchedularCallback(object e)
        {
            WriteErrorLog("eKnowId Order Status enquiry service started processing all the orders...");
            var exceptions = new ConcurrentQueue <Exception>();

            try {
                ConstructRequest con = new ConstructRequest();

                ////Get the List of Pending Order Ids
                List <int> pendingOrderId = OrderStatusHelper.GetPendingOrders();
                OrderState pendingOrder;
                if (pendingOrderId.Any())
                {
                    WriteErrorLog("eKnowId Order Status enquiry service found " + pendingOrderId.Count() + " pending Orders");

                    //For Each Record in order Id Check for the Response
                    foreach (int orderId in pendingOrderId)
                    {
                        try {
                            pendingOrder = new OrderState();

                            //Get Last Order Status of the orderID
                            pendingOrder = OrderStatusHelper.GetOrderState(orderId);
                            WriteErrorLog("eKnowId Order Status enquiry service received Last Order Status of the orderID: " + orderId + " as " + pendingOrder.TazWorksStatus);

                            if (pendingOrder.TazWorksStatus != 10 && pendingOrder.TazWorksStatus != 4)
                            {
                                // Send the Xml Reponse and Receive the Status Enquiry and Save it to DataBase
                                OrderState newOrderState = con.XMLStatusEnquiry(orderId);
                                WriteErrorLog("eKnowId Order Status enquiry service Sent Xml Reponse, Received Status Enquiry and Saved it to DataBase for orderID: " + orderId);

                                if (newOrderState.TazWorksStatus == (int)TazWorksStatus.READY || newOrderState.TazWorksStatus == (int)TazWorksStatus.COMPLETED)
                                {
                                    //Create the Pdf If Status is Complete
                                    CreatePDF pdf = new CreatePDF(orderId);
                                    pdf.UrlTOPDF(newOrderState.URL);
                                    WriteErrorLog("eKnowId Order Status enquiry service created pdf for orderID: " + orderId);

                                    //Send Mail To the User
                                    if (SendMail.Sendmail(newOrderState.OrderId, true))
                                    {
                                        // Mail Sent
                                        WriteErrorLog("Email Sent to user");
                                    }
                                    else       // Mail Not Sent
                                    {
                                        WriteErrorLog("Failed to send email");
                                    }
                                }
                            }
                        } catch (Exception Ex) {
                            exceptions.Enqueue(Ex);
                        }
                    }
                    WriteErrorLog("eKnowId Order Status enquiry service processed " + pendingOrderId.Count() + "pending Orders");
                    if (0 < exceptions.Count)
                    {
                        WriteErrorLog(new AggregateException(exceptions).Flatten().Message);
                    }
                }
                this.ScheduleService();
            } catch (Exception) {
                using (System.ServiceProcess.ServiceController serviceController = new System.ServiceProcess.ServiceController("StatusEnquiryService")) {
                    if (serviceController.Status == ServiceControllerStatus.Running)
                    {
                        serviceController.Stop();
                    }
                }
            }
        }