예제 #1
0
 public void AddCategory(workoutcategory objcategory)
 {
     try
     {
         using (var objcontext = new WorkoutSPAEntities())
         {
             objcontext.workoutcategories.Add(objcategory);
             objcontext.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #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;
     }
 }