Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public bool Update(GoalsDTO Goals)
 {
     return(gq.UpdateGoal(Goals));
 }
Exemplo n.º 4
0
 public GoalsDTO Add(GoalsDTO Goals)
 {
     return(gq.AddGoal(Goals));
 }