Beispiel #1
0
 public Assignment(string name, string assignee, DateTime assignedOn, DateTime dueDate, Status currentStatus, bool completed, DateTime? completedOn)
 {
     Name = name;
     AssignedOn = assignedOn;
     DueDate = dueDate;
     CurrentStatus = currentStatus;
     Assignee = assignee;
     Completed = completed;
     CompletedOn = completedOn;
 }
Beispiel #2
0
 public Assignment(string name, string assignee, DateTime assignedOn, DateTime dueDate, Status currentStatus, bool completed, DateTime? completedOn, ReportingArea area)
     : this(name, assignee, assignedOn, dueDate, currentStatus, completed, completedOn)
 {
     Area = area;
 }
        private Assignment GetAssignment(IDataReader reader, Status currentStatus)
        {
            ReportingArea area = null;
            //If we have reporting scope, we can assume that we have all of the area columns.
            if (reader.HasColumn("ReportingScope") &&
                !reader.IsDBNull(reader.GetOrdinal("ReportingScope")))
            {
                 area =
                    new ReportingArea(
                        reader.IsDBNull(reader.GetOrdinal("SDst")) ? null : reader.GetString(reader.GetOrdinal("SDst")),
                        reader.IsDBNull(reader.GetOrdinal("PA")) ? null : reader.GetString(reader.GetOrdinal("PA")),
                        reader.IsDBNull(reader.GetOrdinal("Abbrev")) ? null : reader.GetString(reader.GetOrdinal("Abbrev")),
                        reader.IsDBNull(reader.GetOrdinal("RegionID")) ? null : (int?)reader.GetInt32(reader.GetOrdinal("RegionID")),
                        reader.IsDBNull(reader.GetOrdinal("Region")) ? null : reader.GetString(reader.GetOrdinal("Region")),
                        (Domain.ReportingScope)reader.GetInt32(reader.GetOrdinal("ReportingScope")));
            }

            return new Assignment(
                        reader.GetString(reader.GetOrdinal("QuizTopic")),
                        string.Format("{0} {1}", reader.GetString(reader.GetOrdinal("Firstname")), reader.GetString(reader.GetOrdinal("Lastname"))),
                        reader.GetDateTime(reader.GetOrdinal("AssignedOn")),
                        reader.GetDateTime(reader.GetOrdinal("DueDate")),
                        currentStatus,
                        reader.GetBoolean(reader.GetOrdinal("Completed")),
                        reader.IsDBNull(reader.GetOrdinal("CompletedOn")) ? null : (DateTime?)reader.GetDateTime(reader.GetOrdinal("CompletedOn")),
                        area);
        }