Exemplo n.º 1
0
 protected void btnAgregar_Click(object sender, EventArgs e)
 {
     if (txtProducto.Text.Length > 0 && txtCant.Text.Length > 0)
     {
         try
         {
             p = products.FetchProduct(txtProducto.Text);
             int disponibles = new InventoryDataHandler().RetrieveStocks(p);
             if (disponibles >= int.Parse(txtCant.Text))
             {
                 ItemEntry entry = new ItemEntry(p, int.Parse(txtCant.Text));
                 venta.AddItem(entry);
                 venta.montoTotal += entry.monto;
                 venta.productos  += entry.cantidad;
                 Session["Venta"]  = venta;
                 UpdateGrid();
             }
             else
             {
                 //Alertar existencias insuficientes
             }
         } catch (Exception ex)
         {
             Debug.Write(ex.Message);
         }
     }
 }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     products = new ProductsDataHandler();
     stocks   = new InventoryDataHandler();
     ddProductos.Items.Clear();
     foreach (DataRow producto in products.FetchProducts().Rows)
     {
         ddProductos.Items.Add(new ListItem(producto["Nombre"].ToString(), producto["SKU"].ToString()));
     }
 }
Exemplo n.º 3
0
 void Start()
 {
     inventoryDataHandler = GetComponent <InventoryDataHandler>();
     EventBroker.Instance().SubscribeMessage <MessageUpCycleClothes>(UpCycleWearable);
 }