Пример #1
0
 public static void InsertState(string state)
 {
     BlackTD0DataContext blackTD0 = new BlackTD0DataContext();
     if (!blackTD0.STATEs.Any(p => p.MSTATE == state))
     {
         STATE tmps = new STATE();
         if (blackTD0.STATEs.Count() > 0) tmps.SNO = blackTD0.STATEs.Max(p => p.SNO) + 1;
         else tmps.SNO = 0;
         tmps.MSTATE = state;
         blackTD0.STATEs.InsertOnSubmit(tmps);
         blackTD0.SubmitChanges();
     }
 }
Пример #2
0
 public static void InsertState(string state)
 {
     WhiteQlearningDataContext whiteQlearning = new WhiteQlearningDataContext();
     if (!whiteQlearning.STATEs.Any(p => p.MSTATE == state))
     {
         STATE tmps = new STATE();
         if (whiteQlearning.STATEs.Count() > 0) tmps.SNO = whiteQlearning.STATEs.Max(p => p.SNO) + 1;
         else tmps.SNO = 0;
         tmps.MSTATE = state;
         whiteQlearning.STATEs.InsertOnSubmit(tmps);
         whiteQlearning.SubmitChanges();
     }
 }
 partial void UpdateSTATE(STATE instance);
 partial void DeleteSTATE(STATE instance);
 partial void InsertSTATE(STATE instance);