Example #1
0
        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);
        }
        public IList <SpecificationSection> FindAllSpecificationSections()
        {
            List <SpecificationSection> specSections = new List <SpecificationSection>();
            string query = "SELECT * FROM SpecificationSection";

            using (IDataReader reader = this.ExecuteReader(query))
            {
                while (reader.Read())
                {
                    specSections.Add(SubmittalFactory.BuildSpecSection(reader));
                }
            }
            return(specSections);
        }
Example #3
0
        internal static TrackingItem BuildTrackingItem(IDataReader reader)
        {
            TrackingItem item = new TrackingItem(SubmittalFactory.BuildSpecSection(reader));

            item.TotalItemsReceived = DataHelper.GetInteger(
                reader[FieldNames.TotalItemsReceived]);
            item.TotalItemsSent = DataHelper.GetInteger(
                reader[FieldNames.TotalItemsSent]);
            item.DeferredApproval = DataHelper.GetInteger(
                reader[FieldNames.DeferredApproval]);
            item.SubstitutionNumber = DataHelper.GetInteger(
                reader[FieldNames.SubstitutionNumber]);
            item.Description = reader[FieldNames.Description].ToString();
            item.Status      = DataHelper.GetEnumValue <ActionStatus>(
                reader[FieldNames.Status].ToString());
            return(item);
        }
        private void AppendTrackingItems(Submittal submittal)
        {
            StringBuilder builder = new StringBuilder(100);

            builder.Append("SELECT * FROM SubmittalTrackingItem sti");
            builder.Append(" INNER JOIN SpecificationSection ss ON ");
            builder.Append(" sti.SpecificationSectionID = ss.SpecificationSectionID ");
            builder.Append(string.Format(" WHERE SubmittalID = '{0}';",
                                         submittal.Key));
            using (IDataReader reader = this.ExecuteReader(builder.ToString()))
            {
                while (reader.Read())
                {
                    submittal.TrackingItems.Add(
                        SubmittalFactory.BuildTrackingItem(reader));
                }
            }
        }
        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);
        }