/// <summary> /// 添加员工 /// </summary> /// <param name="userInfo">用户</param> /// <param name="staffEntity">实体</param> /// <param name="statusCode">返回状态码</param> /// <param name="statusMessage">返回状消息</param> /// <returns>主键</returns> public string AddStaff(BaseUserInfo userInfo, BaseStaffEntity staffEntity, out string statusCode, out string statusMessage) { // 写入调试信息 #if (DEBUG) int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod()); #endif // 加强安全验证防止未授权匿名调用 #if (!DEBUG) LogOnService.UserIsLogOn(userInfo); #endif string returnValue = string.Empty; using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType)) { try { dbHelper.Open(UserCenterDbConnection); // 1.若添加用户成功,添加员工。 BaseStaffManager staffManager = new BaseStaffManager(dbHelper, userInfo); returnValue = staffManager.Add(staffEntity, out statusCode); statusMessage = staffManager.GetStateMessage(statusCode); // 2.自己不用给自己发提示信息,这个提示信息是为了提高工作效率的 BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, AppMessage.StaffService_AddStaff, 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; }