コード例 #1
0
        public List <ValkWFStep> LoadChildSteps(ValkWFStep CurrentStep)
        {
            List <ValkWFStep> Children = new List <ValkWFStep>();
            DataTable         dt       = SQLConnHandler.ExecuteDataTableSP("LoadChildSteps",
                                                                           new SQLParameter()
            {
                ParamName = "@WFTemplateID", ParamValue = CurrentStep.WFTemplateID
            },
                                                                           new SQLParameter()
            {
                ParamName = "@WFTemplateStepID", ParamValue = CurrentStep.WFTemplateStepID
            });

            foreach (DataRow Row in dt.Rows)
            {
                ValkWFStep Step = new ValkWFStep();
                Step.WFTemplateID     = CurrentStep.WFTemplateID;
                Step.HandleCategory   = Row["OnExecuteCall"].ToString();
                Step.StepName         = Row["Name"].ToString();
                Step.WFTemplateStepID = int.Parse(Row["WFTEmplateStepID_To"].ToString());
                Step.SyncCount        = int.Parse(Row["SyncCount"].ToString());
                Step.GroupID          = int.Parse(Row["GroupID"].ToString());
                Step.ParentStep       = CurrentStep;
                Step.InstanceKey      = CurrentStep.InstanceKey;
                Children.Add(Step);
            }
            return(Children);
        }
コード例 #2
0
        public WFTemplateLoadingData LoadWFTemplates()
        {
            WFTemplateLoadingData LoadingData = new WFTemplateLoadingData();
            DataTable             dt          = SQLConnHandler.ExecuteDataTableSP("LoadWFTemplates");

            if (dt != null)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    if (dr["InProduction"].ToString() == "True")
                    {
                        if (LoadingData.LoadedActiveInstanceByType.ContainsKey(dr["WFType"].ToString()))
                        {
                            //warning, already here
                        }
                        LoadingData.LoadedActiveInstanceByType[dr["WFType"].ToString()] = int.Parse(dr["WFTemplateID"].ToString());
                    }

                    ValkWFStep FirstStep = new ValkWFStep();
                    FirstStep.WFTemplateID = int.Parse(dr["WFTemplateID"].ToString());
                    LoadingData.WFsToLoad.Add(FirstStep);

                    DataTable steps =
                        SQLConnHandler.ExecuteDataTableSP("LoadWFTemplateFirstStep",
                                                          new SQLParameter()
                    {
                        ParamName = "@WFTemplateID", ParamValue = dr["WFTemplateID"].ToString()
                    });
                    if (steps.Rows.Count > 0)
                    {
                        LoadingData.WFsToLoad[LoadingData.WFsToLoad.Count - 1].HandleCategory   = steps.Rows[0]["OnExecuteCall"].ToString();
                        LoadingData.WFsToLoad[LoadingData.WFsToLoad.Count - 1].StepName         = steps.Rows[0]["Name"].ToString();
                        LoadingData.WFsToLoad[LoadingData.WFsToLoad.Count - 1].WFTemplateStepID = int.Parse(steps.Rows[0]["WFTemplateStepID"].ToString());
                        LoadingData.WFsToLoad[LoadingData.WFsToLoad.Count - 1].SyncCount        = int.Parse(steps.Rows[0]["SyncCount"].ToString());
                        LoadingData.WFsToLoad[LoadingData.WFsToLoad.Count - 1].GroupID          = int.Parse(steps.Rows[0]["GroupID"].ToString());
                    }
                    else
                    {
                        //todo: error, no first step for this WF
                    }
                }
            }
            else
            {
                //todo: no templates!
            }
            return(LoadingData);
        }
コード例 #3
0
        public WFTemplateLoadingData LoadWFTemplates()
        {
            WFTemplateLoadingData LoadingData = new WFTemplateLoadingData();
            DataTable dt = SQLConnHandler.ExecuteDataTableSP("LoadWFTemplates");
            if (dt != null)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    if (dr["InProduction"].ToString() == "True")
                    {
                        if (LoadingData.LoadedActiveInstanceByType.ContainsKey(dr["WFType"].ToString()))
                        {
                            //warning, already here
                        }
                        LoadingData.LoadedActiveInstanceByType[dr["WFType"].ToString()] = int.Parse(dr["WFTemplateID"].ToString());
                    }

                    ValkWFStep FirstStep = new ValkWFStep();
                    FirstStep.WFTemplateID = int.Parse(dr["WFTemplateID"].ToString());
                    LoadingData.WFsToLoad.Add(FirstStep);

                    DataTable steps =
                        SQLConnHandler.ExecuteDataTableSP("LoadWFTemplateFirstStep",
                        new SQLParameter() { ParamName = "@WFTemplateID", ParamValue = dr["WFTemplateID"].ToString() });
                    if (steps.Rows.Count > 0)
                    {
                        LoadingData.WFsToLoad[LoadingData.WFsToLoad.Count - 1].HandleCategory = steps.Rows[0]["OnExecuteCall"].ToString();
                        LoadingData.WFsToLoad[LoadingData.WFsToLoad.Count - 1].StepName = steps.Rows[0]["Name"].ToString();
                        LoadingData.WFsToLoad[LoadingData.WFsToLoad.Count - 1].WFTemplateStepID = int.Parse(steps.Rows[0]["WFTemplateStepID"].ToString());
                        LoadingData.WFsToLoad[LoadingData.WFsToLoad.Count - 1].SyncCount = int.Parse(steps.Rows[0]["SyncCount"].ToString());
                        LoadingData.WFsToLoad[LoadingData.WFsToLoad.Count - 1].GroupID = int.Parse(steps.Rows[0]["GroupID"].ToString());

                    }
                    else
                    {
                        //todo: error, no first step for this WF
                    }
                }
            }
            else
            {
                //todo: no templates!
            }
            return LoadingData;
        }
コード例 #4
0
 public List<ValkWFStep> LoadChildSteps(ValkWFStep CurrentStep)
 {
     List<ValkWFStep> Children = new List<ValkWFStep>();
     DataTable dt = SQLConnHandler.ExecuteDataTableSP("LoadChildSteps",
         new SQLParameter() { ParamName = "@WFTemplateID", ParamValue = CurrentStep.WFTemplateID },
         new SQLParameter() { ParamName = "@WFTemplateStepID", ParamValue = CurrentStep.WFTemplateStepID });
     foreach(DataRow Row in dt.Rows)
     {
         ValkWFStep Step = new ValkWFStep();
         Step.WFTemplateID = CurrentStep.WFTemplateID;
         Step.HandleCategory = Row["OnExecuteCall"].ToString();
         Step.StepName = Row["Name"].ToString();
         Step.WFTemplateStepID = int.Parse(Row["WFTEmplateStepID_To"].ToString());
         Step.SyncCount = int.Parse(Row["SyncCount"].ToString());
         Step.GroupID = int.Parse(Row["GroupID"].ToString());
         Step.ParentStep = CurrentStep;
         Step.InstanceKey = CurrentStep.InstanceKey;
         Children.Add(Step);
     }
     return Children;
 }