Beispiel #1
0
 private void cmbProduct_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         DBConnector conn = new DBConnector(Classes.DBMethod.GetConnectionString());
         RosieEntity.Connector = conn;
         EventProduct product = EventProduct.Retrieve(short.Parse(DBMethod.GetSelectedItemID(cmbProduct)));
         ndpQuanitity.Maximum = product.Quantity - product.SoldQuantity;
         //
         conn = new DBConnector(Classes.DBMethod.GetConnectionString());
         RosieEntity.Connector = conn;
         Production production = Production.Retrieve(product.ProductionId);
         //
         conn = new DBConnector(Classes.DBMethod.GetConnectionString());
         RosieEntity.Connector = conn;
         ProductItem productItem = ProductItem.Retrieve(production.ProductItemID);
         lblItemPrice.Text  = productItem.Price.ToString("C");
         ndpQuanitity.Value = 1;
     }
     catch (Exception ex)
     { }
 }