Example #1
0
 public void AddCategory(workoutcategory objcategory)
 {
     try
     {
         using (var objcontext = new WorkoutSPAEntities())
         {
             objcontext.workoutcategories.Add(objcategory);
             objcontext.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #2
0
 public void EditCategory(workoutcategory item)
 {
     try
     {
         using (WorkoutSPAEntities objContext = new WorkoutSPAEntities())
         {
             var objcategory = (from obj in objContext.workoutcategories
                                where obj.categoryid == item.categoryid
                                select obj).First();
             objcategory.categoryname = item.categoryname;
             objContext.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }