Пример #1
0
 public void AddCategory(WorkOut_Category item)
 {
     try
     {
         WorkoutDBEntities db = new WorkoutDBEntities();
         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
            {
                WorkoutDBEntities db = new WorkoutDBEntities();
                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
            {
                WorkoutDBEntities db = new WorkoutDBEntities();
                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;
            }
        }