Exemplo n.º 1
0
        public Model.Transaction Create(Model.Transaction transaction, int?targetGoalId)
        {
            //Set the parameters and
            string sql = LoadSqlResources().First().Value;
            Dictionary <string, object> parameters = ConvertToParameters(transaction);

            parameters.Add("TargetGoalId", targetGoalId);

            return(typedDataAccess.ExecuteQuery <Model.Transaction>(sql, parameters).First());
        }
Exemplo n.º 2
0
        public Model.Goal CreateGoalForUser(int userID, Model.Goal goal)
        {
            string sql = base.LoadSqlResources().Values.First();
            Dictionary <string, object> parameters = ConvertToParameters
                                                     (
                new
            {
                UserId = userID,
                goal.Name,
                goal.Description,
                goal.Target,
                StatusId = GoalStatus.Open,
                goal.IsDefault
            }
                                                     );

            //Execute and return the goal
            Model.Goal savedGoal = typedDataAccess.ExecuteQuery <Model.Goal>(sql, parameters).First();
            return(savedGoal);
        }
Exemplo n.º 3
0
        public IEnumerable <Model.Milestone> GetAll()
        {
            string sql = LoadSqlResources().Values.First();

            return(typedDataAccess.ExecuteQuery <Model.Milestone>(sql));
        }