/***************************
         * Price Convert
         * *************************/
        public static priceBusiness toPriceBusiness(Price lePrice)
        {
            priceBusiness lePriceBusiness = new priceBusiness()
            {

                Skittle_price = lePrice.Skittles_cost,
                cottoncandy_price = lePrice.cottoncandy_cost,
                creamegg_price = lePrice.creamegg_cost,
                jawbreaker_price = lePrice.jawbreaker_cost,
                redvinelicornes_price = lePrice.redvinelicornes_cost,
                sugardaddy_price = lePrice.sugardaddy_cost
            };
            return lePriceBusiness;
        }
        public static Price toPrice(priceBusiness lePrice)
        {
            Price lePriceData = new Price()
            {
                Skittles_cost = lePrice.Skittle_price,
                cottoncandy_cost = lePrice.cottoncandy_price,
                creamegg_cost = lePrice.creamegg_price,
                jawbreaker_cost = lePrice.jawbreaker_price,
                redvinelicornes_cost = lePrice.redvinelicornes_price,
                sugardaddy_cost = lePrice.sugardaddy_price
            };

            return lePriceData;
        }
Esempio n. 3
0
        public bool setPrice(Price lePrice)
        {
            if (monEntity.Price.SingleOrDefault(c => c.Id == 1) != null)
            {
                monEntity.Price.SingleOrDefault(c => c.Id == 1).jawbreaker_cost = lePrice.jawbreaker_cost;
                monEntity.Price.SingleOrDefault(c => c.Id == 1).redvinelicornes_cost = lePrice.redvinelicornes_cost;
                monEntity.Price.SingleOrDefault(c => c.Id == 1).Skittles_cost = lePrice.Skittles_cost;
                monEntity.Price.SingleOrDefault(c => c.Id == 1).sugardaddy_cost = lePrice.sugardaddy_cost;
                monEntity.Price.SingleOrDefault(c => c.Id == 1).cottoncandy_cost = lePrice.cottoncandy_cost;
                monEntity.Price.SingleOrDefault(c => c.Id == 1).creamegg_cost = lePrice.creamegg_cost;

                monEntity.SaveChanges();
                return true;
            }
            else
                return false;
        }
Esempio n. 4
0
 /*********************
  * Price
  * ********************/
 public Price getPrice()
 {
     Price actualprice = new Price();
     return actualprice = monEntity.Price.SingleOrDefault(c => c.Id == 1);
 }