public int Update(BaseUserInfo userInfo, BaseWorkFlowProcessEntity workFlowProcessEntity, out string statusCode, out string statusMessage) { // 写入调试信息 #if (DEBUG) int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod()); #endif // 加强安全验证防止未授权匿名调用 #if (!DEBUG) LogOnService.UserIsLogOn(userInfo); #endif statusCode = string.Empty; statusMessage = string.Empty; int returnValue = 0; using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.WorkFlowDbType)) { try { dbHelper.Open(WorkFlowDbConnection); BaseWorkFlowProcessManager workFlowManager = new BaseWorkFlowProcessManager(dbHelper, userInfo); returnValue = workFlowManager.Update(workFlowProcessEntity, out statusCode); // 获得状态消息 statusMessage = workFlowManager.GetStateMessage(statusCode); BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, MethodBase.GetCurrentMethod()); } catch (Exception ex) { BaseExceptionManager.LogException(dbHelper, userInfo, ex); throw ex; } finally { dbHelper.Close(); } } // 写入调试信息 #if (DEBUG) BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart); #endif return(returnValue); }
public int Update(BaseUserInfo userInfo, BaseWorkFlowProcessEntity entity, out string statusCode, out string statusMessage) { int result = 0; string returnCode = string.Empty; string returnMessage = string.Empty; var parameter = ServiceInfo.Create(userInfo, MethodBase.GetCurrentMethod()); ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, (dbHelper) => { var workFlowManager = new BaseWorkFlowProcessManager(dbHelper, userInfo); result = workFlowManager.Update(entity, out returnCode); // 获得状态消息 returnMessage = workFlowManager.GetStateMessage(returnCode); }); statusCode = returnCode; statusMessage = returnMessage; return(result); }