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; } }
public bool TopUpCustomer(string fromTenantCode, string toTenantCode, decimal money) { try { EMTenantAccountService service = new EMTenantAccountService(); service.TopUpCustomer(fromTenantCode,toTenantCode,money); return true; } catch (Exception ex) { Logger.Error(ex.Message, ex); return false; } }
public bool DecuntMoney(string tenantCode, string opratorTenantCode, EnumConsumeType type, decimal money, string remark) { try { EMTenantAccountService service = new EMTenantAccountService(); service.DecuntMoney(tenantCode, opratorTenantCode, type, money, remark); return true; } catch (Exception ex) { Logger.Error(ex.Message, ex); return false; } }
public decimal GetTenantBalance(string tenantCode) { try { IEMTenantAccountService service = new EMTenantAccountService(); return service.QueryBalance(tenantCode); } catch (Exception ex) { Logger.Error(ex.Message, ex); return 0; } }