/// <summary>
        /// 对象编辑
        /// </summary>
        /// <param name="tWfInstTaskService">用户对象</param>
        /// <returns>是否成功</returns>
        public bool Edit(TWfInstTaskServiceVo tWfInstTaskService)
        {
            string strSQL = SqlHelper.BuildUpdateExpress(tWfInstTaskService, TWfInstTaskServiceVo.T_WF_INST_TASK_SERVICE_TABLE);

            strSQL += string.Format(" where ID='{0}' ", tWfInstTaskService.ID);
            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
        /// <summary>
        /// 对象编辑
        /// </summary>
        /// <param name="tWfInstTaskService_UpdateSet">UpdateSet用户对象</param>
        /// <param name="tWfInstTaskService_UpdateWhere">UpdateWhere用户对象</param>
        /// <returns>是否成功</returns>
        public bool Edit(TWfInstTaskServiceVo tWfInstTaskService_UpdateSet, TWfInstTaskServiceVo tWfInstTaskService_UpdateWhere)
        {
            string strSQL = SqlHelper.BuildUpdateExpress(tWfInstTaskService_UpdateSet, TWfInstTaskServiceVo.T_WF_INST_TASK_SERVICE_TABLE);

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

            strSQL = String.Format(strSQL, BuildWhereStatement(tWfInstTaskService));
            return(SqlHelper.ExecuteDataTable(BuildPagerExpress(strSQL, iIndex, iCount)));
        }
        /// <summary>
        /// 对象删除
        /// </summary>
        /// <param name="Id">ID</param>
        /// <returns>是否成功</returns>
        public bool Delete(TWfInstTaskServiceVo tWfInstTaskService)
        {
            string strSQL = "delete from T_WF_INST_TASK_SERVICE ";

            strSQL += this.BuildWhereStatement(tWfInstTaskService);

            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
        /// <summary>
        /// 根据对象构造条件语句
        /// </summary>
        /// <param name="tWfInstTaskService"></param>
        /// <returns></returns>
        public string BuildWhereStatement(TWfInstTaskServiceVo tWfInstTaskService)
        {
            StringBuilder strWhereStatement = new StringBuilder(" Where 1=1 ");

            if (null != tWfInstTaskService)
            {
                //编号
                if (!String.IsNullOrEmpty(tWfInstTaskService.ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND ID = '{0}'", tWfInstTaskService.ID.ToString()));
                }
                //环节实例编号
                if (!String.IsNullOrEmpty(tWfInstTaskService.WF_INST_TASK_ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND WF_INST_TASK_ID = '{0}'", tWfInstTaskService.WF_INST_TASK_ID.ToString()));
                }
                //流程实例编号
                if (!String.IsNullOrEmpty(tWfInstTaskService.WF_INST_ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND WF_INST_ID = '{0}'", tWfInstTaskService.WF_INST_ID.ToString()));
                }
                //业务编号
                if (!String.IsNullOrEmpty(tWfInstTaskService.SERVICE_NAME.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND SERVICE_NAME = '{0}'", tWfInstTaskService.SERVICE_NAME.ToString()));
                }
                //业务单类型
                if (!String.IsNullOrEmpty(tWfInstTaskService.SERVICE_KEY_NAME.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND SERVICE_KEY_NAME = '{0}'", tWfInstTaskService.SERVICE_KEY_NAME.ToString()));
                }
                //业务单主键值
                if (!String.IsNullOrEmpty(tWfInstTaskService.SERVICE_KEY_VALUE.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND SERVICE_KEY_VALUE = '{0}'", tWfInstTaskService.SERVICE_KEY_VALUE.ToString()));
                }
                //联合单据分组
                if (!String.IsNullOrEmpty(tWfInstTaskService.SERVICE_ROW_SIGN.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND SERVICE_ROW_SIGN = '{0}'", tWfInstTaskService.SERVICE_ROW_SIGN.ToString()));
                }
            }
            return(strWhereStatement.ToString());
        }
        /// <summary>
        /// 对象添加
        /// </summary>
        /// <param name="tWfInstTaskService">对象</param>
        /// <returns>是否成功</returns>
        public bool Create(TWfInstTaskServiceVo tWfInstTaskService)
        {
            string strSQL = SqlHelper.BuildInsertExpress(tWfInstTaskService, TWfInstTaskServiceVo.T_WF_INST_TASK_SERVICE_TABLE);

            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
예제 #7
0
 /// <summary>
 /// 对象添加
 /// </summary>
 /// <param name="sysRole">对象</param>
 /// <returns>是否成功</returns>
 public bool Create(TWfInstTaskServiceVo tWfInstTaskService)
 {
     return(access.Create(tWfInstTaskService));
 }
        /// <summary>
        /// 对象明细
        /// </summary>
        /// <param name="tWfInstTaskService">对象条件</param>
        /// <returns>对象</returns>
        public TWfInstTaskServiceVo Details(TWfInstTaskServiceVo tWfInstTaskService)
        {
            string strSQL = String.Format("select * from  T_WF_INST_TASK_SERVICE " + this.BuildWhereStatement(tWfInstTaskService));

            return(SqlHelper.ExecuteObject(new TWfInstTaskServiceVo(), strSQL));
        }
예제 #9
0
 /// <summary>
 /// 获取对象List
 /// </summary>
 /// <param name="tWfInstTaskService">对象</param>
 /// <param name="iIndex">起始页码</param>
 /// <param name="iCount">每页数目</param>
 /// <returns>返回结果</returns>
 public List <TWfInstTaskServiceVo> SelectByObject(TWfInstTaskServiceVo tWfInstTaskService, int iIndex, int iCount)
 {
     return(access.SelectByObject(tWfInstTaskService, iIndex, iCount));
 }
예제 #10
0
 /// <summary>
 /// 对象明细
 /// </summary>
 /// <param name="tWfInstTaskService">对象条件</param>
 /// <returns>对象</returns>
 public TWfInstTaskServiceVo Details(TWfInstTaskServiceVo tWfInstTaskService)
 {
     return(access.Details(tWfInstTaskService));
 }
예제 #11
0
 /// <summary>
 /// 获得查询结果总行数,用于分页
 /// </summary>
 /// <param name="tWfInstTaskService">对象</param>
 /// <returns>返回行数</returns>
 public int GetSelectResultCount(TWfInstTaskServiceVo tWfInstTaskService)
 {
     return(access.GetSelectResultCount(tWfInstTaskService));
 }
예제 #12
0
 public TWfInstTaskServiceLogic(TWfInstTaskServiceVo _tWfInstTaskService)
 {
     tWfInstTaskService = _tWfInstTaskService;
     access             = new TWfInstTaskServiceAccess();
 }
예제 #13
0
 /// <summary>
 /// 对象删除
 /// </summary>
 /// <param name="Id">ID</param>
 /// <returns>是否成功</returns>
 public bool Delete(TWfInstTaskServiceVo tWfInstTaskService)
 {
     return(access.Delete(tWfInstTaskService));
 }
예제 #14
0
 /// <summary>
 /// 对象编辑
 /// </summary>
 /// <param name="tWfInstTaskService_UpdateSet">UpdateSet用户对象</param>
 /// <param name="tWfInstTaskService_UpdateWhere">UpdateWhere用户对象</param>
 /// <returns>是否成功</returns>
 public bool Edit(TWfInstTaskServiceVo tWfInstTaskService_UpdateSet, TWfInstTaskServiceVo tWfInstTaskService_UpdateWhere)
 {
     return(access.Edit(tWfInstTaskService_UpdateSet, tWfInstTaskService_UpdateWhere));
 }
예제 #15
0
 /// <summary>
 /// 对象编辑
 /// </summary>
 /// <param name="tWfInstTaskService">用户对象</param>
 /// <returns>是否成功</returns>
 public bool Edit(TWfInstTaskServiceVo tWfInstTaskService)
 {
     return(access.Edit(tWfInstTaskService));
 }
예제 #16
0
 /// <summary>
 /// 获取对象DataTable
 /// </summary>
 /// <param name="tWfInstTaskService">对象</param>
 /// <param name="iIndex">起始页码</param>
 /// <param name="iCount">每页数目</param>
 /// <returns>返回结果</returns>
 public DataTable SelectByTable(TWfInstTaskServiceVo tWfInstTaskService, int iIndex, int iCount)
 {
     return(access.SelectByTable(tWfInstTaskService, iIndex, iCount));
 }
        /// <summary>
        /// 获得查询结果总行数,用于分页
        /// </summary>
        /// <param name="tWfInstTaskService">对象</param>
        /// <returns>返回行数</returns>
        public int GetSelectResultCount(TWfInstTaskServiceVo tWfInstTaskService)
        {
            string strSQL = "select Count(*) from T_WF_INST_TASK_SERVICE " + this.BuildWhereStatement(tWfInstTaskService);

            return(Convert.ToInt32(SqlHelper.ExecuteScalar(strSQL)));
        }
예제 #18
0
 /// <summary>
 /// 根据对象获取全部数据,用Table承载
 ///  数据量较小时使用【不推荐】
 /// </summary>
 /// <param name="tWfInstTaskService"></param>
 /// <returns></returns>
 public DataTable SelectByTable(TWfInstTaskServiceVo tWfInstTaskService)
 {
     return(access.SelectByTable(tWfInstTaskService));
 }
        /// <summary>
        /// 获取对象List
        /// </summary>
        /// <param name="tWfInstTaskService">对象</param>
        /// <param name="iIndex">起始页码</param>
        /// <param name="iCount">每页数目</param>
        /// <returns>返回结果</returns>
        public List <TWfInstTaskServiceVo> SelectByObject(TWfInstTaskServiceVo tWfInstTaskService, int iIndex, int iCount)
        {
            string strSQL = String.Format("select * from  T_WF_INST_TASK_SERVICE " + this.BuildWhereStatement(tWfInstTaskService));

            return(SqlHelper.ExecuteObjectList(tWfInstTaskService, BuildPagerExpress(strSQL, iIndex, iCount)));
        }
        /// <summary>
        ///  流程实例返元的处理方法
        /// </summary>
        /// <param name="strID">实例流程的编号</param>
        /// <returns></returns>
        protected bool WFOperateGoStart(string strID)
        { //具有返元权限的操作人员可以做
            TWfInstTaskDetailLogic     instTaskLogic = new TWfInstTaskDetailLogic();
            List <TWfInstTaskDetailVo> taskInstList  = instTaskLogic.SelectByObject(new TWfInstTaskDetailVo()
            {
                WF_INST_ID = strID
            }, 0, 100);

            //如果指定的流程无实际的节点,则返回
            if (taskInstList.Count < 1)
            {
                return(false);
            }
            TWfInstTaskDetailVo     taskInstFirst   = taskInstList[0];
            TWfInstTaskDetailVo     taskInstLast    = taskInstList[taskInstList.Count - 1];
            List <TWfSettingTaskVo> taskSettingList = new TWfSettingTaskLogic().SelectByObjectListForSetp(new TWfSettingTaskVo()
            {
                WF_ID = taskInstFirst.WF_ID
            });
            TWfInstControlVo wfInst = new TWfInstControlLogic().Details(taskInstFirst.WF_INST_ID);

            //如果配置信息没有任何节点,则返回
            if (taskSettingList.Count < 1)
            {
                return(false);
            }

            TWfInstTaskDetailVo taskNew = new TWfInstTaskDetailVo();

            taskNew.ID                  = this.GetGUID();
            taskNew.INST_NOTE           = taskSettingList[0].TASK_NOTE;
            taskNew.INST_TASK_CAPTION   = taskSettingList[0].TASK_CAPTION;
            taskNew.INST_TASK_STARTTIME = this.GetDateTimeToStanString();
            taskNew.INST_TASK_STATE     = TWfCommDict.StepState.StateNormal;
            taskNew.OBJECT_USER         = taskInstFirst.OBJECT_USER; //使用上环节的目标处理人
            taskNew.PRE_INST_TASK_ID    = taskInstLast.ID;           //上一个环节的编号,将成为本环节的上环节编号
            //返元的所有新节点的前一个节点肯定是空的,直接置空即可
            //taskNew.PRE_TASK_ID = i3.ValueObject.ConstValues.SpecialCharacter.EmptyValuesFillChar;
            taskNew.WF_ID        = taskSettingList[0].WF_ID;
            taskNew.WF_INST_ID   = taskInstFirst.WF_INST_ID;
            taskNew.WF_SERIAL_NO = taskInstFirst.WF_SERIAL_NO;
            taskNew.WF_TASK_ID   = taskSettingList[0].ID;

            //将原环节表的标志位更新为完成
            taskInstLast.INST_TASK_ENDTIME    = this.GetDateTimeToStanString();
            taskInstLast.INST_TASK_STATE      = TWfCommDict.StepState.StateDown;
            taskInstLast.INST_TASK_DEAL_STATE = TWfCommDict.StepDealState.ForToZero;
            taskInstLast.REAL_USER            = (this.Page as PageBase).LogInfo.UserInfo.ID;

            //环节表更新完毕,接着更新控制表
            //更新控制表信息
            //退回时要把附件和评论信息放入数据库,业务数据也要全部退回
            //写入流程产生的新数据

            instTaskLogic.Create(taskNew);
            instTaskLogic.Edit(new TWfInstTaskDetailVo()
            {
                ID = taskInstLast.ID,
                INST_TASK_ENDTIME    = taskInstLast.INST_TASK_ENDTIME,
                INST_TASK_STATE      = taskInstLast.INST_TASK_STATE,
                INST_TASK_DEAL_STATE = taskInstLast.INST_TASK_DEAL_STATE,
                REAL_USER            = taskInstLast.REAL_USER
            });
            TWfInstControlLogic instWFLogic = new TWfInstControlLogic();

            instWFLogic.Edit(new TWfInstControlVo()
            {
                ID = wfInst.ID,
                WF_INST_TASK_ID = taskNew.ID,
                WF_TASK_ID      = taskNew.WF_TASK_ID
            });

            //附件和评论都无效

            //业务数据直接copy第一个节点时的数据即可
            TWfInstTaskServiceLogic     serviceLogic   = new TWfInstTaskServiceLogic();
            List <TWfInstTaskServiceVo> serviceList    = new List <TWfInstTaskServiceVo>();
            List <TWfInstTaskServiceVo> serviceOldList = new TWfInstTaskServiceLogic().SelectByObject(new TWfInstTaskServiceVo()
            {
                WF_INST_ID = taskInstFirst.WF_INST_ID, WF_INST_TASK_ID = taskInstFirst.ID
            }, 0, 100);

            if (null != serviceOldList)
            {
                foreach (TWfInstTaskServiceVo service in serviceOldList)
                {
                    //增加ID,流程实例编号、环节实例编号等内容,业务代码,Key和Value由业务系统自己处理
                    TWfInstTaskServiceVo stemp = new TWfInstTaskServiceVo();
                    stemp.ID                = this.GetGUID();
                    stemp.WF_INST_ID        = wfInst.ID;
                    stemp.WF_INST_TASK_ID   = taskNew.ID;
                    stemp.SERVICE_NAME      = service.SERVICE_NAME;
                    stemp.SERVICE_KEY_NAME  = service.SERVICE_KEY_NAME;
                    stemp.SERVICE_KEY_VALUE = service.SERVICE_KEY_VALUE;
                    stemp.SERVICE_ROW_SIGN  = service.SERVICE_ROW_SIGN;
                    serviceList.Add(stemp);
                }
            }

            foreach (TWfInstTaskServiceVo serviceTemp in serviceList)
            {
                serviceLogic.Create(serviceTemp);
            }

            return(true);
        }
        /// <summary>
        /// 根据对象获取全部数据,用Table承载
        ///  数据量较小时使用【不推荐】
        /// </summary>
        /// <param name="tWfInstTaskService"></param>
        /// <returns></returns>
        public DataTable SelectByTable(TWfInstTaskServiceVo tWfInstTaskService)
        {
            string strSQL = "select * from T_WF_INST_TASK_SERVICE " + this.BuildWhereStatement(tWfInstTaskService);

            return(SqlHelper.ExecuteDataTable(strSQL));
        }
예제 #22
0
 /// <summary>
 /// 根据对象特征获取单一对象
 /// </summary>
 /// <param name="tWfInstTaskService">对象</param>
 /// <returns></returns>
 public TWfInstTaskServiceVo SelectByObject(TWfInstTaskServiceVo tWfInstTaskService)
 {
     return(access.SelectByObject(tWfInstTaskService));
 }