示例#1
0
        public void Draw(ActivityConfig.SeriesRow workflow)
        {
            mySeries = workflow;

            Reset();

            curPoint = new Point(10, 30);
            maxX     = 0;
            maxY     = 0;
            int countOfStarts = 0;

            foreach (lmDatasets.ActivityConfig.ACSeriesRow acs in workflow.GetACSeriesRows())
            {
                if (HideObsolete & acs.Obsolete)
                {
                }
                else
                {
                    bool isStart = UIHelper.AtMng.acMng.GetACSeries().IsStart(acs);

                    if (isStart)
                    {
                        Start s1 = new Start(this);
                        myOtherSteps.Add(s1);
                        maxY = countOfStarts;

                        curPoint.Y = maxY * DefaultHeightGap + 30;

                        Point checkAheadPoint = new Point(curPoint.X + DefaultWidthGap + 60, curPoint.Y + 27);
                        while (HitStep(checkAheadPoint) != null)
                        {
                            countOfStarts++;
                            maxY++;
                            curPoint.Y      = maxY * DefaultHeightGap + 30;
                            checkAheadPoint = new Point(curPoint.X + DefaultWidthGap + 60, curPoint.Y + 27);
                        }

                        s1.Draw(curPoint);

                        s1.gridX = maxX;
                        s1.gridY = maxY;

                        curPoint.X = 50;


                        if (!acs.Start)
                        {
                            acs.Start = true;
                        }

                        AddStep(acs);
                        AddConnector(s1, mySteps[GetStepKey(acs)]);

                        curPoint.X = 10;
                        maxX       = 0;

                        if (SelectedStep == null & SelectedConnector == null)
                        {
                            SelectStep(mySteps[GetStepKey(acs)]);
                        }

                        maxY++;
                        countOfStarts++;
                    }
                    else
                    {
                        //check to see if it is not a start
                        if (acs.Start)
                        {
                            acs.Start = false;
                        }
                    }
                }
            }
            drawingSurface.Clear(drawingSurfaceBGColor);
            Refresh();
        }
示例#2
0
        public ActivityConfig.SeriesRow Clone(ActivityConfig.SeriesRow oldSeries)
        {
            //copy series row
            ActivityConfig.SeriesRow newSeries = mySeriesDT.NewSeriesRow();

            newSeries.ItemArray = oldSeries.ItemArray;
            mySeriesDT.AddSeriesRow(newSeries);

            newSeries.CreatesFile             = oldSeries.CreatesFile;
            newSeries.OncePerFile             = oldSeries.OncePerFile;
            newSeries.ConfirmMultipleInstance = oldSeries.ConfirmMultipleInstance;
            newSeries.SingleInstancePerFile   = oldSeries.SingleInstancePerFile;
            newSeries.Obsolete = oldSeries.Obsolete;

            newSeries.ContainerFileId = 0;
            newSeries.SeriesDescEng   = "Copy of " + newSeries.SeriesDescEng;
            newSeries.SeriesDescFre   = "Copie de " + newSeries.SeriesDescFre;

            System.Collections.Generic.Dictionary <int, int> concordance = new System.Collections.Generic.Dictionary <int, int>();

            //copy acseries rows
            foreach (ActivityConfig.ACSeriesRow acsr in oldSeries.GetACSeriesRows())
            {
                ActivityConfig.ACSeriesRow newAcsr = myA.DB.ACSeries.NewACSeriesRow();

                newAcsr.ItemArray = acsr.ItemArray;
                newAcsr.SeriesId  = newSeries.SeriesId;
                myA.DB.ACSeries.AddACSeriesRow(newAcsr);

                concordance.Add(acsr.ACSeriesId, newAcsr.ACSeriesId);

                newAcsr.Finish      = acsr.Finish;
                newAcsr.Start       = acsr.Start;
                newAcsr.OnceOnly    = acsr.OnceOnly;
                newAcsr.Seq         = acsr.Seq;
                newAcsr.InitialStep = acsr.InitialStep;
                newAcsr.StepType    = acsr.StepType;

                myA.GetACSeries().ReplaceRelFields(newAcsr, acsr, true);


                //foreach (ActivityConfig.ACConvertRow accr in acsr.GetACConvertRowsByACSeries_ACConvert())
                //{
                //    lmDatasets.ActivityConfig.ACConvertRow newAcc = myA.DB.ACConvert.NewACConvertRow();
                //    newAcc.ItemArray = accr.ItemArray;
                //    newAcc.ACSeriesId = accr.ACSeriesId;
                //    myA.DB.ACConvert.AddACConvertRow(newAcc);


                //}
            }


            foreach (ActivityConfig.ACSeriesRow acsr in oldSeries.GetACSeriesRows())
            {
                foreach (ActivityConfig.ACDependencyRow acdr in acsr.GetACDependencyRowsByNextSteps())
                {
                    lmDatasets.ActivityConfig.ACDependencyRow newAcd = myA.DB.ACDependency.NewACDependencyRow();

                    newAcd.ItemArray     = acdr.ItemArray;
                    newAcd.CurrentStepId = concordance[acdr.CurrentStepId];
                    if (concordance.ContainsKey(acdr.NextStepId))
                    {
                        newAcd.NextStepId = concordance[acdr.NextStepId];
                    }
                    else
                    {
                        newAcd.NextStepId = acdr.NextStepId;
                    }
                    myA.DB.ACDependency.AddACDependencyRow(newAcd);

                    newAcd.LinkType = acdr.LinkType;
                    if (!acdr.IsDescEngNull())
                    {
                        newAcd.DescEng = acdr.DescEng;
                    }
                    if (!acdr.IsDescFreNull())
                    {
                        newAcd.DescFre = acdr.DescFre;
                    }
                }
            }
            return(newSeries);
        }