Exemple #1
0
        private DomainArea GetDomainAreasFromDataRow(DataTableRows row)
        {
            try
            {
                var area = new DomainArea();

                area.AreaCode    = row.AsString("Code");
                area.Description = row.AsString("Meaning");

                return(area);
            }
            catch (Exception ex)
            {
                throw new Exception("Exception occurred while converting area to an object.", ex);
            }
        }
Exemple #2
0
        private RequestTemplate GetTemplateFromDataRow(DataTableRows row)
        {
            try
            {
                var t = new RequestTemplate();
                t.TemplateID                  = row.AsInt32("RequestTemplateID");
                t.Description                 = row.AsString("RequestDescription");
                t.DocumentType                = row.AsString("DocumentType");
                t.DocStatus                   = row.AsString("DocStatus");
                t.ProcessType                 = row.AsString("ProcessType");
                t.BusinessType                = row.AsString("BusinessType");
                t.PsrType                     = row.AsString("PsrType");
                t.TypeMarketAgreementType     = row.AsString("TypeMarketAgreementType");
                t.ContractMarketAgreementType = row.AsString("ContractMarketAgreementType");
                t.AuctionType                 = row.AsString("AuctionType");
                t.AuctionCategory             = row.AsString("AuctionCategory");
                t.ClassificationSequenceAttributeInstanceComponent = row.AsString("ClassificationSequenceAttributeInstanceComponent");

                if (row.AsBool("OutBiddingZoneDomain"))
                {
                    t.UsedDomains |= RequestTemplate.DomainsInUse.OutBiddingZoneDomain;
                }
                if (row.AsBool("BiddingZoneDomain"))
                {
                    t.UsedDomains |= RequestTemplate.DomainsInUse.BiddingZoneDomain;
                }
                if (row.AsBool("InDomain"))
                {
                    t.UsedDomains |= RequestTemplate.DomainsInUse.InDomain;
                }
                if (row.AsBool("OutDomain"))
                {
                    t.UsedDomains |= RequestTemplate.DomainsInUse.OutDomain;
                }
                if (row.AsBool("AcquiringDomain"))
                {
                    t.UsedDomains |= RequestTemplate.DomainsInUse.AcquiringDomain;
                }
                if (row.AsBool("ConnectingDomain"))
                {
                    t.UsedDomains |= RequestTemplate.DomainsInUse.ConnectingDomain;
                }
                if (row.AsBool("ControlAreaDomain"))
                {
                    t.UsedDomains |= RequestTemplate.DomainsInUse.ControlAreaDomain;
                }

                t.InDomainAndOutDomainMustMatch = row.AsBool("InDomainAndOutDomainMustMatch");

                if (row.AsBool("TimeInterval"))
                {
                    t.UsedTimePeriods |= RequestTemplate.TimePeriodsInUse.TimeInterval;
                }
                if (row.AsBool("TimeIntervalUpdate"))
                {
                    t.UsedTimePeriods |= RequestTemplate.TimePeriodsInUse.TimeIntervalUpdate;
                }
                if (row.AsBool("PeriodStart"))
                {
                    t.UsedTimePeriods |= RequestTemplate.TimePeriodsInUse.PeriodStart;
                }
                if (row.AsBool("PeriodEnd"))
                {
                    t.UsedTimePeriods |= RequestTemplate.TimePeriodsInUse.PeriodEnd;
                }
                if (row.AsBool("PeriodStartUpdate"))
                {
                    t.UsedTimePeriods |= RequestTemplate.TimePeriodsInUse.TimeInterval;
                }
                if (row.AsBool("PeriodEndUpdate"))
                {
                    t.UsedTimePeriods |= RequestTemplate.TimePeriodsInUse.TimeInterval;
                }

                return(t);
            }
            catch (Exception ex)
            {
                throw new Exception("Exception occurred while converting template to an object.", ex);
            }
        }