예제 #1
0
        public void GeneratePdfQuote(ParamOrderToPdf paramOrderToPdf)
        {
            WebClient client = new WebClient();

            try
            {
                client.Credentials = new NetworkCredential(_channel.ClientCredentials.UserName.UserName, _channel.ClientCredentials.UserName.Password);
                string uri = ConfigurationManager.AppSettings["remote_host"];

                uri += "pdf=quote";
                uri += "&path=" + ConfigurationManager.AppSettings["remote_doc_lib_pdf_folder"];
                uri += "&num_dev=" + paramOrderToPdf.OrderId;
                uri += "&delay=" + paramOrderToPdf.ValidityDay;
                uri += "&quote=" + paramOrderToPdf.TypeQuoteOrProformat.ToString();
                uri += "&lang=" + paramOrderToPdf.Lang;
                uri += "&key=" + paramOrderToPdf.LicenseKey;

                if (paramOrderToPdf.ParamEmail.IsSendEmail)
                {
                    uri += "&mail=1";
                    uri += "&subject=" + paramOrderToPdf.ParamEmail.Subject;
                }

                if (paramOrderToPdf.IsQuoteConstructorReferencesVisible)
                {
                    uri += "&refv=" + paramOrderToPdf.IsQuoteConstructorReferencesVisible;
                }

                System.Diagnostics.Process.Start(uri);
            }
            finally
            {
                client.Dispose();
            }
        }
예제 #2
0
 public void GeneratePdfQuote(ParamOrderToPdf paramCommandToPdf)
 {
     try
     {
         DAC.DALOrder.GeneratePdfQuote(paramCommandToPdf);
     }
     catch (Exception ex) { Log.error(ex.Message, EErrorFrom.ORDER); }
 }
예제 #3
0
        private async void sendUnpaidInvoiceReminderEmail(BillModel obj)
        {
            Singleton.getDialogueBox().showSearch(ConfigurationManager.AppSettings["wait_message"]);
            ParamOrderToPdf paramOrderToPdf = new ParamOrderToPdf();
            var             paramEmail      = new ParamEmail();

            paramEmail.IsCopyToAgent = await Singleton.getDialogueBox().showAsync("Do you want to receive a copy?");

            paramEmail.IsSendEmail = true;

            paramOrderToPdf.BillId     = obj.Bill.ID;
            paramOrderToPdf.OrderId    = obj.Bill.OrderId;
            paramOrderToPdf.Lang       = CultureInfo.CurrentCulture.Name.Split('-').FirstOrDefault() ?? "en";
            paramOrderToPdf.ParamEmail = paramEmail;

            var billNotPaidFoundList  = BillNotPaidList.Where(x => x.Bill.ID == obj.Bill.ID).ToList();
            var notificationFoundList = await Bl.BlNotification.searchNotificationAsync(new Notification { BillId = obj.Bill.ID }, QOBDCommon.Enum.ESearchOption.AND);

            if (notificationFoundList.Count > 0)
            {
                // the first reminder of unpaid invoice
                if (notificationFoundList[0].Reminder1 <= Utility.DateTimeMinValueInSQL2005 && notificationFoundList[0].Reminder2 <= Utility.DateTimeMinValueInSQL2005)
                {
                    paramEmail.Reminder = 1;
                    notificationFoundList[0].Reminder1 = DateTime.Now;

                    // update the invoice notification
                    if (billNotPaidFoundList.Count > 0)
                    {
                        billNotPaidFoundList[0].TxtDateFirstReminder = notificationFoundList[0].Reminder1.ToString();
                    }
                }

                // the second reminder of unpaid invoice
                else
                {
                    paramEmail.Reminder = 2;
                    notificationFoundList[0].Reminder2 = DateTime.Now;

                    // update the invoice notification
                    if (billNotPaidFoundList.Count > 0)
                    {
                        billNotPaidFoundList[0].TxtDateSecondReminder = notificationFoundList[0].Reminder2.ToString();
                    }
                }

                // save that a reminder has been sent
                var savedNotificationList = await Bl.BlNotification.UpdateNotificationAsync(new List <Notification> {
                    notificationFoundList[0]
                });

                // generate and send the invoice
                Bl.BlOrder.GeneratePdfOrder(paramOrderToPdf);
            }

            Singleton.getDialogueBox().IsDialogOpen = false;
        }
예제 #4
0
        public void GeneratePdfOrder(ParamOrderToPdf paramOrderToPdf)
        {
            WebClient client = new WebClient();

            try
            {
                client.Credentials = new NetworkCredential(_channel.ClientCredentials.UserName.UserName, _channel.ClientCredentials.UserName.Password);
                string uri = ConfigurationManager.AppSettings["remote_host"];

                uri += "pdf=invoice";
                uri += "&path=" + ConfigurationManager.AppSettings["remote_doc_lib_pdf_folder"];
                uri += "&num_dev=" + paramOrderToPdf.OrderId;
                uri += "&num_fact=" + paramOrderToPdf.BillId;
                uri += "&lang=" + paramOrderToPdf.Lang;
                uri += "&key=" + paramOrderToPdf.LicenseKey;

                if (paramOrderToPdf.ParamEmail.IsSendEmail)
                {
                    uri += "&remind=" + paramOrderToPdf.ParamEmail.Reminder;
                    uri += "&mail=1";
                    uri += "&subject=" + paramOrderToPdf.ParamEmail.Subject;
                    if (paramOrderToPdf.ParamEmail.IsCopyToAgent)
                    {
                        uri += "&copyagent=1";
                    }
                }

                if (paramOrderToPdf.IsOrderConstructorReferencesVisible)
                {
                    uri += "&refv=" + paramOrderToPdf.IsOrderConstructorReferencesVisible;
                }

                System.Diagnostics.Process.Start(uri);
            }
            finally
            {
                client.Dispose();
            }
        }
예제 #5
0
 public void GeneratePdfQuote(ParamOrderToPdf paramOrderToPdf)
 {
     _gatewayOrder.GeneratePdfQuote(paramOrderToPdf);
 }