public async Task SendEmailForInvoice(int invoiceId) { var invoice = await Invoice.GetInvoice(invoiceId); var invoicePath = ConstructInvoicePdf(invoice); var emailHelper = new EmailHelper(); emailHelper.SendInvoiceMail(invoice, invoicePath); }
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(); }
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); }
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)); }
public Invoice DisplayInvoice(int invoiceID) { return(invoice.GetInvoice(invoiceID)); }