public void CreateRoom()
 {
     Model.Room room = new Model.Room(int.Parse(lbuID.Content.ToString()), tbuDescription.Text,
                                      int.Parse(lbuFloor.Content.ToString()), double.Parse(lbArea.Content.ToString()),
                                      (Model.RoomType)Enum.Parse(typeof(Model.RoomType), cbRoomType.Text));
     roomController.CreateRoom(room);
 }
Exemplo n.º 2
0
        internal void AddRoom()
        {
            Console.Write("Please provide a room represent name(x.x.x)(1.1.15): ");
            var roomNo = Console.ReadLine();

            while (!Validate.ValidRoomName(roomNo))
            {
                Console.WriteLine("Room name only allows digit at 'x' tight to format(x.x.x).Enter: ");
                roomNo = Console.ReadLine();
            }
            bool added = roomController.CreateRoom(roomNo);

            if (added)
            {
                Console.WriteLine("Congratulation! You added a new \"{0}\" room.", roomNo);
            }
            else
            {
                Console.WriteLine("Sorry! You failed to add a room \"{0}\"", roomNo);
            }
            Console.WriteLine("Press any key to continue...");
            Console.ReadLine();
        }
        private void CreateRoom()
        {
            Model.Room room = new Model.Room(int.Parse(lbuID.Content.ToString()), tbuDescription.Text, int.Parse(lbuFloor.Content.ToString()),
                                             double.Parse(tbuArea.Text), (Model.RoomType)Enum.Parse(typeof(Model.RoomType), cbRoomType.Text));
            if (room.Area > double.Parse(renovationSeparation.lbArea.Content.ToString()))
            {
                MessageBox.Show("Površina ne može biti veća od " + renovationSeparation.lbArea.Content.ToString());
            }
            else
            {
                roomController.CreateRoom(room);
                renovationSeparation.lvDataBindingRooms.Items.Add(room);
                ChangeArea();
                moveStaticEquipment();
                addRenovation();
                renovationSeparation.Show();

                this.Close();
            }
        }