public Submittal BuildEntity(IDataReader reader) { Submittal submittal = new Submittal(reader[FieldNames.SubmittalId], SubmittalFactory.BuildSpecSection(reader), reader[FieldNames.ProjectId]); submittal.TransmittalDate = DataHelper.GetDateTime(reader[FieldNames.TransmittalDate]); submittal.Action = DataHelper.GetEnumValue <ActionStatus>(reader[FieldNames.Action].ToString()); submittal.ContractNumber = reader[FieldNames.ContractNumber].ToString(); submittal.DateReceived = DataHelper.GetNullableDateTime(reader[FieldNames.DateReceived]); submittal.DateToField = DataHelper.GetNullableDateTime(reader[FieldNames.DateToField]); submittal.DeliveryMethod = DataHelper.GetEnumValue <Delivery>(reader[FieldNames.DeliveryMethod].ToString()); submittal.Final = DataHelper.GetBoolean(reader[FieldNames.Final]); submittal.OtherDeliveryMethod = reader[FieldNames.OtherDeliveryMethod].ToString(); submittal.OtherRemainderLocation = reader[FieldNames.OtherRemainderLocation].ToString(); submittal.PhaseNumber = reader[FieldNames.PhaseNumber].ToString(); submittal.Reimbursable = DataHelper.GetBoolean(reader[FieldNames.Reimbursable]); submittal.RemainderLocation = DataHelper.GetEnumValue <SubmittalRemainderLocation>(reader[FieldNames.RemainderLocation].ToString()); submittal.RemainderUnderSubmittalNumber = reader[FieldNames.RemainderUnderSubmittalNumber].ToString(); submittal.Remarks = reader[FieldNames.Remarks].ToString(); submittal.SpecSectionPrimaryIndex = reader[FieldNames.SpecificationSectionPrimaryIndex].ToString(); submittal.SpecSectionSecondaryIndex = reader[FieldNames.SpecificationSectionSecondaryIndex].ToString(); submittal.Status = TransmittalFactory.BuildItemStatus(reader); submittal.TotalPages = DataHelper.GetInteger(reader[FieldNames.TotalPages]); return(submittal); }
internal static RoutingItem BuildRoutingItem(object projectKey, IDataReader reader) { ProjectContact contact = ProjectService.GetProjectContact(projectKey, reader[FieldNames.ProjectContactId]); return(new RoutingItem(reader[FieldNames.RoutingItemId], TransmittalFactory.BuildDiscipline(reader), DataHelper.GetInteger(reader[FieldNames.RoutingOrder]), contact, DataHelper.GetDateTime(reader[FieldNames.DateSent]), DataHelper.GetNullableDateTime(reader[FieldNames.DateReturned]))); }
public IList <Discipline> FindAllDisciplines() { List <Discipline> disciplines = new List <Discipline>(); string query = "SELECT * FROM Discipline"; using (IDataReader reader = this.ExecuteReader(query)) { while (reader.Read()) { disciplines.Add(TransmittalFactory.BuildDiscipline(reader)); } } return(disciplines); }
public IList <ItemStatus> FindAllItemStatuses() { List <ItemStatus> statuses = new List <ItemStatus>(); string query = "SELECT * FROM ItemStatus"; using (IDataReader reader = this.ExecuteReader(query)) { while (reader.Read()) { statuses.Add(TransmittalFactory.BuildItemStatus(reader)); } } return(statuses); }
public RequestForInformation BuildEntity(IDataReader reader) { RequestForInformation rfi = new RequestForInformation(reader[FieldNames.RequestForInformationId], reader[FieldNames.ProjectId], DataHelper.GetInteger(reader[FieldNames.RequestForInformationNumber])); rfi.TransmittalDate = DataHelper.GetDateTime(reader[FieldNames.TransmittalDate]); rfi.DateReceived = DataHelper.GetNullableDateTime(reader[FieldNames.DateReceived]); rfi.DateToField = DataHelper.GetNullableDateTime(reader[FieldNames.DateToField]); rfi.DeliveryMethod = DataHelper.GetEnumValue <Delivery>(reader[FieldNames.DeliveryMethod].ToString()); rfi.Final = DataHelper.GetBoolean(reader[FieldNames.Final]); rfi.OtherDeliveryMethod = reader[FieldNames.OtherDeliveryMethod].ToString(); rfi.PhaseNumber = reader[FieldNames.PhaseNumber].ToString(); rfi.Reimbursable = DataHelper.GetBoolean(reader[FieldNames.Reimbursable]); rfi.Remarks = reader[FieldNames.Remarks].ToString(); rfi.SpecSection = SubmittalFactory.BuildSpecSection(reader); rfi.Status = TransmittalFactory.BuildItemStatus(reader); rfi.TotalPages = DataHelper.GetInteger(reader[FieldNames.TotalPages]); return(rfi); }
private void AppendRoutingItems(ChangeOrder co) { StringBuilder builder = new StringBuilder(100); builder.Append(string.Format("SELECT * FROM {0}RoutingItem tri ", this.EntityName)); builder.Append(" INNER JOIN RoutingItem ri ON"); builder.Append(" tri.RoutingItemID = ri.RoutingItemID"); builder.Append(" INNER JOIN Discipline d ON"); builder.Append(" ri.DisciplineID = d.DisciplineID"); builder.Append(string.Format(" WHERE tri.{0} = '{1}';", this.KeyFieldName, co.Key)); using (IDataReader reader = this.ExecuteReader(builder.ToString())) { while (reader.Read()) { co.RoutingItems.Add(TransmittalFactory.BuildRoutingItem( co.ProjectKey, reader)); } } }
public ChangeOrder BuildEntity(IDataReader reader) { ChangeOrder co = new ChangeOrder(reader[FieldNames.ChangeOrderId], reader[FieldNames.ProjectId], DataHelper.GetInteger(reader[FieldNames.ChangeOrderNumber])); co.AgencyApprovedDate = DataHelper.GetNullableDateTime(reader[FieldNames.AgencyApprovedDate]); co.AmountChanged = DataHelper.GetDecimal(reader[FieldNames.AmountChanged]); co.ArchitectSignatureDate = DataHelper.GetNullableDateTime(reader[FieldNames.ArchitectSignatureDate]); co.ChangeType = DataHelper.GetEnumValue <PriceChangeType>(reader[FieldNames.PriceChangeType].ToString()); co.PriceChangeDirection = DataHelper.GetEnumValue <ChangeDirection>(reader[FieldNames.PriceChangeTypeDirection].ToString()); co.ContractorSignatureDate = DataHelper.GetNullableDateTime(reader[FieldNames.ContractorSignatureDate]); co.DateToField = DataHelper.GetNullableDateTime(reader[FieldNames.DateToField]); co.Description = DataHelper.GetString(reader[FieldNames.Description]); co.EffectiveDate = DataHelper.GetDateTime(reader[FieldNames.EffectiveDate]); co.OwnerSignatureDate = DataHelper.GetNullableDateTime(reader[FieldNames.OwnerSignatureDate]); co.TimeChanged = DataHelper.GetInteger(reader[FieldNames.TimeChangedDays]); co.Status = TransmittalFactory.BuildItemStatus(reader); co.TimeChangeDirection = DataHelper.GetEnumValue <ChangeDirection>(reader[FieldNames.TimeChangeDirection].ToString()); return(co); }