예제 #1
0
        public void AddGoal(Goal goal)
        {
            var g = new Db.Entities.Goal
            {
                Name     = goal.Name,
                DueDate  = goal.DueDate,
                Amount   = goal.Amount,
                ClientId = 1
            };

            _context.Goals.Add(g);
            _context.SaveChanges();
        }
예제 #2
0
        public void SetMainGoal(int id)
        {
            var goal = _context.Goals.Where(x => x.GoalId == id).First();
            var ng   = new Db.Entities.Goal
            {
                Name     = goal.Name,
                DueDate  = goal.DueDate,
                Amount   = goal.Amount,
                ClientId = 1
            };

            DeleteGoal(id);
            _context.Goals.Add(ng);
            _context.SaveChanges();
        }