Esempio n. 1
0
        public IEnumerable <Operation> Get(long goalId, GoalEntityType goalTypeId)
        {
            var sqlSelect = String.Format("SELECT * FROM {0} WHERE [GoalId] = @goalId AND [GoalTypeId] = @goalTypeId", EntityTableSchema);
            var entities  = Connection.Query <Operation>(sqlSelect, new { goalId, goalTypeId });

            return(entities);
        }
Esempio n. 2
0
        public Goal Get(long parentId, GoalEntityType parentTypeId)
        {
            var sql    = String.Format("SELECT * FROM {0} WHERE ParentId = @id AND ParentTypeId = @typeId", EntityTableSchema);
            var entity = Connection.Query <Goal>(sql, new { id = parentId, typeId = (int)parentTypeId }).SingleOrDefault();

            if (entity != null)
            {
                entity.OperationDetails = _operationRepository.Get(entity.ParentId, entity.ParentTypeId);
            }

            return(entity);
        }
Esempio n. 3
0
 public int OperationsPendingCount(long goalId, GoalEntityType goalTypeId)
 {
     throw new NotImplementedException();
 }
Esempio n. 4
0
        public void Delete(long parentId, GoalEntityType parentTypeId)
        {
            var sql = String.Format("DELETE FROM {0} WHERE ParentId = @id AND ParentTypeId = @typeId", EntityTableSchema);

            Connection.Execute(sql, new { id = parentId, typeId = (int)parentTypeId });
        }