示例#1
0
        public DataTable GetByCode(BaseUserInfo userInfo, String code, out String statusCode, out String statusMessage)
        {
            // 写入调试信息
            #if (DEBUG)
            int milliStart = BaseBusinessLogic.Instance.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif
            statusCode    = String.Empty;
            statusMessage = String.Empty;

            DataTable myReturnDataTable = new DataTable(BaseOperationTable.TableName);
            IDbHelper dbHelper          = DbHelperFactory.GetHelper();
            try
            {
                dbHelper.Open();
                // 创建实现类
                BaseOperationDao myOperation = new BaseOperationDao(dbHelper, userInfo);
                myReturnDataTable = myOperation.GetByCode(code);
                // 获得状态消息
                statusMessage = myOperation.GetStateCodeMessage(statusCode);
                BaseLogDao.Instance.Add(dbHelper, userInfo, MethodBase.GetCurrentMethod());
            }
            catch (Exception exception)
            {
                BaseExceptionDao.Instance.LogException(dbHelper, userInfo, exception);
                throw exception;
            }
            finally
            {
                dbHelper.Close();
            }

            // 写入调试信息
            #if (DEBUG)
            BaseBusinessLogic.Instance.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif
            return(myReturnDataTable);
        }
示例#2
0
        public int Update(BaseUserInfo userInfo, BaseOperationEntity operationEntity, out String statusCode, out String statusMessage)
        {
            // 写入调试信息
            #if (DEBUG)
            int milliStart = BaseBusinessLogic.Instance.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif
            statusCode    = String.Empty;
            statusMessage = String.Empty;

            int       returnValue = 0;
            IDbHelper dbHelper    = DbHelperFactory.GetHelper();
            try
            {
                dbHelper.Open();
                BaseOperationDao myPermissionDao = new BaseOperationDao(dbHelper, userInfo);
                returnValue = myPermissionDao.Update(operationEntity, out statusCode);
                // 获得状态消息
                statusMessage = myPermissionDao.GetStateCodeMessage(statusCode);
                BaseLogDao.Instance.Add(dbHelper, userInfo, MethodBase.GetCurrentMethod());
            }
            catch (Exception exception)
            {
                BaseExceptionDao.Instance.LogException(dbHelper, userInfo, exception);
                throw exception;
            }
            finally
            {
                dbHelper.Close();
            }

            // 写入调试信息
            #if (DEBUG)
            BaseBusinessLogic.Instance.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif
            return(returnValue);
        }
示例#3
0
        public String AddByDetail(BaseUserInfo userInfo, String code, String fullName, out String statusCode, out String statusMessage)
        {
            // 写入调试信息
            #if (DEBUG)
            int milliStart = BaseBusinessLogic.Instance.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif
            statusCode    = String.Empty;
            statusMessage = String.Empty;

            String    returnValue = String.Empty;
            IDbHelper dbHelper    = DbHelperFactory.GetHelper();
            try
            {
                dbHelper.Open();
                BaseOperationDao myOperation = new BaseOperationDao(dbHelper, userInfo);
                returnValue = myOperation.AddByDetail(code, fullName, out statusCode);
                // 获得状态消息
                statusMessage = myOperation.GetStateCodeMessage(statusCode);
                BaseLogDao.Instance.Add(dbHelper, userInfo, MethodBase.GetCurrentMethod());
            }
            catch (Exception exception)
            {
                BaseExceptionDao.Instance.LogException(dbHelper, userInfo, exception);
                throw exception;
            }
            finally
            {
                dbHelper.Close();
            }

            // 写入调试信息
            #if (DEBUG)
            BaseBusinessLogic.Instance.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif
            return(returnValue);
        }
示例#4
0
        public String Add(BaseUserInfo userInfo, BaseOperationEntity operationEntity, out String statusCode, out String statusMessage)
        {
            // д�������Ϣ
            #if (DEBUG)
                int milliStart = BaseBusinessLogic.Instance.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif
            statusCode = String.Empty;
            statusMessage = String.Empty;

            String returnValue = String.Empty;
            IDbHelper dbHelper = DbHelperFactory.GetHelper();
            try
            {
                dbHelper.Open();
                BaseOperationDao myOperationDao = new BaseOperationDao(dbHelper, userInfo);
                returnValue = myOperationDao.Add(operationEntity, out statusCode);
                // ���״̬��Ϣ
                statusMessage = myOperationDao.GetStateCodeMessage(statusCode);
                BaseLogDao.Instance.Add(dbHelper, userInfo, MethodBase.GetCurrentMethod());
            }
            catch (Exception exception)
            {
                BaseExceptionDao.Instance.LogException(dbHelper, userInfo, exception);
                throw exception;
            }
            finally
            {
                dbHelper.Close();
            }

            // д�������Ϣ
            #if (DEBUG)
                BaseBusinessLogic.Instance.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif
            return returnValue;
        }
示例#5
0
        public DataTable GetByCode(BaseUserInfo userInfo, String code, out String statusCode, out String statusMessage)
        {
            // д�������Ϣ
            #if (DEBUG)
                int milliStart = BaseBusinessLogic.Instance.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif
            statusCode = String.Empty;
            statusMessage = String.Empty;

            DataTable myReturnDataTable = new DataTable(BaseOperationTable.TableName);
            IDbHelper dbHelper = DbHelperFactory.GetHelper();
            try
            {
                dbHelper.Open();
                // ����ʵ����
                BaseOperationDao myOperation = new BaseOperationDao(dbHelper, userInfo);
                myReturnDataTable = myOperation.GetByCode(code);
                // ���״̬��Ϣ
                statusMessage = myOperation.GetStateCodeMessage(statusCode);
                BaseLogDao.Instance.Add(dbHelper, userInfo, MethodBase.GetCurrentMethod());
            }
            catch (Exception exception)
            {
                BaseExceptionDao.Instance.LogException(dbHelper, userInfo, exception);
                throw exception;
            }
            finally
            {
                dbHelper.Close();
            }

            // д�������Ϣ
            #if (DEBUG)
                BaseBusinessLogic.Instance.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif
            return myReturnDataTable;
        }