static void AddMuscleGroup(string name) { using (var db = new GymTrackerContext()) { var newMuscleGroup = new MuscleGroup() { MuscleGroupName = name }; db.MuscleGroups.Add(newMuscleGroup); db.SaveChanges(); } }
static void AddUser(string name) { using (var db = new GymTrackerContext()) { var newUser = new User() { UserName = name }; db.Users.Add(newUser); db.SaveChanges(); } }
static void AddSession(int user, int exersice, string date) { using (var db = new GymTrackerContext()) { var newSession = new Session() { ExerciseId = exersice, }; db.Sessions.Add(newSession); db.SaveChanges(); } }
static void AddExersice(string name, int muslegroupid) { using (var db = new GymTrackerContext()) { var newExersice = new Exercise() { ExerciseName = name, MuscleGroupId = muslegroupid }; db.Exercises.Add(newExersice); db.SaveChanges(); } }
static void AddSets(int sessionid, int setnumber, int numofreps, int weight) { using (var db = new GymTrackerContext()) { var newSet = new Set() { SessionId = sessionid, SetNumber = setnumber, NumberofReps = numofreps, Weight = weight }; db.Sets.Add(newSet); db.SaveChanges(); } }