本文整理汇总了C#中HelMagUtility.ResultModel类的典型用法代码示例。如果您正苦于以下问题:C# ResultModel类的具体用法?C# ResultModel怎么用?C# ResultModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResultModel类属于HelMagUtility命名空间,在下文中一共展示了ResultModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetOperationLogList
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;
}
}
示例2: Delete
/// <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);
}
}
示例3: Delete
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;
}
}
示例4: GetOperationLogById
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;
}
}
示例5: Delete
/// <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;
}
}
示例6: Update
/// <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);
}
}
示例7: Update
/// <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;
}
}
示例8: GetServiceItemById
/// <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;
}
}
示例9: GetCardUserById
/// <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;
}
}
示例10: GetCardUserList
/// <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;
}
}
示例11: Update
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;
}
}
示例12: GetConsumptionStatusById
/// <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;
}
}
示例13: Delete
/// <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;
}
}
示例14: GetConsultationById
/// <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);
}
}
示例15: GetRoleById
/// <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;
}
}