示例#1
0
        /// <summary>
        /// LoadStrands
        /// </summary>
        /// <param name="forms"></param>
        /// <param name="filter"></param>
        private void LoadCastStrands( IEnumerable<RecProductionFormStd> forms, Filter filter )
        {
            foreach( var recProductionFormStd in forms )
            {
                var rec = new RecProductionCastStrand()
                              {
                                  Factory = filter.Factory,
                                  Project = filter.Project,
                                  CastId = recProductionFormStd.ProductionCast.CastId
                              };
                if( null != recProductionFormStd.ProductionCast )
                {
                    if( recProductionFormStd.FormType == FormType.Bed && recProductionFormStd.StrandType == StrandType.Bed )
                    {
                        // Load cast strands
                        var svc = new ProjectManager();
                        recProductionFormStd.ProductionCast.Strands = svc.LoadProductionCastStrand( rec );
                    }
                    var et = recProductionFormStd.ProductionCast.ElementType;
                    var hasStrands = et.Equals( "HD" ) || et.Equals( "HD/F" );

                    if( hasStrands )
                    {
                        var strandSvc = new ProjectManager();
                        recProductionFormStd.ProductionCast.Strands = strandSvc.LoadStrands(
                            filter.Factory,
                            filter.Project,
                            recProductionFormStd.ProductionCast.ElementType,
                            recProductionFormStd.ProductionCast.Style,
                            recProductionFormStd.ProductionCast.Strandptn );
                    }
                }
            }
        }
示例#2
0
        /// <summary>
        /// LoadHollowcoreStrands
        /// </summary>
        /// <param name="form"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        private List<RecProductionFormStrandStd> LoadHollowcoreStrands( RecProductionFormStd form, Filter filter )
        {

            if( string.IsNullOrEmpty( form.Style ) || string.IsNullOrEmpty( form.Strandptn ) )
            {
                return null;
            }
            var strandSvc = new ProjectManager();
            var strands = strandSvc.LoadStrands(
                            filter.Factory,
                            filter.Project,
                            form.ElementType,
                            form.Style,
                            form.Strandptn );
            if( null != strands && strands.Count > 0 )
            {
                var list = new List<RecProductionFormStrandStd>();
                foreach( var strand in strands)
                {
                    var strandStd = new RecProductionFormStrandStd 
                    { 
                        Factory = strand.Factory, 
                        Project = strand.Project, 
                        StrandPos = strand.StrandPos, 
                        StrandX = strand.StrandX, 
                        StrandY = strand.StrandY, 
                        StrandQuality = strand.StrandQuality,
                        StrandDimension = strand.StrandDimension,
                        StrandPrestressing = strand.StrandPrestressing,
                    };

                    list.Add( strandStd );
                }

                return list;
            }

            return null;
        }