/// <summary> /// Call Send email from QBOApp /// </summary> /// <param name="context"></param> /// <returns></returns> public void SendEmailCall(ServiceContext context) { try { Invoice invoice = (Invoice)HttpContext.Current.Session["Invoice"]; QBOApp.EmailInvoice(context, invoice, EmailText.Text); output("QBO Email invoice call successful."); } catch (Exception ex) { output(ex.Message); } }
/// <summary> /// Call Send email from QBOApp /// </summary> /// <param name="context"></param> /// <returns></returns> public void SendEmailCall(ServiceContext context) { try { DataService dataService = new DataService(context); QBOApp.EmailInvoice(dataService, invoice, EmailText.Text); output("QBO Email invoice call successful."); } catch (Exception ex) { output(ex.Message); } }
/// <summary> /// Call Create expense from QBOApp /// </summary> /// <param name="context"></param> /// <returns></returns> public void CreateExpenseCall(ServiceContext context) { try { Customer customer = QBOHelper.QBO.CustomerCreate(context); HttpContext.Current.Session["Customer"] = customer; Purchase purchase = QBOApp.BillableExpenseCreate(context, customer); output("QBO Expense call successful."); lblQBOCall.Visible = true; lblQBOCall.Text = "Created expense with id: " + purchase.Id; output("Expense with Id " + purchase.Id + " created"); } catch (Exception ex) { output(ex.Message); } }
/// <summary> /// Call Record payment from QBOApp /// </summary> /// <param name="context"></param> /// <returns></returns> public void ReceivePaymentCall(ServiceContext context) { try { Invoice invoiceOld = (Invoice)HttpContext.Current.Session["Invoice"]; Customer customer = (Customer)HttpContext.Current.Session["Customer"]; Invoice invoiceLinked = QBOHelper.QBO.QueryInvoice(context, "Select * from Invoice where id='" + invoiceOld.Id + "'", customer); Payment payment = QBOApp.ReceivePayment(context, invoiceLinked); output("QBO Payment received call successful."); showPaymentId.Visible = true; showPaymentId.Text = "Received payment with id: " + payment.Id; } catch (Exception ex) { output(ex.Message); } }
/// <summary> /// Call Record payment from QBOApp /// </summary> /// <param name="context"></param> /// <returns></returns> public void ReceivePaymentCall(ServiceContext context) { try { DataService dataService = new DataService(context); QueryService <Invoice> queryService = new QueryService <Invoice>(context); Invoice invoiceLinked = QBOApp.QueryInvoice(queryService, "Select * from Invoice where id='" + invoice.Id + "'"); Payment payment = QBOApp.ReceivePayment(dataService, invoiceLinked); output("QBO Payment received call successful."); showPaymentId.Visible = true; showPaymentId.Text = "Received payment with id: " + payment.Id; } catch (Exception ex) { output(ex.Message); } }
/// <summary> /// Call Create invoice from QBOApp /// </summary> /// <param name="context"></param> /// <returns></returns> public void CreateInvoiceCall(ServiceContext context) { try { DataService dataService = new DataService(context); QueryService <Account> queryService = new QueryService <Account>(context); invoice = QBOApp.InvoiceCreate(dataService, queryService, customer); output("QBO Invoice call successful."); showInvoiceId.Visible = true; showInvoiceId.Text = "Created invoice with id: " + invoice.Id; output("Invoice with Id " + invoice.Id + " created"); } catch (Exception ex) { output(ex.Message); } }
/// <summary> /// Call Create invoice from QBOApp /// </summary> /// <param name="context"></param> /// <returns></returns> public void CreateInvoiceCall(ServiceContext context) { try { Customer customer = (Customer)Session["Customer"]; //Customer customer = QBOHelper.QBO.CustomerCreate(context); Invoice invoice = QBOApp.InvoiceCreate(context, customer); HttpContext.Current.Session["Invoice"] = invoice; output("QBO Invoice call successful."); showInvoiceId.Visible = true; showInvoiceId.Text = "Created invoice with id: " + invoice.Id; output("Invoice with Id " + invoice.Id + " created"); } catch (Exception ex) { output(ex.Message); } }
/// <summary> /// Call Create expense from QBOApp /// </summary> /// <param name="context"></param> /// <returns></returns> public void CreateExpenseCall(ServiceContext context) { try { DataService dataService = new DataService(context); QueryService <Account> queryService = new QueryService <Account>(context); customer = QBOApp.CustomerCreate(dataService); Purchase purchase = QBOApp.BillableExpenseCreate(dataService, queryService, customer); output("QBO Expense call successful."); lblQBOCall.Visible = true; lblQBOCall.Text = "Created expense with id: " + purchase.Id; output("Expense with Id " + purchase.Id + " created"); } catch (Exception ex) { output(ex.Message); } }