Пример #1
0
        public NomType GetPathTypeByPipelineDuns(string pipelineDuns)
        {
            NomType modelType = new NomType();

            try
            {
                var pipeline = DbContext.Pipeline.Where(a => a.DUNSNo == pipelineDuns).FirstOrDefault();
                if (pipeline != null)
                {
                    if (pipeline.ModelTypeID == 1)
                    {
                        modelType = NomType.Pathed;
                    }
                    else if (pipeline.ModelTypeID == 2)
                    {
                        modelType = NomType.PNT;
                    }
                    else if (pipeline.ModelTypeID == 3)
                    {
                        modelType = NomType.NonPathed;
                    }
                    else if (pipeline.ModelTypeID == 4)
                    {
                        modelType = NomType.HyPathedNonPathed;
                    }
                    else if (pipeline.ModelTypeID == 5)
                    {
                        modelType = NomType.HyPathedPNT;
                    }
                    else if (pipeline.ModelTypeID == 6)
                    {
                        modelType = NomType.HyNonPathedPNT;
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Pathtype not found for this duns.");
            }
            return(modelType);
        }
Пример #2
0
        public NomType GetPathTypeByPipelineType(int ModelTypeID)
        {
            NomType modelType = new NomType();

            try
            {
                if (ModelTypeID != 0)
                {
                    if (ModelTypeID == 1)
                    {
                        modelType = NomType.Pathed;
                    }
                    else if (ModelTypeID == 2)
                    {
                        modelType = NomType.PNT;
                    }
                    else if (ModelTypeID == 3)
                    {
                        modelType = NomType.NonPathed;
                    }
                    else if (ModelTypeID == 4)
                    {
                        modelType = NomType.HyPathedNonPathed;
                    }
                    else if (ModelTypeID == 5)
                    {
                        modelType = NomType.HyPathedPNT;
                    }
                    else if (ModelTypeID == 6)
                    {
                        modelType = NomType.HyNonPathedPNT;
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Pathtype not found for ModelType.");
            }
            return(modelType);
        }