예제 #1
0
 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);
     }
 }
예제 #2
0
        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);
        }
예제 #3
0
 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;
     }
 }
예제 #4
0
 /// <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;
 }
예제 #5
0
 /// <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);
 }