Exemplo n.º 1
0
 public static bool insertPO_Product(APCEntities APCContext, PO po, Category category, string description, int quantity, decimal price, decimal serviceCharge, decimal totalPrice, bool subcon)
 {
     PO_Product po_product = new PO_Product();
     po_product.PO = po;
     po_product.Category = category;
     po_product.Description = description;
     po_product.Quantity = quantity;
     po_product.Price = price;
     po_product.ServiceCharge = serviceCharge;
     po_product.PriceTotal = totalPrice;
     po_product.SubCon = subcon;
     APCContext.AddToPO_Product(po_product);
     APCContext.SaveChanges();
     return true;
 }
Exemplo n.º 2
0
        public static bool insertPO_Product(APCEntities APCContext, PO po, Category category, string description, int quantity, decimal price, decimal serviceCharge, decimal totalPrice, bool subcon)
        {
            PO_Product po_product = new PO_Product();

            po_product.PO            = po;
            po_product.Category      = category;
            po_product.Description   = description;
            po_product.Quantity      = quantity;
            po_product.Price         = price;
            po_product.ServiceCharge = serviceCharge;
            po_product.PriceTotal    = totalPrice;
            po_product.SubCon        = subcon;
            APCContext.AddToPO_Product(po_product);
            APCContext.SaveChanges();
            return(true);
        }
Exemplo n.º 3
0
        private void deletePO_Product(PO po)
        {
            List <PO_Product> poProductList = BLPO_Product.GetPO_ProductByPOId(APCContext, po.Id);

            for (int i = 0; i < poProductList.Count(); i++)
            {
                int poProductId = 0;
                int.TryParse(poProductList[i].Id.ToString(), out poProductId);
                PO_Product currentPO_Product = BLPO_Product.GetPO_ProductById(APCContext, poProductId);
                if (currentPO_Product != null)
                {
                    APCContext.DeleteObject(currentPO_Product);
                    APCContext.SaveChanges();
                }
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// There are no comments for PO_Product in the schema.
 /// </summary>
 public void AddToPO_Product(PO_Product pO_Product)
 {
     base.AddObject("PO_Product", pO_Product);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Create a new PO_Product object.
 /// </summary>
 /// <param name="id">Initial value of Id.</param>
 public static PO_Product CreatePO_Product(int id)
 {
     PO_Product pO_Product = new PO_Product();
     pO_Product.Id = id;
     return pO_Product;
 }