Exemple #1
0
 public void AddCollection(workout_collection item)
 {
     try
     {
         WorkoutAppEntities db = new WorkoutAppEntities();
         db.workout_collection.Add(item);
         db.SaveChanges();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #2
0
        public void EditCategory(workout_collection item)
        {
            try
            {
                WorkoutAppEntities db = new WorkoutAppEntities();
                var ObjCategory       = (from obj in db.workout_collection
                                         where obj.workout_id == item.workout_id
                                         select obj).First();

                ObjCategory.workout_title         = item.workout_title;
                ObjCategory.workout_note          = item.workout_note;
                ObjCategory.calories_burn_per_min = item.calories_burn_per_min;
                ObjCategory.category_id           = item.category_id;
                db.SaveChanges();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }