Beispiel #1
0
 /// <summary>
 /// 根据工作流版本选择该版本下的所有步骤
 /// </summary>
 /// <param name="VersionGuid"></param>
 /// <returns></returns>
 public List<SWFStep> SelectSWFStepList(string VersionGuid)
 {
     Database db = DatabaseFactory.CreateDatabase(WorkFlowConnStr);
        // string strSql = "SELECT STEPGUID,VERSIONGUID,STEPNAME,STEPSTATUS,NEXTGUID,NEXTSTEPNAME,PREGUID,PRESTEPNAME,BACKGUID,BACKSTEPNAME,CHECKROLEGUID,STEPORDER,ROLENAME FROM OA_SWFSTEP OS,OA_ROLE_TYPE CRT WHERE OS.CHECKROLEGUID=CRT.RoleGuid AND OS.VERSIONGUID='" + VersionGuid + "' ORDER BY  STEPORDER DESC";
     string strSql = "SELECT STEPGUID,VERSIONGUID,STEPNAME,STEPSTATUS,NEXTGUID,NEXTSTEPNAME,PREGUID,PRESTEPNAME,BACKGUID,BACKSTEPNAME,CHECKROLEGUID,STEPORDER,(SELECT RoleName FROM OA_ROLE_TYPE ORT WHERE ORT.RoleGuid=OS.CHECKROLEGUID) AS RoleName FROM OA_SWFSTEP OS WHERE OS.VERSIONGUID='" + VersionGuid + "' ORDER BY  STEPORDER DESC";
     DbCommand cmd = db.GetSqlStringCommand(strSql);
     DataView dv= db.ExecuteDataView(cmd);
     List<SWFStep> SWFStepList = new List<SWFStep>();
     for (int i = 0; i < dv.Count; i++)
     {
         SWFStep WFS = new SWFStep();
         WFS.StepGuid = dv[i]["STEPGUID"].ToString();
         WFS.StepName = dv[i]["STEPNAME"].ToString();
         WFS.VersionGuid = VersionGuid;
         WFS.StepStatus = dv[i]["STEPSTATUS"].ToString();
         WFS.NextGuid = dv[i]["NEXTGUID"].ToString();
         WFS.NextName = dv[i]["NEXTSTEPNAME"].ToString();
         WFS.PreGuid = dv[i]["PREGUID"].ToString();
         WFS.PreName = dv[i]["PRESTEPNAME"].ToString();
         WFS.BackGuid = dv[i]["BACKGUID"].ToString();
         WFS.BackName = dv[i]["BACKSTEPNAME"].ToString();
         WFS.CheckRoleGuid = dv[i]["CHECKROLEGUID"].ToString();
         WFS.CheckRoleName = dv[i]["ROLENAME"].ToString();
         WFS.StepOrder = Convert.ToInt32(dv[i]["STEPORDER"].ToString());
         SWFStepList.Add(WFS);
     }
     return SWFStepList;
 }
Beispiel #2
0
 /// <summary>
 /// 选择具体的步骤
 /// </summary>
 /// <param name="StepGuid"></param>
 /// <returns></returns>
 public SWFStep SelectSWFStep(string StepGuid )
 {
     Database db = DatabaseFactory.CreateDatabase(WorkFlowConnStr);
     string strSql = " SELECT STEPGUID,VERSIONGUID,STEPNAME,STEPSTATUS,NEXTGUID,NEXTSTEPNAME,PREGUID,PRESTEPNAME,BACKGUID,BACKSTEPNAME,CHECKROLEGUID,STEPORDER,(SELECT RoleName FROM OA_ROLE_TYPE ORT WHERE ORT.RoleGuid=OS.CHECKROLEGUID) AS ROLENAME FROM OA_SWFSTEP OS WHERE STEPGUID='" + StepGuid + "'";
     DbCommand cmd = db.GetSqlStringCommand(strSql);
     DataView dv = db.ExecuteDataView(cmd);
     SWFStep Step = new SWFStep();
     if (dv.Count > 0)
     {
         Step.StepGuid = dv[0]["STEPGUID"].ToString();
         Step.VersionGuid = dv[0]["VERSIONGUID"].ToString();
         Step.StepName = dv[0]["STEPNAME"].ToString();
         Step.StepStatus = dv[0]["STEPSTATUS"].ToString();
         Step.NextGuid = dv[0]["NEXTGUID"].ToString();
         Step.NextName = dv[0]["NEXTSTEPNAME"].ToString();
         Step.PreGuid = dv[0]["PREGUID"].ToString();
         Step.PreName = dv[0]["PRESTEPNAME"].ToString();
         Step.BackGuid = dv[0]["BACKGUID"].ToString();
         Step.BackName = dv[0]["BACKSTEPNAME"].ToString();
         Step.CheckRoleGuid = dv[0]["CHECKROLEGUID"].ToString();
         Step.CheckRoleName = dv[0]["ROLENAME"].ToString();
         Step.StepOrder = Convert.ToInt32(dv[0]["STEPORDER"].ToString());
     }
     return Step;
 }