コード例 #1
0
        /// <summary>
        /// Retrieves a chore from the Chore Table.
        /// </summary>
        /// <param name="id">Id of the Chore to retrieve.</param>
        /// <returns>Chore</returns>
        public async Task <Chore> GetChore(Guid id)
        {
            var cmd = SqlCommandBuilder.GetIndividualRecordBuilder(typeof(Chore), id);

            var chores = await _sqlClient.Get <Chore>(cmd);

            return(chores[0]);
        }
コード例 #2
0
        public async Task <Chore> GetChoreByChoreId(Guid choreId)
        {
            var cmd = SqlCommandBuilder.GetIndividualRecordBuilder(typeof(Chore), choreId);

            var chores = await _sqlClient.Get <Chore>(cmd);

            if (chores.Count > 0)
            {
                var completionDate = chores[0].CompletionDate;
                var completionTime = chores[0].CompletionTime;
                var choreFrequency = chores[0].ChoreTypeId;


                if (Convert.ToDateTime(completionDate) == DateTime.Now.Date && Convert.ToDateTime(completionTime) <= DateTime.Now.ToLocalTime())
                {
                    //update the chore, date and time with whatever (weekly)
                    //call the command builder for update
                }
            }
            return(chores[0]);
        }