Example #1
0
 public void Insert(User user)
 {
     using (SQLiteDBContext dbConnection = this.OpenConnection())
     {
         dbConnection.User.Add(user);
         dbConnection.SaveChanges();
     }
 }
 public void InsertActivity(Activity activity)
 {
     using (SQLiteDBContext dbConnection = this.OpenConnection())
     {
         dbConnection.Activity.Add(activity);
         dbConnection.SaveChanges();
     }
 }
 public void Insert(Customer customer)
 {
     using (SQLiteDBContext dbConnection = this.OpenConnection())
     {
         dbConnection.Customer.Add(customer);
         dbConnection.SaveChanges();
     }
 }
Example #4
0
 public void Log(LogType logType, string message)
 {
     using (SQLiteDBContext dbConnection = this.OpenConnection())
     {
         Log newLog = new Log();
         newLog.Type      = logType;
         newLog.Message   = message;
         newLog.Timestamp = DateTime.UtcNow.Ticks;
         dbConnection.Log.Add(newLog);
         dbConnection.SaveChanges();
     }
 }
Example #5
0
        public void Log(LogType type, string message)
        {
            using (SQLiteDBContext dbConnection = this.OpenConnection())
            {
                Log tempLog = null;

                tempLog.Message   = message;
                tempLog.Type      = type;
                tempLog.Timestamp = DateTime.UtcNow.Ticks;

                dbConnection.Log.Add(tempLog);
                dbConnection.SaveChanges();

                //dbConnection.Execute("INSERT INTO Log (Type, Message, Timestamp) VALUES(@Type, @Message, @Timestamp)", new { Type = type, Message = message, Timestamp = DateTime.UtcNow.Ticks });
            }
        }