Example #1
0
  private void checkSelectedRoom(ScheduledHeatingRoom schdRoom)
 {
     switch (metroComboBox1.SelectedIndex)
          {
              case (int)RoomType.BathRoom:
                  {
                      schdRoom.Room = RoomType.BathRoom;
                      break;
                  }
              case (int)RoomType.BedRoom:
                  {
                      schdRoom.Room = RoomType.BedRoom;
                      break;
                  }
              case (int)RoomType.DiningRoom:
                  {
                      schdRoom.Room = RoomType.DiningRoom;
                      break;
                  }
              case (int)RoomType.Kichen:
                  {
                      schdRoom.Room = RoomType.Kichen;
                      break;
                  }
              case (int)RoomType.KidsRoom:
                  {
                      schdRoom.Room = RoomType.KidsRoom;
                      break;
                  }
              case (int)RoomType.LivingRoom:
                  {
                      schdRoom.Room = RoomType.LivingRoom;
                      break;
                  }
          }
 }
Example #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {

            if (isEdit)
            {
                Scheduled.scheduledHeatingRooms[idEditRoom].From = new DateTime(2010, 10, 10, dateTimePicker1.Value.Hour, dateTimePicker1.Value.Minute, 0);
                Scheduled.scheduledHeatingRooms[idEditRoom].To = new DateTime(2010, 10, 10, dateTimePicker2.Value.Hour, dateTimePicker2.Value.Minute, 0);
                Scheduled.scheduledHeatingRooms[idEditRoom].Value = Convert.ToInt32(textBox1.Text.Substring(0, 2));
                checkSelectedRoom(Scheduled.scheduledHeatingRooms[idEditRoom]);
            }
            else
            {
                ScheduledHeatingRoom schdRoom = new ScheduledHeatingRoom()
                {
                    Value = Convert.ToInt32(textBox1.Text.Substring(0, 2)),
                    From = new DateTime(2010,10,10,dateTimePicker1.Value.Hour,dateTimePicker1.Value.Minute,0),
                    To = new DateTime(2010,10,10,dateTimePicker2.Value.Hour,dateTimePicker2.Value.Minute,0),
                    Day = setToDay,
                    IsActive = true
                };
                checkSelectedRoom(schdRoom);
                Scheduled.scheduledHeatingRooms.Add(schdRoom);
            }
            this.Close();
        }
Example #3
0
        private void checkScheduledRoomAndSetValues(ScheduledHeatingRoom room)
        {
            switch(room.Room)
            {
                case RoomType.LivingRoom:
                    {
                        metroScrollLiving.Enabled = true;
                        metroScrollLiving.Value = room.Value;
                        livRoomValue.Text = room.Value.ToString() +" °C";
                        LivingRoomToggle.Checked = true;
                        LivingRoomToggle_CheckStateChanged(null, null);
                        break;
                    }
                case RoomType.BathRoom:
                    {

                        metroScrollBathroom.Enabled = true;
                        metroScrollBathroom.Value = room.Value;
                        bathRoomValue.Text = room.Value.ToString() + " °C";
                        metroToggleBathroom.Checked = true;
                        metroToggleBathroom_CheckStateChanged(null, null);
                        break;
                    }
                case RoomType.DiningRoom:
                    {
                        metroScrollDiningRoom.Enabled = true;
                        metroScrollDiningRoom.Value = room.Value;
                        diningRoomValue.Text = room.Value.ToString() + " °C";
                        metroToggleDiningRoom.Checked = true;
                        metroToggleDiningRoom_CheckStateChanged(null, null);
                       break;
                    }
                case RoomType.KidsRoom:
                    {
                        metroScrollKidsBedRoom.Enabled = true;
                        metroScrollKidsBedRoom.Value = room.Value;
                        kidsRoomValue.Text = room.Value.ToString() + " °C";
                        metroToggleKidsBedRoom.Checked = true;
                        metroToggleKidsBedRoom_CheckStateChanged(null, null);
                         break;
                    }
                case RoomType.Kichen:
                    {
                        metroScrollKichen.Enabled = true;
                        metroScrollKichen.Value = room.Value;
                        kitchenValue.Text = room.Value.ToString() + " °C";
                        KichenToggle.Checked = true;
                        KichenToggle_CheckStateChanged(null, null);
                        break;
                    }
                case RoomType.BedRoom:
                    {
                        metroScrollBedRoom.Enabled = true;
                        metroScrollBedRoom.Value = room.Value;
                        bedRoomValue.Text = room.Value.ToString() + " °C";
                        metroToggleBedRoom.Checked = true;
                        metroToggleBedRoom_CheckStateChanged_1(null, null);
                        break;
                    }
            }

        }