public bool UpdateGoal(GoalsDTO Goals) { try { var g = (from x in db.goals where x.GID == Goals.GID select x).SingleOrDefault(); g.GID = Goals.GID; g.customer_CID = Goals.customer_CID; g.kg = Goals.kg; g.percentage = Goals.percentage; g.description = Goals.description; g.diameter = Goals.diameter; g.startDate = Goals.startDate; g.dueDate = Goals.dueDate; db.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public GoalsDTO AddGoal(GoalsDTO Goals) { var g = new goals { GID = Goals.GID, customer_CID = Goals.customer_CID, kg = Goals.kg, percentage = Goals.percentage, description = Goals.description, diameter = Goals.diameter, startDate = Goals.startDate, dueDate = Goals.dueDate }; db.goals.Add(g); db.SaveChanges(); return(Goals); }
public bool Update(GoalsDTO Goals) { return(gq.UpdateGoal(Goals)); }
public GoalsDTO Add(GoalsDTO Goals) { return(gq.AddGoal(Goals)); }