Ejemplo n.º 1
0
        public Table(FurnitureTypes type, Grid grid)
        {
            this.Type = type;
            _grid     = grid;
            FurnitureSetupWindow box = new FurnitureSetupWindow();

            while ((bool)box.ShowDialog(GetDialogResult))
            {
                ;
            }
        }
Ejemplo n.º 2
0
        public BookShelf(FurnitureTypes type, Grid grid)
        {
            this.Type = type;
            _grid     = grid;
            FurnitureSetupWindow box = new FurnitureSetupWindow();

            box.txtHeight.IsEnabled = false;
            while ((bool)box.ShowDialog(GetDialogResult))
            {
                ;
            }
        }
        public Recliner(FurnitureTypes type, Grid grid)
        {
            this.Type = type;
            _grid     = grid;
            FurnitureSetupWindow box = new FurnitureSetupWindow();

            box.txtLength.IsEnabled = false;
            while ((bool)box.ShowDialog(GetDialogResult))
            {
                ;
            }
        }
Ejemplo n.º 4
0
        private void FillWithData()
        {
            foreach (var item in new UserDAO().GetAll())
            {
                Users.Add(item);
            }


            foreach (var item in new SaleDAO().GetAll())
            {
                Sales.Add(item);
            }


            foreach (var item in new FurnitureTypeDAO().GetAll())
            {
                FurnitureTypes.Add(item);
            }


            foreach (var item in new FurnitureDAO().GetAll())
            {
                Furniture.Add(item);
            }


            foreach (var item in new AdditionalServiceDAO().GetAll())
            {
                AdditionalServices.Add(item);
            }

            foreach (var item in new ActionSaleDAO().GetAll())
            {
                ActionSales.Add(item);
            }
        }
        public void UpdateUI(IFurniture furniture, FurnitureTypes furnitureType)
        {
            Image img = new Image();

            img.Width      = furniture.Width;
            img.Height     = furniture.Height;
            img.Visibility = Visibility.Visible;
            img.Margin     = new Thickness(furniture.X, furniture.Y, 0, 0);
            //img.Stretch = Stretch.Fill;
            img.Stretch = Stretch.Fill;

            furniture.Img = img;


            objects = room.GetFurniture();

            switch (furnitureType)
            {
            case FurnitureTypes.Bed:
                img.Source = new BitmapImage(new Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\Images\Bed2.png"));
                break;

            case FurnitureTypes.Bed2:
                img.Source = new BitmapImage(new Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\Images\Bed2.png"));
                break;

            case FurnitureTypes.BookShelf:
                img.Source = new BitmapImage(new Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\Images\BookShelf.png"));
                break;

            case FurnitureTypes.Couch:
                img.Source = new BitmapImage(new Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\Images\Couch.png"));
                break;

            case FurnitureTypes.DeskChair:
                img.Source = new BitmapImage(new Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\Images\DeskChair.png"));
                break;

            case FurnitureTypes.Dresser:
                img.Source = new BitmapImage(new Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\Images\Dresser.png"));
                break;

            case FurnitureTypes.Recliner:
                img.Source = new BitmapImage(new Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\Images\Recliner.png"));
                break;

            case FurnitureTypes.Rug:
                img.Source = new BitmapImage(new Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\Images\Rug.png"));
                break;

            case FurnitureTypes.Sofa:
                img.Source = new BitmapImage(new Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\Images\Sofa.png"));
                break;

            case FurnitureTypes.Stove:
                img.Source = new BitmapImage(new Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\Images\Stove.png"));
                break;

            case FurnitureTypes.Table:
                img.Source = new BitmapImage(new Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\Images\Table.png"));
                break;

            case FurnitureTypes.TVStand:
                img.Source = new BitmapImage(new Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\Images\TVStand.png"));
                break;
            }
            this.Grid.Children.Add(furniture.Img);
        }