GetInvoice() public method

public GetInvoice ( ) : void
return void
        public async Task SendEmailForInvoice(int invoiceId)
        {
            var invoice = await Invoice.GetInvoice(invoiceId);

            var invoicePath = ConstructInvoicePdf(invoice);
            var emailHelper = new EmailHelper();

            emailHelper.SendInvoiceMail(invoice, invoicePath);
        }
Exemplo n.º 2
0
        public void GetInvoice(int id)
        {
            Invoice invoice         = DependencyResolver.Container.Resolve <Invoice>();
            Faktura selectedInvoice = invoice.GetInvoice(id);

            numerField.Text         = selectedInvoice.Numer;
            data_wystawField.Text   = selectedInvoice.Data_wystawienia.ToString();
            data_sprzedazField.Text = selectedInvoice.Data_sprzedazy.ToString();
            platnoscField.Text      = selectedInvoice.Sposob_platnosci;
            productField.Text       = selectedInvoice.Przedmiot_transakcji;
            sumaField.Text          = selectedInvoice.Suma.ToString();
            wplaconoField.Text      = selectedInvoice.Wplacono.ToString();
            commentsField.Text      = selectedInvoice.Uwagi.ToString();
        }
Exemplo n.º 3
0
        public OrderResponse MarkInvoiceAsDownloaded(int companyID, string password, int invoiceID)
        {
            var newResponse = new OrderResponse();

            newResponse.is_error = false;
            try
            {
                Company currentCompany = Company.GetCompany(companyID);

                if (currentCompany == null)
                {
                    newResponse.is_error     = true;
                    newResponse.errorMessage = "NoCompany";
                }
                else
                {
                    if (password != currentCompany.api_key)
                    {
                        newResponse.is_error     = true;
                        newResponse.errorMessage = "IncorrectPassword";
                    }
                    else
                    {
                        var foundInvoice = Invoice.GetInvoice(invoiceID);
                        if (foundInvoice == null)
                        {
                            newResponse.is_error      = true;
                            newResponse.errorMessage += "Error with Invoice: " + invoiceID.ToString() + " Invoice not found\r\n";
                        }
                        else
                        {
                            foundInvoice.is_downloaded       = true;
                            foundInvoice.downloaded_datetime = DateTime.UtcNow;
                            foundInvoice.Save();
                            newResponse.statusMessage = "Invoice # " + invoiceID.ToString() + " updated successfully";
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                newResponse.is_error     = true;
                newResponse.errorMessage = "GenericError";
                LogHelper.WriteError(ex.ToString());
            }
            return(newResponse);
        }
Exemplo n.º 4
0
        public static Invoice GetRequestedInvoice()
        {
            if (HttpContext.Current.Request.QueryString["invoice_id"] == null)
            {
                HttpContext.Current.Response.Redirect("/status.aspx?msg=invoicenotfound");
            }

            int invoice_id = Convert.ToInt32(HttpContext.Current.Request.QueryString["invoice_id"]);

            var currentInvoice = Invoice.GetInvoice(invoice_id);

            if (currentInvoice == null)
            {
                HttpContext.Current.Response.Redirect("/status.aspx?msg=invoicenotfound");
            }

            return(currentInvoice);
        }
 public async Task <InvoiceModel> GetInvoiceById(int id)
 {
     return(await Invoice.GetInvoice(id));
 }
Exemplo n.º 6
0
 public Invoice DisplayInvoice(int invoiceID)
 {
     return(invoice.GetInvoice(invoiceID));
 }