Example #1
0
 public static void WriteControlMatrix(DBProvider dBProvider)
 {
     using (var uow = dBProvider.GetRaspperyUnitOwWork()) {
         var oldValues = new XPQuery <ControlValue>(uow).ToList();
         oldValues.ForEach(v => v.Delete());
         uow.CommitChanges();
         for (int indoor = IndoorLover; indoor <= IndoorHight; indoor++)
         {
             for (int outdoor = OutdoorLover; outdoor <= OutdoorHight; outdoor++)
             {
                 //for(int sun = SunLover; sun <= SunHihg; sun++) {
                 //    for(int wind = WindLover; wind <= WindHigh; wind++) {
                 new ControlValue(uow)
                 {
                     Boiler  = CalcBoilerValue(indoor, outdoor, SunLover, WindLover),
                     Indoor  = indoor,
                     Outdoor = outdoor,
                     Sun     = SunLover,
                     Wind    = WindLover
                 };
                 // }
                 //}
             }
         }
         uow.CommitChanges();
     }
 }
        public void Cleanup()
        {
            var yearProjects = new XPQuery <YearProject>(Session.DefaultSession);

            yearProjects.ForEach(y => y.Delete());

            var projects = new XPQuery <Project>(Session.DefaultSession);

            projects.ForEach(p => p.Delete());
        }
Example #3
0
 public static void WriteSettings(DBProvider dBProvider)
 {
     using (var uow = dBProvider.GetRaspperyUnitOwWork()) {
         var oldValues = new XPQuery <SettingValue>(uow).ToList();
         oldValues.ForEach(v => v.Delete());
         uow.CommitChanges();
         for (int day = 1; day <= 7; day++)
         {
             for (int hour = 0; hour <= 23; hour++)
             {
                 new SettingValue(uow)
                 {
                     WeekDay     = day,
                     Hour        = hour,
                     Temperature = 20
                 };
             }
         }
         uow.CommitChanges();
     }
 }