Beispiel #1
0
        private void checkScheduledRoomAndSetValues(ScheduledCoolingRoom room)
        {
            switch (room.Room)
            {
                case RoomType.LivingRoom:
                    {
                        btnOnOffLiving.Checked = room.IsActive;
                        lmhLivingRoom.SetValue(room.Value);
                        break;
                    }
                case RoomType.BathRoom:
                    {

                        btnOnOffBath.Checked = room.IsActive;
                        lmhBath.SetValue(room.Value);
                        break;
                    }
                case RoomType.DiningRoom:
                    {
                        btnOnOffDinning.Checked = room.IsActive;
                        lmhDining.SetValue(room.Value);
                        break;
                    }
                case RoomType.KidsRoom:
                    {
                        btnOnOffKids.Checked = room.IsActive;
                        lmhKids.SetValue(room.Value);
                        break;
                    }
                case RoomType.Kichen:
                    {
                        btnOnOffKichen.Checked = room.IsActive;
                        lmhKichen.SetValue(room.Value);
                        break;
                    }
                case RoomType.BedRoom:
                    {
                        btnOnOffBed.Checked = room.IsActive;
                        lmhBed.SetValue(room.Value);
                        break;
                    }
            }
        }
Beispiel #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {

            if (isEdit)
            {
                Scheduled.scheduledCoolingRooms[idEditRoom].From = new DateTime(2010,10,10,dateTimePicker1.Value.Hour,dateTimePicker1.Value.Minute,0);
                Scheduled.scheduledCoolingRooms[idEditRoom].To = new DateTime(2010, 10, 10, dateTimePicker2.Value.Hour, dateTimePicker2.Value.Minute, 0);
                Scheduled.scheduledCoolingRooms[idEditRoom].Value = (LMH)comboValue.SelectedIndex;
                Scheduled.scheduledCoolingRooms[idEditRoom].Room = (RoomType)comboRoom.SelectedIndex;
            }
            else
            {
                ScheduledCoolingRoom schdRoom = new ScheduledCoolingRoom()
                {
                    Value = (LMH)comboValue.SelectedIndex,
                    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,
                    Room = (RoomType)comboRoom.SelectedIndex
                };
                Scheduled.scheduledCoolingRooms.Add(schdRoom);
            }
            this.Close();
        }