public static bool insertInvoicePO(APCEntities APCContext, Invoice invoice, PO po) { try { Invoice_PO invoicePO = new Invoice_PO(); invoicePO.Invoice = invoice; invoicePO.PO = po; APCContext.AddToInvoice_PO(invoicePO); po.Invoiced = true; APCContext.SaveChanges(); return(true); } catch (Exception e) { return(false); } }
private bool DeleteInvoicePO(Invoice selectedInvoice) { bool success = true; List <Invoice_PO> invoicePOList = BLInvoice.GetListInvoicePOByInvoiceId(APCContext, selectedInvoice.Id); if (invoicePOList != null) { for (int i = 0; i < invoicePOList.Count; i++) { PO selectedPO = invoicePOList[i].PO; selectedPO.Invoiced = false; Invoice_PO currentInvoicePO = BLInvoice.GetInvoicePOByInvoiceIdAndPOId(APCContext, selectedInvoice.Id, selectedPO.Id); APCContext.DeleteObject(currentInvoicePO); APCContext.SaveChanges(); } } return(success); }
public static bool insertInvoicePO(APCEntities APCContext, Invoice invoice, PO po) { try { Invoice_PO invoicePO = new Invoice_PO(); invoicePO.Invoice = invoice; invoicePO.PO = po; APCContext.AddToInvoice_PO(invoicePO); po.Invoiced = true; APCContext.SaveChanges(); return true; } catch(Exception e) { return false; } }
/// <summary> /// Create a new Invoice_PO object. /// </summary> /// <param name="id">Initial value of Id.</param> public static Invoice_PO CreateInvoice_PO(int id) { Invoice_PO invoice_PO = new Invoice_PO(); invoice_PO.Id = id; return invoice_PO; }
/// <summary> /// There are no comments for Invoice_PO in the schema. /// </summary> public void AddToInvoice_PO(Invoice_PO invoice_PO) { base.AddObject("Invoice_PO", invoice_PO); }