Exemplo n.º 1
0
 public AssignmentPresentation(Assignment assignment, IEnumerable<PresentationStep> steps)
 {
     Assignment = assignment;
     Steps = steps;
 }
Exemplo n.º 2
0
        public bool Remove(Assignment item)
        {
            long assignmentId = (long)IdOf(item);

            string assignmentDeleteText = @"
                DELETE
                FROM    [dbo].[EmployeeQuizAssignments]
                WHERE   [Id] = @Id
                ";

            IDbConnection connection = DbContext != null && DbContext.Transaction != null ? DbContext.Transaction.Connection : new SqlConnection(DBHelper.ConnectionString);
            IDbCommand command = DbContext != null && DbContext.Transaction != null ? 
                                    new SqlCommand(assignmentDeleteText, connection as SqlConnection, DbContext.Transaction as SqlTransaction) 
                                        : new SqlCommand(assignmentDeleteText);
            return DBHelper.ExecuteNonQuery(connection, command, DbContext == null,
                new SqlParameter() { ParameterName = "@Id", DbType = DbType.Int64, Value = assignmentId }) == 1;
        }
Exemplo n.º 3
0
 public AssignmentQuiz(string name, int requiredNumberOfCorrectAnswers, Assignment assignment, IEnumerable<Question> questions)
     : base(name, requiredNumberOfCorrectAnswers)
 {
     Assignment = assignment;
     Questions = questions;
 }
Exemplo n.º 4
0
 public object IdOf(Assignment item)
 {
     return _IdsByHashCode[item.GetHashCode()];
 }