//adding category
 public void AddCategory(workout_category item)
 {
     try
     {
         CasestudyEntities db = new CasestudyEntities();
         db.workout_category.Add(item);
         db.SaveChanges();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #2
0
        public workout_category Get(int id)
        {
            workout_category objWork = null;

            try
            {
                WorkoutAppEntities db = new WorkoutAppEntities();
                objWork = (from obj in db.workout_category
                           where obj.category_id == id
                           select obj).First();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objWork);
        }
예제 #3
0
        public void EditCategory(workout_category item)
        {
            try
            {
                WorkoutAppEntities db = new WorkoutAppEntities();
                var ObjCategory       = (from obj in db.workout_category
                                         where obj.category_id == item.category_id
                                         select obj).First();

                ObjCategory.category_name = item.category_name;
                db.SaveChanges();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }