示例#1
0
 public UserCenterAccountViewModel SearchTenantAccount(SearchAccountViewModel model)
 {
     UserCenterAccountViewModel accountViewModel = new UserCenterAccountViewModel();
     try
     {
         IEMTenantAccountDetailService detailService = new EMTenantAccountDetailService();
         //IEMTenantAccountService service = new EMTenantAccountService();
         //accountViewModel.Balance = service.QueryBalance(tenantCode);
         int rouCount = 0;
         IList<EMTenantAccountDetail> list = detailService.Select(model.TenantCode,model.BeginTime,model.EndTime,model.ConsumeType, model.RouIndex, model.PageSize, ref rouCount);
         List<UserCenterAccountDetailViewModel> detailList = new List<UserCenterAccountDetailViewModel>();
         foreach (EMTenantAccountDetail entity in list)
         {
             detailList.Add(ConvertToAccountViewModel(entity));
         }
         accountViewModel.list = detailList;
         accountViewModel.RowCount = rouCount;
         return accountViewModel;
     }
     catch (Exception ex)
     {
         Logger.Error(ex.Message, ex);
         return accountViewModel;
     }
 }
示例#2
0
 public UserCenterAccountViewModel GetTenantAccount(string tenantCode, int rowNumber)
 {
     UserCenterAccountViewModel model = new UserCenterAccountViewModel();
     try
     {
         EMTenantAccountDetailService detailService = new EMTenantAccountDetailService();
         EMTenantAccountService service = new EMTenantAccountService();
         model.Balance = service.QueryBalance(tenantCode);
         IList<EMTenantAccountDetail> list = detailService.SelectRecent(tenantCode, rowNumber);
         List<UserCenterAccountDetailViewModel> detailList = new List<UserCenterAccountDetailViewModel>();
         foreach (EMTenantAccountDetail entity in list)
         {
             detailList.Add(ConvertToAccountViewModel(entity));
         }
         model.list = detailList;
         return model;
     }
     catch (Exception ex)
     {
         Logger.Error(ex.Message, ex);
         return model;
     }
 }