Esempio n. 1
0
 public long AddTRKLogs(TRKLogs TRKLogs)
 {
     try
     {
         TRKLogs new_TRKLogs = new TRKLogs()
         {
             ID       = 0,
             DateTime = TRKLogs.DateTime,
             UserName = TRKLogs.UserName,
             Level    = TRKLogs.Level,
             Log      = TRKLogs.Log
         };
         context.TRKLogs.Add(new_TRKLogs);
         context.SaveChanges();
         return(new_TRKLogs.ID);
     }
     catch (Exception e)
     {
         String.Format("Ошибка выполнения метода AddTRKLogs(TRKLogs={0})", TRKLogs).SaveError(e);
         return(-1);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Добавить карту
 /// </summary>
 /// <param name="num_trk"></param>
 /// <param name="side"></param>
 /// <param name="id_card"></param>
 /// <param name="id_hi"></param>
 /// <param name="id_lo"></param>
 /// <returns></returns>
 public int AddOPC_RFID(int num_trk, bool side, int?id_card, int id_hi, int id_lo)
 {
     try
     {
         OPC_RFID new_opc_rfid = new OPC_RFID()
         {
             id       = 0,
             datetime = DateTime.Now,
             num_trk  = num_trk,
             side     = side,
             id_card  = id_card,
             id_hi    = id_hi,
             id_lo    = id_lo
         };
         context.OPC_RFID.Add(new_opc_rfid);
         context.SaveChanges();
         return(new_opc_rfid.id);
     }
     catch (Exception e)
     {
         String.Format("Ошибка выполнения метода AddOPC_RFID(num_trk={0}, side={1}, id_card={2}, id_hi={3}, id_lo={4})", num_trk, side, id_card, id_hi, id_lo).SaveError(e);
         return(-1);
     }
 }