Esempio n. 1
0
 //get GoalsbyId
 public Goals GetGoalsById(int goalId)
 {
     try
     {
         Goals goals = db.Goals.Find(goalId);
         return(goals);
     }
     catch
     {
         throw;
     }
 }
Esempio n. 2
0
 //edit Goals
 public int EditGoals(Goals goals)
 {
     try
     {
         db.Entry(goals).State = EntityState.Modified;
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }
Esempio n. 3
0
 //Define Goals
 public int addGoals(Goals goals)
 {
     try
     {
         db.Goals.Add(goals);
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }
Esempio n. 4
0
 //Delete Goals
 public int DeleteGoals(int goalId)
 {
     try
     {
         Goals goals = db.Goals.Find(goalId);
         db.Goals.Remove(goals);
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }