예제 #1
0
        /// <summary>
        /// 对象编辑
        /// </summary>
        /// <param name="tWfInstControl">用户对象</param>
        /// <returns>是否成功</returns>
        public bool Edit(TWfInstControlVo tWfInstControl)
        {
            string strSQL = SqlHelper.BuildUpdateExpress(tWfInstControl, TWfInstControlVo.T_WF_INST_CONTROL_TABLE);

            strSQL += string.Format(" where ID='{0}' ", tWfInstControl.ID);
            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
예제 #2
0
        /// <summary>
        /// 对象编辑
        /// </summary>
        /// <param name="tWfInstControl_UpdateSet">UpdateSet用户对象</param>
        /// <param name="tWfInstControl_UpdateWhere">UpdateWhere用户对象</param>
        /// <returns>是否成功</returns>
        public bool Edit(TWfInstControlVo tWfInstControl_UpdateSet, TWfInstControlVo tWfInstControl_UpdateWhere)
        {
            string strSQL = SqlHelper.BuildUpdateExpress(tWfInstControl_UpdateSet, TWfInstControlVo.T_WF_INST_CONTROL_TABLE);

            strSQL += this.BuildWhereStatement(tWfInstControl_UpdateWhere);
            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
예제 #3
0
        /// <summary>
        /// 获取对象DataTable
        /// </summary>
        /// <param name="tWfInstControl">对象</param>
        /// <param name="iIndex">起始页码</param>
        /// <param name="iCount">每页数目</param>
        /// <returns>返回结果</returns>
        public DataTable SelectByTable(TWfInstControlVo tWfInstControl, int iIndex, int iCount)
        {
            string strSQL = " select * from T_WF_INST_CONTROL {0} ";

            strSQL = String.Format(strSQL, BuildWhereStatement(tWfInstControl));
            return(SqlHelper.ExecuteDataTable(BuildPagerExpress(strSQL, iIndex, iCount)));
        }
예제 #4
0
        /// <summary>
        /// 获取对象DataTable【主要用户销毁实例流程使用】
        /// </summary>
        /// <param name="tWfInstControl">对象</param>
        /// <param name="iIndex">起始页码</param>
        /// <param name="iCount">每页数目</param>
        /// <returns>返回结果</returns>
        public DataTable SelectByTableForClear(TWfInstControlVo tWfInstControl, int iIndex, int iCount)
        {
            //不等于1G和1H的所有流程都可以销毁
            string strSQL = " select * from T_WF_INST_CONTROL " + BuildWhereStatement(tWfInstControl) + " and  wf_state <> '1G'  and wf_state <> '1H'  and wf_state <> '1F'  ";

            return(SqlHelper.ExecuteDataTable(BuildPagerExpress(strSQL, iIndex, iCount)));
        }
예제 #5
0
        /// <summary>
        /// 对象删除
        /// </summary>
        /// <param name="Id">ID</param>
        /// <returns>是否成功</returns>
        public bool Delete(TWfInstControlVo tWfInstControl)
        {
            string strSQL = "delete from T_WF_INST_CONTROL ";

            strSQL += this.BuildWhereStatement(tWfInstControl);

            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
        /// <summary>
        /// 恢复指定流程的状态为正常
        /// </summary>
        /// <param name="strID"></param>
        /// <returns></returns>
        public bool WFOperateForReNormal(string strID)
        {
            TWfInstControlVo ticv = new TWfInstControlVo()
            {
                ID = strID, WF_STATE = TWfCommDict.WfState.StateNormal, WF_SUSPEND_STATE = "0", WF_SUSPEND_ENDTIME = this.GetDateTimeToStanString()
            };

            return(new TWfInstControlLogic().Edit(ticv));
        }
예제 #7
0
    public void CreatShowData(TWfInstControlVo control, List <TWfSettingTaskVo> taskList, List <TWfInstTaskDetailVo> InstTaskList)
    {
        //首先根据流程实例来绘出 流程相关信息;
        //string strWFHtml = "<div class='layout20121'><div style='margin-bottom;8px;'><table><tr><td style='width:60px;'> 流程名称:</td><td>{0}</td></tr><tr><td>业务单号:</td><td>{1}</td></tr><tr><td>业务名称:</td><td>{2}</td></tr><tr><td>启动时间:</td><td>{3}</td></tr></table></div> #TULI# #STEP#</div>";
        //strWFHtml = string.Format(strWFHtml, control.WF_CAPTION, control.WF_SERVICE_CODE, control.WF_SERVICE_NAME, control.WF_STARTTIME);
        string strWFHtml = "<div class='layout20121'> #TULI# #STEP#</div>";

        strWFHtml = strWFHtml.Replace("#TULI#", "<div style= 'margin-bottom;8px;'><table><tr><td>图例:</td><td style='background-color:#5a8f5a;width:15px;height:15px;'></td><td>已处理</td><td style='background-color:#de9a1d;width:15px;height:15px;'></td><td>待处理</td><td style='background-color:#e34323;width:15px;height:15px;'></td><td>特殊处理</td><td style='background-color:#a9a9a9;width:15px;height:15px;'></td><td>未流转</td></tr><tr style='Height:5px;' ><td></td></tr></table></div>");
        string strStepHtml = CreatStepHtml(taskList, InstTaskList);

        //在根据流程实例列表来绘出 各个环节运行的状态 已处理为绿色,正常待处理为黄色,已挂起(暂停)的为灰色,已回退为蓝色,销毁为红色
        spShowPic.InnerHtml = strWFHtml.Replace("#STEP#", strStepHtml);
    }
예제 #8
0
    /// <summary>
    /// 输入3个参数,即可获得流程的起始化状态
    /// </summary>
    /// <param name="control">流程控制实例对象</param>
    /// <param name="taskList">流程环节配置列表</param>
    /// <param name="InstTaskList">流程环节实例列表</param>
    public void CreatAllData(TWfInstControlVo control, List <TWfSettingTaskVo> taskList, List <TWfInstTaskDetailVo> InstTaskList)
    {
        //首先根据流程实例来绘出 流程相关信息;
        string strWFHtml = "<div><table><tr><td>流程名称:{0}</td><td>流水号:{1}</td></tr><tr><td>业务名称:{2}</td><td>启动时间:{3}</td></tr></table></div>";

        strWFHtml  = string.Format(strWFHtml, control.WF_CAPTION, control.WF_SERIAL_NO, control.WF_SERVICE_NAME, control.WF_STARTTIME);
        strWFHtml += "<div><table><tr><td style='background-color:Green;width:15px;height:15px;'></td><td>已处理</td><td style='background-color:Orange;width:15px;height:15px;'></td><td>待处理</td><td style='background-color:Gray;width:15px;height:15px;'></td><td>未生成</td></tr></table></div>";
        //根据流程环节配置列表来绘出 环节相关图形和关系;
        string strStepHtml = CreatStepSpanHtml(taskList, InstTaskList);

        spShowPic.InnerHtml = strWFHtml + strStepHtml;
        //在根据流程实例列表来绘出 各个环节运行的状态 已处理为绿色,正常待处理为黄色,已挂起(暂停)的为灰色,已回退为蓝色,销毁为红色
    }
        /// <summary>
        /// 创建实例流程(包括未处理的第一个环节)数据接口
        /// </summary>
        /// <param name="strWFID">流程代码</param>
        /// <param name="strObjectUser">目标处理人用户ID</param>
        /// <param name="strCreateUser">生成人员ID</param>
        /// <param name="strServiceCode">业务类型编码</param>
        /// <param name="strServiceName">业务类型名称</param>
        /// <returns></returns>
        public bool CreateInstWFAndFirstStep(string strWFID, string strObjectUser, string strCreateUser, string strServiceCode, string strServiceName)
        {
            TWfInstTaskDetailVo detail  = new TWfInstTaskDetailVo();
            TWfInstControlVo    control = new TWfInstControlVo();
            TWfSettingTaskVo    task    = new TWfSettingTaskLogic().GetFirstStep(strWFID);
            TWfSettingFlowVo    flow    = new TWfSettingFlowLogic().Details(new TWfSettingFlowVo()
            {
                WF_ID = strWFID
            });

            //如果不存在数据,则返回
            if (string.IsNullOrEmpty(task.ID) || string.IsNullOrEmpty(flow.ID))
            {
                return(false);
            }

            detail.ID                  = GetGUID();
            detail.INST_NOTE           = task.TASK_NOTE;
            detail.INST_TASK_CAPTION   = task.TASK_CAPTION;
            detail.INST_TASK_STARTTIME = GetDateTimeToStanString();
            detail.INST_TASK_STATE     = TWfCommDict.StepState.StateNormal;
            detail.OBJECT_USER         = strObjectUser;
            detail.SRC_USER            = strCreateUser;
            detail.WF_ID               = strWFID;
            detail.WF_INST_ID          = GetGUID();
            detail.WF_SERIAL_NO        = GetDateTimeToStringFor15();
            detail.WF_TASK_ID          = task.WF_TASK_ID;

            control.ID              = detail.WF_INST_ID;
            control.IS_SUB_FLOW     = "0";
            control.WF_CAPTION      = flow.WF_CAPTION;
            control.WF_ID           = strWFID;
            control.WF_INST_TASK_ID = detail.ID;
            control.WF_NOTE         = flow.WF_NOTE;
            control.WF_PRIORITY     = TWfCommDict.WfPriority.Priority_1;
            control.WF_SERIAL_NO    = detail.WF_SERIAL_NO;
            control.WF_SERVICE_CODE = strServiceCode;
            control.WF_SERVICE_NAME = strServiceName;
            control.WF_STARTTIME    = detail.INST_TASK_STARTTIME;
            control.WF_STATE        = TWfCommDict.WfState.StateNormal;
            control.WF_TASK_ID      = detail.WF_TASK_ID;

            bool bIsDetail  = this.Create(detail);
            bool bIsControl = new TWfInstControlLogic().Create(control);

            return(bIsDetail & bIsControl);
        }
예제 #10
0
 /// <summary>
 /// 获取对象List
 /// </summary>
 /// <param name="tWfInstControl">对象</param>
 /// <param name="iIndex">起始页码</param>
 /// <param name="iCount">每页数目</param>
 /// <returns>返回结果</returns>
 public List <TWfInstControlVo> SelectByObject(TWfInstControlVo tWfInstControl, int iIndex, int iCount)
 {
     return(access.SelectByObject(tWfInstControl, iIndex, iCount));
 }
예제 #11
0
 /// <summary>
 /// 对象明细
 /// </summary>
 /// <param name="tWfInstControl">对象条件</param>
 /// <returns>对象</returns>
 public TWfInstControlVo Details(TWfInstControlVo tWfInstControl)
 {
     return(access.Details(tWfInstControl));
 }
예제 #12
0
 /// <summary>
 /// 获得查询结果总行数,用于分页
 /// </summary>
 /// <param name="tWfInstControl">对象</param>
 /// <returns>返回行数</returns>
 public int GetSelectResultCount(TWfInstControlVo tWfInstControl)
 {
     return(access.GetSelectResultCount(tWfInstControl));
 }
예제 #13
0
 public TWfInstControlLogic(TWfInstControlVo _tWfInstControl)
 {
     tWfInstControl = _tWfInstControl;
     access         = new TWfInstControlAccess();
 }
예제 #14
0
 /// <summary>
 /// 对象删除
 /// </summary>
 /// <param name="Id">ID</param>
 /// <returns>是否成功</returns>
 public bool Delete(TWfInstControlVo tWfInstControl)
 {
     return(access.Delete(tWfInstControl));
 }
예제 #15
0
 /// <summary>
 /// 对象编辑
 /// </summary>
 /// <param name="tWfInstControl_UpdateSet">UpdateSet用户对象</param>
 /// <param name="tWfInstControl_UpdateWhere">UpdateWhere用户对象</param>
 /// <returns>是否成功</returns>
 public bool Edit(TWfInstControlVo tWfInstControl_UpdateSet, TWfInstControlVo tWfInstControl_UpdateWhere)
 {
     return(access.Edit(tWfInstControl_UpdateSet, tWfInstControl_UpdateWhere));
 }
예제 #16
0
        /// <summary>
        /// 获得查询结果总行数,用于分页
        /// </summary>
        /// <param name="tWfInstControl">对象</param>
        /// <returns>返回行数</returns>
        public int GetSelectResultCount(TWfInstControlVo tWfInstControl)
        {
            string strSQL = "select Count(*) from T_WF_INST_CONTROL " + this.BuildWhereStatement(tWfInstControl);

            return(Convert.ToInt32(SqlHelper.ExecuteScalar(strSQL)));
        }
예제 #17
0
 /// <summary>
 /// 对象添加
 /// </summary>
 /// <param name="sysRole">对象</param>
 /// <returns>是否成功</returns>
 public bool Create(TWfInstControlVo tWfInstControl)
 {
     return(access.Create(tWfInstControl));
 }
예제 #18
0
 /// <summary>
 /// 根据对象特征获取单一对象
 /// </summary>
 /// <param name="tWfInstControl">对象</param>
 /// <returns></returns>
 public TWfInstControlVo SelectByObject(TWfInstControlVo tWfInstControl)
 {
     return(access.SelectByObject(tWfInstControl));
 }
예제 #19
0
 /// <summary>
 /// 根据对象获取全部数据,用Table承载
 ///  数据量较小时使用【不推荐】
 /// </summary>
 /// <param name="tWfInstControl"></param>
 /// <returns></returns>
 public DataTable SelectByTable(TWfInstControlVo tWfInstControl)
 {
     return(access.SelectByTable(tWfInstControl));
 }
예제 #20
0
        /// <summary>
        /// 根据对象获取全部数据,用Table承载
        ///  数据量较小时使用【不推荐】
        /// </summary>
        /// <param name="tWfInstControl"></param>
        /// <returns></returns>
        public DataTable SelectByTable(TWfInstControlVo tWfInstControl)
        {
            string strSQL = "select * from T_WF_INST_CONTROL " + this.BuildWhereStatement(tWfInstControl);

            return(SqlHelper.ExecuteDataTable(strSQL));
        }
예제 #21
0
        /// <summary>
        /// 对象添加
        /// </summary>
        /// <param name="tWfInstControl">对象</param>
        /// <returns>是否成功</returns>
        public bool Create(TWfInstControlVo tWfInstControl)
        {
            string strSQL = SqlHelper.BuildInsertExpress(tWfInstControl, TWfInstControlVo.T_WF_INST_CONTROL_TABLE);

            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
예제 #22
0
        /// <summary>
        /// 获取对象List
        /// </summary>
        /// <param name="tWfInstControl">对象</param>
        /// <param name="iIndex">起始页码</param>
        /// <param name="iCount">每页数目</param>
        /// <returns>返回结果</returns>
        public List <TWfInstControlVo> SelectByObject(TWfInstControlVo tWfInstControl, int iIndex, int iCount)
        {
            string strSQL = String.Format("select * from  T_WF_INST_CONTROL " + this.BuildWhereStatement(tWfInstControl));

            return(SqlHelper.ExecuteObjectList(tWfInstControl, BuildPagerExpress(strSQL, iIndex, iCount)));
        }
예제 #23
0
        /// <summary>
        /// 对象明细
        /// </summary>
        /// <param name="tWfInstControl">对象条件</param>
        /// <returns>对象</returns>
        public TWfInstControlVo Details(TWfInstControlVo tWfInstControl)
        {
            string strSQL = String.Format("select * from  T_WF_INST_CONTROL " + this.BuildWhereStatement(tWfInstControl));

            return(SqlHelper.ExecuteObject(new TWfInstControlVo(), strSQL));
        }
예제 #24
0
 /// <summary>
 /// 获取对象DataTable【主要用户销毁实例流程使用】
 /// </summary>
 /// <param name="tWfInstControl">对象</param>
 /// <param name="iIndex">起始页码</param>
 /// <param name="iCount">每页数目</param>
 /// <returns>返回结果</returns>
 public DataTable SelectByTableForClear(TWfInstControlVo tWfInstControl, int iIndex, int iCount)
 {
     return(access.SelectByTableForClear(tWfInstControl, iIndex, iCount));
 }
예제 #25
0
 /// <summary>
 /// 对象编辑
 /// </summary>
 /// <param name="tWfInstControl">用户对象</param>
 /// <returns>是否成功</returns>
 public bool Edit(TWfInstControlVo tWfInstControl)
 {
     return(access.Edit(tWfInstControl));
 }
예제 #26
0
        /// <summary>
        /// 根据对象构造条件语句
        /// </summary>
        /// <param name="tWfInstControl"></param>
        /// <returns></returns>
        public string BuildWhereStatement(TWfInstControlVo tWfInstControl)
        {
            StringBuilder strWhereStatement = new StringBuilder(" Where 1=1 ");

            if (null != tWfInstControl)
            {
                //流程实例编号
                if (!String.IsNullOrEmpty(tWfInstControl.ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND ID = '{0}'", tWfInstControl.ID.ToString()));
                }
                //流程编号
                if (!String.IsNullOrEmpty(tWfInstControl.WF_ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND WF_ID = '{0}'", tWfInstControl.WF_ID.ToString()));
                }
                //流水号
                if (!String.IsNullOrEmpty(tWfInstControl.WF_SERIAL_NO.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND WF_SERIAL_NO = '{0}'", tWfInstControl.WF_SERIAL_NO.ToString()));
                }
                //当前环节编号
                if (!String.IsNullOrEmpty(tWfInstControl.WF_TASK_ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND WF_TASK_ID = '{0}'", tWfInstControl.WF_TASK_ID.ToString()));
                }
                //当前实例环节编号
                if (!String.IsNullOrEmpty(tWfInstControl.WF_INST_TASK_ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND WF_INST_TASK_ID = '{0}'", tWfInstControl.WF_INST_TASK_ID.ToString()));
                }
                //流程简述
                if (!String.IsNullOrEmpty(tWfInstControl.WF_CAPTION.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND WF_CAPTION = '{0}'", tWfInstControl.WF_CAPTION.ToString()));
                }
                //流程备注
                if (!String.IsNullOrEmpty(tWfInstControl.WF_NOTE.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND WF_NOTE = '{0}'", tWfInstControl.WF_NOTE.ToString()));
                }

                //业务编码
                if (!String.IsNullOrEmpty(tWfInstControl.WF_SERVICE_CODE.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND WF_SERVICE_CODE = '{0}'", tWfInstControl.WF_SERVICE_CODE.ToString()));
                }
                //业务名称
                if (!String.IsNullOrEmpty(tWfInstControl.WF_SERVICE_NAME.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND WF_SERVICE_NAME = '{0}'", tWfInstControl.WF_SERVICE_NAME.ToString()));
                }
                //优先级
                if (!String.IsNullOrEmpty(tWfInstControl.WF_PRIORITY.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND WF_PRIORITY = '{0}'", tWfInstControl.WF_PRIORITY.ToString()));
                }
                //流程状态
                if (!String.IsNullOrEmpty(tWfInstControl.WF_STATE.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND WF_STATE = '{0}'", tWfInstControl.WF_STATE.ToString()));
                }
                //开始时间
                if (!String.IsNullOrEmpty(tWfInstControl.WF_STARTTIME.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND WF_STARTTIME = '{0}'", tWfInstControl.WF_STARTTIME.ToString()));
                }
                //约定结束时间
                if (!String.IsNullOrEmpty(tWfInstControl.WF_ENDTIME.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND WF_ENDTIME = '{0}'", tWfInstControl.WF_ENDTIME.ToString()));
                }
                //挂起时间
                if (!String.IsNullOrEmpty(tWfInstControl.WF_SUSPEND_TIME.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND WF_SUSPEND_TIME = '{0}'", tWfInstControl.WF_SUSPEND_TIME.ToString()));
                }
                //挂起状态
                if (!String.IsNullOrEmpty(tWfInstControl.WF_SUSPEND_STATE.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND WF_SUSPEND_STATE = '{0}'", tWfInstControl.WF_SUSPEND_STATE.ToString()));
                }
                //挂起的结束时间
                if (!String.IsNullOrEmpty(tWfInstControl.WF_SUSPEND_ENDTIME.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND WF_SUSPEND_ENDTIME = '{0}'", tWfInstControl.WF_SUSPEND_ENDTIME.ToString()));
                }
                //是否子流程
                if (!String.IsNullOrEmpty(tWfInstControl.IS_SUB_FLOW.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND IS_SUB_FLOW = '{0}'", tWfInstControl.IS_SUB_FLOW.ToString()));
                }
                //父流程实例编号
                if (!String.IsNullOrEmpty(tWfInstControl.PARENT_INST_FLOW_ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND PARENT_INST_FLOW_ID = '{0}'", tWfInstControl.PARENT_INST_FLOW_ID.ToString()));
                }
                //父流程编号
                if (!String.IsNullOrEmpty(tWfInstControl.PARENT_FLOW_ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND PARENT_FLOW_ID = '{0}'", tWfInstControl.PARENT_FLOW_ID.ToString()));
                }
                //父流程环节实例编号
                if (!String.IsNullOrEmpty(tWfInstControl.PARENT_INST_TASK_ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND PARENT_INST_TASK_ID = '{0}'", tWfInstControl.PARENT_INST_TASK_ID.ToString()));
                }
                //父流程环节编号
                if (!String.IsNullOrEmpty(tWfInstControl.PARENT_TASK_ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND PARENT_TASK_ID = '{0}'", tWfInstControl.PARENT_TASK_ID.ToString()));
                }
                //其他备注
                if (!String.IsNullOrEmpty(tWfInstControl.REMARK.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK = '{0}'", tWfInstControl.REMARK.ToString()));
                }
            }
            return(strWhereStatement.ToString());
        }