/// <summary> /// 读取指定审批流程步骤数据 /// </summary> /// <param name="nId">步骤编码</param> /// <param name="nOpStaffId">操作员工编码</param> /// <param name="strOpStaffName">操作员工姓名</param> /// <param name="strErrText">出错信息</param> /// <returns></returns> public ApproveFlowStep LoadApproveFlowStep(long nId, long nOpStaffId, string strOpStaffName, out string strErrText) { ApproveFlowStep data; try { using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TimeSpan(2, 0, 0))) { using (FlowDAO dao = new FlowDAO()) { data = dao.LoadApproveFlowStep(nId, nOpStaffId, strOpStaffName, out strErrText); if (data == null) { return null; } } transScope.Complete(); } return data; } catch (Exception e) { strErrText = e.Message; return null; } }
/// <summary> /// 上移指定流程步骤数据 /// </summary> /// <param name="nId">步骤编码</param> /// <param name="nOpStaffId">操作员工编码</param> /// <param name="strOpStaffName">操作员工姓名</param> /// <param name="strErrText">出错信息</param> /// <returns></returns> public bool MoveUpApproveStep(long nId, long nOpStaffId, string strOpStaffName, out string strErrText) { try { using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TimeSpan(2, 0, 0))) { using (FlowDAO dao = new FlowDAO()) { //读取步骤数据 ApproveFlowStep data = dao.LoadApproveFlowStep(nId, nOpStaffId, strOpStaffName, out strErrText); if (data == null) { return false; } //调整当前步骤序号 int nStepNum = data.StepNum; if (nStepNum > 1) nStepNum--; data.StepNum = nStepNum; //修改步骤数据 if (!dao.UpdateApproveFlowStep(data, nOpStaffId, strOpStaffName, out strErrText)) { return false; } } transScope.Complete(); } return true; } catch (Exception e) { strErrText = e.Message; return false; } }