Example #1
0
        public ItemOptions(IBtwTypeData btwTypeData, ICatagoryData catagoryData, IStationData stationData)
        {
            /*
             * IBtwTypeData btwTypeData = DependencyResolver.Current.GetService<IBtwTypeData>();
             * ICatagoryData catagoryData = DependencyResolver.Current.GetService<ICatagoryData>();
             * IStationData stationData = DependencyResolver.Current.GetService<IStationData>();
             */

            BtwTypes   = btwTypeData.GetAll();
            Catagories = catagoryData.GetAll();
            Stations   = stationData.GetAll();
        }
Example #2
0
 public ItemEdit(IBtwTypeData btwTypeData, ICatagoryData catagoryData, IStationData stationData, Item itemToEdit = null)
 {
     if (itemToEdit == null)
     {
         ActiveItem = new Item();
     }
     else
     {
         ActiveItem = itemToEdit;
     }
     Options = new ItemOptions(btwTypeData, catagoryData, stationData);
 }
Example #3
0
        public ItemDetails(IBtwTypeData btwTypeData, ICatagoryData catagoryData, IItemData itemData)
        {
            /*
             * IItemData itemData = DependencyResolver.Current.GetService<IItemData>();
             */

            IEnumerable <Item> items = itemData.GetAll();

            List <ItemDetail> newItems = new List <ItemDetail>();

            foreach (Item item in items)
            {
                newItems.Add(new ItemDetail(btwTypeData, catagoryData, itemData, item.Id));
            }
            Items = newItems;
        }
        public ReservationChangeItems(ICatagoryData catagoryData, IItemData itemData, IReservationItemData reservationItemData, int reservationId)
        {
            ReservationId    = reservationId;
            ReservationItems = reservationItemData.Get(reservationId);
            IEnumerable <Catagory> catagories          = catagoryData.GetAll();
            List <ItemsInCatagory> newItemsPerCatagory = new List <ItemsInCatagory>();

            foreach (Catagory catagory in catagories)
            {
                ItemsInCatagory newItemsInCatory = new ItemsInCatagory(catagoryData, itemData, catagory.Id);
                if (newItemsInCatory.Items.Count() > 0)
                {
                    newItemsPerCatagory.Add(newItemsInCatory);
                }
            }
            ItemsPerCatagory = newItemsPerCatagory;
        }
Example #5
0
        public ItemDetail(IBtwTypeData btwTypeData, ICatagoryData catagoryData, IItemData itemData, int itemId)
        {
            /*
             * IBtwTypeData btwTypeData = DependencyResolver.Current.GetService<IBtwTypeData>();
             * ICatagoryData catagoryData = DependencyResolver.Current.GetService<ICatagoryData>();
             * IItemData itemData = DependencyResolver.Current.GetService<IItemData>();
             */

            Item item = itemData.Get(itemId);

            Id            = itemId;
            Name          = item.Name;
            Description   = item.Description;
            Price         = item.Price;
            BtwPercentage = btwTypeData.Get(item.BtwTypeId).Percentage;
            CatagoryName  = catagoryData.Get(item.CatagoryId).Name;
            Available     = item.Available;
        }
Example #6
0
 public ItemsInCatagory(ICatagoryData catagoryData, IItemData itemData, int catagoryId)
 {
     CatagoryName = catagoryData.Get(catagoryId).Name;
     Items        = itemData.GetAll().Where(i => i.CatagoryId == catagoryId);
 }