Exemplo n.º 1
0
        public static ResultModel GetOperationLogList(QueryTerms queryTerms)
        {
            List<OperationLog> logList = new List<OperationLog>();
            int totalCount = 0;
            ResultModel result = new ResultModel();

            try
            {
                logList = (List<OperationLog>)(OperationLogDal.GetList(queryTerms));
                totalCount = Convert.ToInt32(OperationLogDal.GetTotalCount(queryTerms));

                result.Data = logList;
                result.DataSize = totalCount;
                result.IsSuccess = true;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETLIST_SUCCESS;

                return result;;
            }
            catch (Exception exception)
            {
                result.Data = logList;
                result.DataSize = totalCount;
                result.IsSuccess = true;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETLIST_ERROR;
                result.ResultMessage = exception.Message;
                return result;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据记录主键,删除指定记录。
        /// </summary>
        /// <param name="cardUserId">记录主键</param>
        /// <returns>删除结果,包括是否删除成功、记录主键等信息</returns>
        public static ResultModel Delete(string cardUserId)
        {
            OperationLog log = new OperationLog();
            ResultModel result = new ResultModel();
            try
            {
                log.OperationLogId = System.Guid.NewGuid().ToString("N");
                log.UserId = CurrentSession.getUser().UserId;
                log.OperationTypeCode = SymbolicConstant.OPERATIONTYPE_DELETE;
                log.OperationContent = SymbolicConstant.OPERATIONCONTENT_DELETE;
                log.AddTime = DateTime.Now;
                log.ObjectRecordId = cardUserId;
                log.OperationTable = typeof(CardUser).Name;
                log.IsSuccessId = SymbolicConstant.ISSUCCESS_TRUE;
                log.ResultCode = SymbolicConstant.RESULTCODE_DELETE_SUCCESS;
                log.ResultMessage=SymbolicConstant.RESULTMESSAGE_DELETE_SUCCESS;

                CardUser cardUser =(CardUser)GetCardUserById(cardUserId).Data;
                CardUserDal.Delete(cardUser);

                result.IsSuccess = true;
                result.ObjectRecordId = cardUserId;
                result.ResultCode = SymbolicConstant.RESULTCODE_DELETE_SUCCESS;
                result.ResultMessage = SymbolicConstant.RESULTMESSAGE_DELETE_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                log.IsSuccessId = SymbolicConstant.ISSUCCESS_FALSE;
                log.ResultCode = SymbolicConstant.RESULTCODE_DELETE_ERROR;
                log.ResultMessage=exception.Message;

                result.IsSuccess = false;
                result.ObjectRecordId = cardUserId;
                result.ResultCode = SymbolicConstant.RESULTCODE_DELETE_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
            finally
            {
                OperationLogBll.Insert(log);
            }
        }
Exemplo n.º 3
0
        public static ResultModel Delete(string operationLogId)
        {
            OperationLog log = new OperationLog();
            ResultModel result = new ResultModel();
            try
            {
                log = (OperationLog)GetOperationLogById(operationLogId).Data;
                OperationLogDal.Delete(log);
                result.IsSuccess = true;
                result.ObjectRecordId = log.OperationLogId;
                result.ResultCode = SymbolicConstant.RESULTCODE_DELETE_SUCCESS;
                return result;

            }
            catch (Exception e)
            {
                System.Console.Write(e.Message);
                result.ResultCode = SymbolicConstant.RESULTCODE_DELETE_ERROR;
                result.IsSuccess = false;
                return result;
            }
        }
Exemplo n.º 4
0
 public static ResultModel GetOperationLogById(string operationLogId)
 {
     OperationLog log = new OperationLog();
     ResultModel result = new ResultModel();
     try
     {
         log = OperationLogDal.GetModel(operationLogId);
         result.Data = log;
         result.DataSize = 1;
         result.IsSuccess = true;
         result.ResultCode = SymbolicConstant.RESULTCODE_GETMODEL_SUCCESS;
         return result;
     }
     catch (Exception exception)
     {
         result.Data = log;
         result.DataSize = 1;
         result.IsSuccess = false;
         result.ResultCode = SymbolicConstant.RESULTCODE_GETMODEL_ERROR;
         result.ResultMessage = exception.Message;
         return result;
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// 根据记录主键,删除指定记录。
        /// </summary>
        /// <param name="userId">记录主键</param>
        /// <param name="isLog">是否写入日志</param>
        /// <returns>删除结果,包括是否删除成功、记录主键等信息</returns>
        public static ResultModel Delete(string serviceItemId, bool isLog)
        {
            if (isLog)
                return Delete(serviceItemId);
            ResultModel result = new ResultModel();
            try
            {
                ServiceItem serviceItem =(ServiceItem)GetServiceItemById(serviceItemId).Data;
                ServiceItemDal.Delete(serviceItem);

                result.IsSuccess = true;
                result.ObjectRecordId = serviceItemId;
                result.ResultCode = SymbolicConstant.RESULTCODE_DELETE_SUCCESS;
                result.ResultMessage = SymbolicConstant.RESULTMESSAGE_DELETE_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                result.IsSuccess = false;
                result.ObjectRecordId = serviceItemId;
                result.ResultCode = SymbolicConstant.RESULTCODE_DELETE_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 修改某条记录
        /// </summary>
        /// <param name="user">要修改记录对应的实体</param>
        /// <returns>修改结果,包括是否修改成功、记录主键等信息</returns>
        public static ResultModel Update(ServiceItem serviceItem)
        {
            OperationLog log = new OperationLog();
            ResultModel result = new ResultModel();

            try
            {

                log.AddTime = DateTime.Now;
                log.IsSuccessId = SymbolicConstant.ISSUCCESS_TRUE;
                log.OperationLogId = System.Guid.NewGuid().ToString("N");
                log.OperationContent = SymbolicConstant.OPERATIONCONTENT_UPDATE;
                log.OperationTable = typeof(ServiceItem).Name;
                log.OperationTypeCode = SymbolicConstant.OPERATIONTYPE_UPDATE;
                log.ResultCode = SymbolicConstant.RESULTCODE_UPDATE_SUCCESS;
                log.ResultMessage=SymbolicConstant.RESULTMESSAGE_UPDATE_SUCCESS;
                log.UserId = CurrentSession.getUser().UserId;

                log.ObjectRecordId = serviceItem.ItemId;
                ServiceItemDal.Update(serviceItem);

                result.IsSuccess = true;
                result.ObjectRecordId = serviceItem.ItemId;
                result.ResultCode = SymbolicConstant.RESULTCODE_UPDATE_SUCCESS;
                result.ResultMessage = SymbolicConstant.RESULTMESSAGE_UPDATE_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                log.ResultCode = SymbolicConstant.RESULTCODE_UPDATE_ERROR;
                log.IsSuccessId = SymbolicConstant.ISSUCCESS_FALSE;
                log.ResultMessage=exception.Message;

                result.IsSuccess = false;
                result.ObjectRecordId =serviceItem.ItemId;
                result.ResultCode = SymbolicConstant.RESULTCODE_UPDATE_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
            finally
            {
                OperationLogBll.Insert(log);
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// 修改某条记录
        /// </summary>
        /// <param name="user">要修改记录对应的实体</param>
        /// <param name="isLog">是否写入日志</param>
        /// <returns>修改结果,包括是否修改成功、记录主键等信息</returns>
        public static ResultModel Update(ServiceItem serviceItem, bool isLog)
        {
            if (isLog)
                return Update(serviceItem);

            ResultModel result = new ResultModel();

            try
            {
                ServiceItemDal.Update(serviceItem);

                result.IsSuccess = true;
                result.ObjectRecordId = serviceItem.ItemId;
                result.ResultCode = SymbolicConstant.RESULTCODE_UPDATE_SUCCESS;
                result.ResultMessage = SymbolicConstant.RESULTMESSAGE_UPDATE_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                result.IsSuccess = false;
                result.ObjectRecordId =serviceItem.ItemId;
                result.ResultCode = SymbolicConstant.RESULTCODE_UPDATE_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 修改某条记录
        /// </summary>
        /// <param name="user">要修改记录对应的实体</param>
        /// <param name="isLog">是否写入日志</param>
        /// <returns>修改结果,包括是否修改成功、记录主键等信息</returns>
        public static ResultModel Update(Dictionary dictionary, bool isLog)
        {
            if (isLog)
                return Update(dictionary);

            ResultModel result = new ResultModel();

            try
            {
                DictionaryDal.Update(dictionary);

                result.IsSuccess = true;
                result.ObjectRecordId = dictionary.DictId;
                result.ResultCode = SymbolicConstant.RESULTCODE_UPDATE_SUCCESS;
                result.ResultMessage = SymbolicConstant.RESULTMESSAGE_UPDATE_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                result.IsSuccess = false;
                result.ObjectRecordId =dictionary.DictId;
                result.ResultCode = SymbolicConstant.RESULTCODE_UPDATE_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// 根据主键查询指定记录
        /// </summary>
        /// <param name="serviceItemId">主键</param>
        /// <param name="isLog">是否写入日志</param>
        /// <returns>查询结果,封装了查询出的实体</returns>
        public static ResultModel GetServiceItemById(string serviceItemId, bool isLog)
        {
            if (isLog)
                return GetServiceItemById(serviceItemId);
            ServiceItem serviceItem = new ServiceItem();
            ResultModel result = new ResultModel();

            try
            {
                serviceItem= ServiceItemDal.GetModel(serviceItemId);
                result.Data =  serviceItem;
                result.IsSuccess = true;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETMODEL_SUCCESS;
                result.ResultMessage=SymbolicConstant.RESULTMESSAGE_GETMODEL_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                result.IsSuccess = false;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETMODEL_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// 根据主键查询指定记录
        /// </summary>
        /// <param name="cardUserId">主键</param>
        /// <param name="isLog">是否写入日志</param>
        /// <returns>查询结果,封装了查询出的实体</returns>
        public static ResultModel GetCardUserById(string cardUserId, bool isLog)
        {
            if (isLog)
                return GetCardUserById(cardUserId);
            CardUser cardUser = new CardUser();
            ResultModel result = new ResultModel();

            try
            {
                cardUser= CardUserDal.GetModel(cardUserId);
                result.Data =  cardUser;
                result.IsSuccess = true;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETMODEL_SUCCESS;
                result.ResultMessage=SymbolicConstant.RESULTMESSAGE_GETMODEL_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                result.IsSuccess = false;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETMODEL_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// 根据查询条件获取CardUser表中符合查询条件的记录
        /// </summary>
        /// <param name="queryTerms">自定义查询条件</param>
        /// <param name="isLog">是否写入日志</param>
        /// <returns>查询结果,封装了查询的数据信息</returns>
        public static ResultModel GetCardUserList(QueryTerms queryTerms, bool isLog)
        {
            if (isLog)
                return GetCardUserList(queryTerms);
            List<CardUser> cardUserList = new List<CardUser>();
            int totalCount = 0;
            ResultModel result = new ResultModel();

            try
            {
                cardUserList = (List<CardUser>)(CardUserDal.GetList(queryTerms));
                totalCount=Convert.ToInt32(SystemUserDal.GetTotalCount(queryTerms));

                result.Data = cardUserList;
                result.DataSize = totalCount;
                result.IsSuccess = true;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETLIST_SUCCESS;
                result.ResultMessage = SymbolicConstant.RESULTMESSAGE_GETLIST_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                result.IsSuccess = false;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETLIST_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
        }
Exemplo n.º 12
0
 public static ResultModel Update(OperationLog log)
 {
     ResultModel result = new ResultModel();
     object id = new object();
     try
     {
         OperationLogDal.Update(log);
         result.IsSuccess = true;
         result.ObjectRecordId = log.OperationLogId;
         result.ResultCode = SymbolicConstant.RESULTCODE_UPDATE_SUCCESS;
         return result;
     }
     catch (Exception exception)
     {
         result.ResultCode = SymbolicConstant.RESULTCODE_UPDATE_ERROR;
         result.IsSuccess = false;
         result.ResultMessage = exception.Message;
         return result;
     }
 }
        /// <summary>
        /// 根据主键查询指定记录
        /// </summary>
        /// <param name="consumptionStatusId">主键</param>
        /// <param name="isLog">是否写入日志</param>
        /// <returns>查询结果,封装了查询出的实体</returns>
        public static ResultModel GetConsumptionStatusById(string consumptionStatusId, bool isLog)
        {
            if (isLog)
                return GetConsumptionStatusById(consumptionStatusId);
            ConsumptionStatus consumptionStatus = new ConsumptionStatus();
            ResultModel result = new ResultModel();

            try
            {
                consumptionStatus= ConsumptionStatusDal.GetModel(consumptionStatusId);
                result.Data =  consumptionStatus;
                result.IsSuccess = true;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETMODEL_SUCCESS;
                result.ResultMessage=SymbolicConstant.RESULTMESSAGE_GETMODEL_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                result.IsSuccess = false;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETMODEL_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// 根据记录主键,删除指定记录。
        /// </summary>
        /// <param name="userId">记录主键</param>
        /// <param name="isLog">是否写入日志</param>
        /// <returns>删除结果,包括是否删除成功、记录主键等信息</returns>
        public static ResultModel Delete(string roleId, bool isLog)
        {
            if (isLog)
                return Delete(roleId);
            ResultModel result = new ResultModel();
            try
            {
                Role role =(Role)GetRoleById(roleId).Data;
                RoleDal.Delete(role);

                result.IsSuccess = true;
                result.ObjectRecordId = roleId;
                result.ResultCode = SymbolicConstant.RESULTCODE_DELETE_SUCCESS;
                result.ResultMessage = SymbolicConstant.RESULTMESSAGE_DELETE_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                result.IsSuccess = false;
                result.ObjectRecordId = roleId;
                result.ResultCode = SymbolicConstant.RESULTCODE_DELETE_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
        }
Exemplo n.º 15
0
        /// <summary>
        /// 根据主键查询指定记录
        /// </summary>
        /// <param name="userId">主键</param>
        /// <returns>查询结果,封装了查询出的实体</returns>
        public static ResultModel GetConsultationById(string consultationId)
        {
            OperationLog log = new OperationLog();
            Consultation consultation = new Consultation();
            ResultModel result = new ResultModel();

            try
            {
                consultation  = ConsultationDal.GetModel(consultationId);

                log.AddTime = DateTime.Now;
                log.OperationLogId = System.Guid.NewGuid().ToString("N");
                log.OperationTypeCode = SymbolicConstant.OPERATIONTYPE_GETMODEL;
                log.OperationContent = SymbolicConstant.OPERATIONCONTENT_GETMODEL;
                log.OperationTable = typeof(Consultation).Name;
                log.ObjectRecordId = consultationId;
                log.ResultCode = SymbolicConstant.RESULTCODE_GETMODEL_SUCCESS;
                log.ResultMessage=SymbolicConstant.RESULTMESSAGE_GETMODEL_SUCCESS;
                log.UserId = CurrentSession.getUser().UserId;
                log.IsSuccessId = SymbolicConstant.ISSUCCESS_TRUE;

                result.Data =  consultation;
                result.IsSuccess = true;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETMODEL_SUCCESS;
                result.ResultMessage=SymbolicConstant.RESULTMESSAGE_GETMODEL_SUCCESS;
                return result;
            }
            catch (Exception exception)
            {
                log.ResultCode = SymbolicConstant.RESULTCODE_GETMODEL_ERROR;
                log.IsSuccessId = SymbolicConstant.ISSUCCESS_FALSE;
                log.ResultMessage=exception.Message;

                result.IsSuccess = false;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETMODEL_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
            finally
            {
                OperationLogBll.Insert(log);
            }
        }
Exemplo n.º 16
0
        /// <summary>
        /// 根据主键查询指定记录
        /// </summary>
        /// <param name="roleId">主键</param>
        /// <param name="isLog">是否写入日志</param>
        /// <returns>查询结果,封装了查询出的实体</returns>
        public static ResultModel GetRoleById(string roleId, bool isLog)
        {
            if (isLog)
                return GetRoleById(roleId);
            Role role = new Role();
            ResultModel result = new ResultModel();

            try
            {
                role= RoleDal.GetModel(roleId);
                result.Data =  role;
                result.IsSuccess = true;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETMODEL_SUCCESS;
                result.ResultMessage=SymbolicConstant.RESULTMESSAGE_GETMODEL_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                result.IsSuccess = false;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETMODEL_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
        }
Exemplo n.º 17
0
        /// <summary>
        /// 修改某条记录
        /// </summary>
        /// <param name="user">要修改记录对应的实体</param>
        /// <param name="isLog">是否写入日志</param>
        /// <returns>修改结果,包括是否修改成功、记录主键等信息</returns>
        public static ResultModel Update(RoleRight roleRight, bool isLog)
        {
            if (isLog)
                return Update(roleRight);

            ResultModel result = new ResultModel();

            try
            {
                RoleRightDal.Update(roleRight);

                result.IsSuccess = true;
                result.ObjectRecordId = roleRight.RoleId;
                result.ResultCode = SymbolicConstant.RESULTCODE_UPDATE_SUCCESS;
                result.ResultMessage = SymbolicConstant.RESULTMESSAGE_UPDATE_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                result.IsSuccess = false;
                result.ObjectRecordId =roleRight.RoleId;
                result.ResultCode = SymbolicConstant.RESULTCODE_UPDATE_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
        }
Exemplo n.º 18
0
        /// <summary>
        /// 根据记录主键,删除指定记录。
        /// </summary>
        /// <param name="userId">记录主键</param>
        /// <param name="isLog">是否写入日志</param>
        /// <returns>删除结果,包括是否删除成功、记录主键等信息</returns>
        public static ResultModel Delete(string dictionaryId, bool isLog)
        {
            if (isLog)
                return Delete(dictionaryId);
            ResultModel result = new ResultModel();
            try
            {
                Dictionary dictionary =(Dictionary)GetDictionaryById(dictionaryId).Data;
                DictionaryDal.Delete(dictionary);

                result.IsSuccess = true;
                result.ObjectRecordId = dictionaryId;
                result.ResultCode = SymbolicConstant.RESULTCODE_DELETE_SUCCESS;
                result.ResultMessage = SymbolicConstant.RESULTMESSAGE_DELETE_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                result.IsSuccess = false;
                result.ObjectRecordId = dictionaryId;
                result.ResultCode = SymbolicConstant.RESULTCODE_DELETE_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
        }
Exemplo n.º 19
0
        /// <summary>
        /// 删除数据库CardUser表中的所有记录
        /// </summary>
        /// <returns>删除结果,包括是删除成功、删除的记录数等信息</returns>
        public static ResultModel DeleteAll()
        {
            OperationLog log = new OperationLog();
            ResultModel result = new ResultModel();
            try
            {
                log.AddTime = DateTime.Now;
                log.IsSuccessId = SymbolicConstant.ISSUCCESS_TRUE;
                log.OperationLogId = System.Guid.NewGuid().ToString("N");
                log.OperationContent = SymbolicConstant.OPERATIONCONTENT_DELETEALL;
                log.OperationTable = typeof(CardUser).Name;
                log.OperationTypeCode = SymbolicConstant.OPERATIONTYPE_DELETEALL;
                log.ResultCode = SymbolicConstant.RESULTCODE_DELETEALL_SUCCESS;
                log.ResultMessage=SymbolicConstant.RESULTMESSAGE_DELETEALL_SUCCESS;
                log.UserId = CurrentSession.getUser().UserId;

                //删除的记录数
                int  count=(int)WebPageDal.DeleteAll();

                log.TotalCount = count;
                result.DataSize = count;
                result.IsSuccess = true;
                result.ResultCode =  SymbolicConstant.RESULTCODE_DELETEALL_SUCCESS;
                result.ResultMessage=SymbolicConstant.RESULTMESSAGE_DELETEALL_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                log.IsSuccessId = SymbolicConstant.ISSUCCESS_FALSE;
                log.ResultCode = SymbolicConstant.RESULTCODE_DELETEALL_ERROR;
                log.ResultMessage=exception.Message;

                result.IsSuccess = false;
                result.ResultCode = SymbolicConstant.RESULTCODE_DELETEALL_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
            finally
            {
                OperationLogBll.Insert(log);
            }
        }
        /// <summary>
        /// 根据记录主键,删除指定记录。
        /// </summary>
        /// <param name="userId">记录主键</param>
        /// <param name="isLog">是否写入日志</param>
        /// <returns>删除结果,包括是否删除成功、记录主键等信息</returns>
        public static ResultModel Delete(string hospitalSectionOfficeId, bool isLog)
        {
            if (isLog)
                return Delete(hospitalSectionOfficeId);
            ResultModel result = new ResultModel();
            try
            {
                HospitalSectionOffice hospitalSectionOffice =(HospitalSectionOffice)GetHospitalSectionOfficeById(hospitalSectionOfficeId).Data;
                HospitalSectionOfficeDal.Delete(hospitalSectionOffice);

                result.IsSuccess = true;
                result.ObjectRecordId = hospitalSectionOfficeId;
                result.ResultCode = SymbolicConstant.RESULTCODE_DELETE_SUCCESS;
                result.ResultMessage = SymbolicConstant.RESULTMESSAGE_DELETE_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                result.IsSuccess = false;
                result.ObjectRecordId = hospitalSectionOfficeId;
                result.ResultCode = SymbolicConstant.RESULTCODE_DELETE_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
        }
Exemplo n.º 21
0
        /// <summary>
        /// 删除数据库CardUser表中的所有记录
        /// </summary>
        /// <param name="isLog">是否写稿日志</param>
        /// <returns>删除结果,包括是否删除成功、记录主键等信息</returns>
        public static ResultModel DeleteAll(bool isLog)
        {
            if(isLog)
                DeleteAll();

            ResultModel result = new ResultModel();
            try
            {
                //删除的记录数
                int  count=(int)WebPageDal.DeleteAll();

                result.DataSize = count;
                result.IsSuccess = true;
                result.ResultCode =  SymbolicConstant.RESULTCODE_DELETEALL_SUCCESS;
                result.ResultMessage=SymbolicConstant.RESULTMESSAGE_DELETEALL_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                result.IsSuccess = false;
                result.ResultCode = SymbolicConstant.RESULTCODE_DELETEALL_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// 修改某条记录
        /// </summary>
        /// <param name="user">要修改记录对应的实体</param>
        /// <param name="isLog">是否写入日志</param>
        /// <returns>修改结果,包括是否修改成功、记录主键等信息</returns>
        public static ResultModel Update(CardUser cardUser, bool isLog)
        {
            if (isLog)
                return Update(cardUser);

            ResultModel result = new ResultModel();

            try
            {
                CardUserDal.Update(cardUser);

                result.IsSuccess = true;
                result.ObjectRecordId = cardUser.CardId;
                result.ResultCode = SymbolicConstant.RESULTCODE_UPDATE_SUCCESS;
                result.ResultMessage = SymbolicConstant.RESULTMESSAGE_UPDATE_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                result.IsSuccess = false;
                result.ObjectRecordId =cardUser.CardId;
                result.ResultCode = SymbolicConstant.RESULTCODE_UPDATE_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
        }
Exemplo n.º 23
0
        /// <summary>
        /// 根据查询条件获取CardUser表中符合查询条件的记录
        /// </summary>
        /// <param name="queryTerms">自定义查询条件</param>
        /// <returns>查询结果,封装了查询的数据信息</returns>
        public static ResultModel GetCardUserList(QueryTerms queryTerms)
        {
            List<CardUser> cardUserList = new List<CardUser>();
            OperationLog log = new OperationLog();
            int totalCount = 0;
            ResultModel result = new ResultModel();

            try
            {
                log.AddTime = DateTime.Now;
                log.IsSuccessId = SymbolicConstant.ISSUCCESS_TRUE;
                log.OperationLogId = System.Guid.NewGuid().ToString("N");
                log.OperationContent = SymbolicConstant.OPERATIONCONTENT_GETLIST;
                log.OperationTable = typeof(CardUser).Name;
                log.OperationTypeCode =SymbolicConstant.OPERATIONTYPE_GETLIST;
                log.ResultCode = SymbolicConstant.RESULTCODE_GETLIST_SUCCESS;
                log.ResultMessage=SymbolicConstant.RESULTMESSAGE_GETLIST_SUCCESS;
                log.UserId = CurrentSession.getUser().UserId;

                cardUserList = (List<CardUser>)(CardUserDal.GetList(queryTerms));
                totalCount=Convert.ToInt32(SystemUserDal.GetTotalCount(queryTerms));

                log.TotalCount = totalCount;
                result.Data = cardUserList;
                result.DataSize = totalCount;
                result.IsSuccess = true;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETLIST_SUCCESS;
                result.ResultMessage = SymbolicConstant.RESULTMESSAGE_GETLIST_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                log.ResultCode = SymbolicConstant.RESULTCODE_GETLIST_ERROR;
                log.IsSuccessId = SymbolicConstant.ISSUCCESS_FALSE;
                log.ResultMessage=exception.Message;

                result.IsSuccess = false;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETLIST_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
            finally
            {
                OperationLogBll.Insert(log);
            }
        }
        /// <summary>
        /// 修改某条记录
        /// </summary>
        /// <param name="user">要修改记录对应的实体</param>
        /// <param name="isLog">是否写入日志</param>
        /// <returns>修改结果,包括是否修改成功、记录主键等信息</returns>
        public static ResultModel Update(HospitalSectionOffice hospitalSectionOffice, bool isLog)
        {
            if (isLog)
                return Update(hospitalSectionOffice);

            ResultModel result = new ResultModel();

            try
            {
                HospitalSectionOfficeDal.Update(hospitalSectionOffice);

                result.IsSuccess = true;
                result.ObjectRecordId = hospitalSectionOffice.SectOffId;
                result.ResultCode = SymbolicConstant.RESULTCODE_UPDATE_SUCCESS;
                result.ResultMessage = SymbolicConstant.RESULTMESSAGE_UPDATE_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                result.IsSuccess = false;
                result.ObjectRecordId =hospitalSectionOffice.SectOffId;
                result.ResultCode = SymbolicConstant.RESULTCODE_UPDATE_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
        }
Exemplo n.º 25
0
        /// <summary>
        /// 添加一条新记录
        /// </summary>
        /// <param name="cardUser">CardUser实体</param>
        /// <returns>添加结果,包括是否插入成功、记录主键等信息</returns>
        public static ResultModel Insert(CardUser cardUser)
        {
            OperationLog log = new OperationLog();
            ResultModel result = new ResultModel();
            object id = "";
            try
            {
                log.OperationLogId = Guid.NewGuid().ToString("N");
                log.UserId = CurrentSession.getUser().UserId;
                log.OperationTypeCode = SymbolicConstant.OPERATIONTYPE_INSERT;
                log.OperationContent = SymbolicConstant.OPERATIONCONTENT_INSERT;
                log.AddTime = DateTime.Now;
                log.OperationTable = typeof(CardUser).Name;

                id = CardUserDal.Insert(cardUser);

                log.ObjectRecordId = Convert.ToString(id);
                log.ResultCode = SymbolicConstant.RESULTCODE_INSERT_SUCCESS;
                log.IsSuccessId = SymbolicConstant.ISSUCCESS_TRUE;
                log.ResultMessage=SymbolicConstant.RESULTMESSAGE_INSERT_SUCCESS;

                result.IsSuccess = true;
                result.ObjectRecordId = id.ToString();
                result.ResultCode = SymbolicConstant.RESULTCODE_INSERT_SUCCESS;
                result.ResultMessage = SymbolicConstant.RESULTMESSAGE_INSERT_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                log.IsSuccessId = SymbolicConstant.ISSUCCESS_FALSE;
                log.ObjectRecordId = Convert.ToString(id);
                log.ResultCode = SymbolicConstant.RESULTCODE_INSERT_ERROR;
                log.ResultMessage=exception.Message;

                result.IsSuccess = false;
                result.ObjectRecordId = id.ToString();
                result.ResultCode = SymbolicConstant.RESULTCODE_INSERT_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
            finally
            {
                OperationLogBll.Insert(log);
            }
        }
Exemplo n.º 26
0
        /// <summary>
        /// 根据主键查询指定记录
        /// </summary>
        /// <param name="dictionaryId">主键</param>
        /// <param name="isLog">是否写入日志</param>
        /// <returns>查询结果,封装了查询出的实体</returns>
        public static ResultModel GetDictionaryById(string dictionaryId, bool isLog)
        {
            if (isLog)
                return GetDictionaryById(dictionaryId);
            Dictionary dictionary = new Dictionary();
            ResultModel result = new ResultModel();

            try
            {
                dictionary= DictionaryDal.GetModel(dictionaryId);
                result.Data =  dictionary;
                result.IsSuccess = true;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETMODEL_SUCCESS;
                result.ResultMessage=SymbolicConstant.RESULTMESSAGE_GETMODEL_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                result.IsSuccess = false;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETMODEL_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
        }
Exemplo n.º 27
0
        /// <summary>
        /// 添加一条新记录
        /// </summary>
        /// <param name="cardUser">CardUser实体</param>
        /// <param name="isLog">是否写入日志</param>
        /// <returns>添加结果,包括是否插入成功、记录主键等信息</returns>
        public static ResultModel Insert(CardUser cardUser, bool isLog)
        {
            if (isLog)
                return Insert(cardUser);
            ResultModel result = new ResultModel();
            object id = "";
            try
            {
                id = CardUserDal.Insert(cardUser);

                result.IsSuccess = true;
                result.ObjectRecordId = id.ToString();
                result.ResultCode = SymbolicConstant.RESULTCODE_INSERT_SUCCESS;
                result.ResultMessage = SymbolicConstant.RESULTMESSAGE_INSERT_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                result.IsSuccess = false;
                result.ObjectRecordId = id.ToString();
                result.ResultCode = SymbolicConstant.RESULTCODE_INSERT_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
        }
Exemplo n.º 28
0
        public static ResultModel Insert(OperationLog log)
        {
            ResultModel result = new ResultModel();
            object id = "";
            try
            {
                OperationLogDal.Insert(log);
                result.IsSuccess = true;
                result.ObjectRecordId = id.ToString();
                result.ResultCode = SymbolicConstant.RESULTCODE_INSERT_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                result.ResultCode = SymbolicConstant.RESULTCODE_INSERT_ERROR;
                result.IsSuccess = false;
                result.ResultMessage = exception.Message;
                return result;
            }
        }
Exemplo n.º 29
0
        /// <summary>
        /// 根据记录主键,删除指定记录。
        /// </summary>
        /// <param name="userId">记录主键</param>
        /// <param name="isLog">是否写入日志</param>
        /// <returns>删除结果,包括是否删除成功、记录主键等信息</returns>
        public static ResultModel Delete(string cardUserId, bool isLog)
        {
            if (isLog)
                return Delete(cardUserId);
            ResultModel result = new ResultModel();
            try
            {
                CardUser cardUser =(CardUser)GetCardUserById(cardUserId).Data;
                CardUserDal.Delete(cardUser);

                result.IsSuccess = true;
                result.ObjectRecordId = cardUserId;
                result.ResultCode = SymbolicConstant.RESULTCODE_DELETE_SUCCESS;
                result.ResultMessage = SymbolicConstant.RESULTMESSAGE_DELETE_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                result.IsSuccess = false;
                result.ObjectRecordId = cardUserId;
                result.ResultCode = SymbolicConstant.RESULTCODE_DELETE_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
        }
        /// <summary>
        /// 根据主键查询指定记录
        /// </summary>
        /// <param name="hospitalSectionOfficeId">主键</param>
        /// <param name="isLog">是否写入日志</param>
        /// <returns>查询结果,封装了查询出的实体</returns>
        public static ResultModel GetHospitalSectionOfficeById(string hospitalSectionOfficeId, bool isLog)
        {
            if (isLog)
                return GetHospitalSectionOfficeById(hospitalSectionOfficeId);
            HospitalSectionOffice hospitalSectionOffice = new HospitalSectionOffice();
            ResultModel result = new ResultModel();

            try
            {
                hospitalSectionOffice= HospitalSectionOfficeDal.GetModel(hospitalSectionOfficeId);
                result.Data =  hospitalSectionOffice;
                result.IsSuccess = true;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETMODEL_SUCCESS;
                result.ResultMessage=SymbolicConstant.RESULTMESSAGE_GETMODEL_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                result.IsSuccess = false;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETMODEL_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
        }