Example #1
0
 partial void Deletetimezones_t(timezones_t instance);
Example #2
0
 partial void Inserttimezones_t(timezones_t instance);
Example #3
0
 partial void Updatetimezones_t(timezones_t instance);
Example #4
0
 public void InsertNewTimeZone(string timeZoneName, TimeSpan startTime, TimeSpan endTime)
 {
     var db = new dbDataContext();
     lock (db)
     {
         Table<timezones_t> timeZonesT = db.GetTable<timezones_t>();
         var timezones = new timezones_t
         {
             timezone_name = timeZoneName,
             timezone_start = startTime,
             timezone_end = endTime
         };
         try
         {
             timeZonesT.InsertOnSubmit(timezones);
             db.SubmitChanges();
     //                    RefreshTable();
         }
         catch (Exception)
         {
             MessageBox.Show(ErrorsAndWarningsMessages.ErrorsAndWarningsInstance().GetError(5));
         }
         try
         {
             var playstations = GetAllTables();
             foreach (tables_t t in playstations)
             {
                 Table<playstation_timezone> timeZoneTable = db.GetTable<playstation_timezone>();
                 var playstationTimezone = new playstation_timezone
                 {
                     playstation_id = t.playstation_id,
                     timezone_name = timeZoneName,
                     timezone_cost_per_hour = 0
                 };
                 timeZoneTable.InsertOnSubmit(playstationTimezone);
                 db.SubmitChanges();
             }
         }
         catch (Exception)
         {
             MessageBox.Show(ErrorsAndWarningsMessages.ErrorsAndWarningsInstance().GetError(7));
         }
     }
 }