Exemplo n.º 1
0
 //get GoalsbyId
 public Goals GetGoalsById(int goalId)
 {
     try
     {
         Goals goals = db.Goals.Find(goalId);
         return(goals);
     }
     catch
     {
         throw;
     }
 }
Exemplo n.º 2
0
 //edit Goals
 public int EditGoals(Goals goals)
 {
     try
     {
         db.Entry(goals).State = EntityState.Modified;
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }
Exemplo n.º 3
0
 //Define Goals
 public int addGoals(Goals goals)
 {
     try
     {
         db.Goals.Add(goals);
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }
Exemplo 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;
     }
 }