Exemple #1
0
        public Beam(int len, int qty) : base(len, qty)
        {
            length   = len;
            quantity = qty;

            if (beamNum == 2)
            {
                beamNum = 0;
            }

            // Getting stock reference by dimension

            switch (qty)
            {
            case 2:
                stockRef = Oledb.SqlRequest("SELECT Référence FROM Piece WHERE Référence LIKE 'TRR%' AND largeur = " + len.ToString());
                break;

            case 4:
                stockRef = Oledb.SqlRequest("SELECT Référence FROM Piece WHERE Référence LIKE 'TRG%' AND profondeur = " + len.ToString());
                break;
            }

            beamNum++;
            beamNumber = beamNum;

            // Update reservation in the data base
            Oledb.UpdateReservation(quantity, stockRef);
            SetPrice();

            stock = Oledb.GetDBStock(stockRef);
        }
Exemple #2
0
        public Knop(int qty)
        {
            // Getting stock reference for the knop
            stockRef = Oledb.SqlRequest("SELECT Référence FROM Piece WHERE Référence LIKE 'COUP%' ");

            // Getting knop's price
            price = Oledb.GetDBPrice(stockRef);

            stock    = Oledb.GetDBStock(stockRef);
            quantity = qty;

            // Update reservation in the data base
            Oledb.UpdateReservation(quantity, stockRef);
        }
Exemple #3
0
        public Angle(int len, string color, int qty)
        {
            Oledb.Connection();
            length     = len;
            angleColor = color;
            // Getting the stock reference by the length and color
            stockRef = Oledb.SqlRequest("SELECT Référence FROM Piece WHERE Référence LIKE 'COR%' AND hauteur = " + length.ToString() + " AND Couleur = '" + angleColor + "'");
            quantity = qty;
            CalculPrice();

            // Updating the reservation in the data base
            Oledb.UpdateReservation(quantity, stockRef);

            stock = Oledb.GetDBStock(stockRef);
        }
 protected void SetStock()
 {
     stock = Oledb.GetDBStock(stockRef);
 }