Ejemplo n.º 1
0
        public EMAccountDetailWithCount GetAccountDetailBalance(AccountDetailParam param)
        {
            EMAccountDetailWithCount model = new EMAccountDetailWithCount();
            IEMTenantAccountDetailService service = new EMTenantAccountDetailService();
  
            decimal balance = decimal.Zero;
            IList<EMTenantAccountDetail> list = service.Select(param.TenantCode, param.PageSize, out balance);
            model.Balance = balance;

            IList<EMAccountDetailViewModel> viewList = new List<EMAccountDetailViewModel>();

            for (int i = 0; i < list.Count; i++)
            {
                EMAccountDetailViewModel em = new EMAccountDetailViewModel();
                em.Index = i + 1;
                em.ConsumeMoney = list[i].ConsumeMoney;
                em.ConsumeType = list[i].ConsumeType;
                em.CreateTime = list[i].CreateTime;
                em.OperateType = list[i].OperateType;
                em.Remark = list[i].Remark;
                em.TargetTenantCode = list[i].TargetTenantCode;
                em.TargetTenantName = list[i].TargetTenantName;
                em.TenantCode = list[i].TenantCode;
                viewList.Add(em);
            }

            model.listModel = viewList;

            return model;
        }
Ejemplo n.º 2
0
        public EMAccountDetailWithCount SearchAccountDetail(AccountDetailParam param)
        {
            EMAccountDetailWithCount model = new EMAccountDetailWithCount();
            EMTenantAccountDetailService service = new EMTenantAccountDetailService();
            int rowcount = 0;
            IList<EMTenantAccountDetail> list = service.Select(param.TenantCode, param.beginDate, param.endDate, param.consumeType, param.RowIndex, param.PageSize, ref rowcount);

            IList<EMAccountDetailViewModel> viewList = new List<EMAccountDetailViewModel>();
            
            for(int i = 0;i<list.Count;i++)
            {
                EMAccountDetailViewModel em = new EMAccountDetailViewModel();
                em.Index = i + 1;
                em.ConsumeMoney = list[i].ConsumeMoney;
                em.ConsumeType = list[i].ConsumeType;
                em.CreateTime = list[i].CreateTime;
                em.OperateType = list[i].OperateType;
                em.Remark = list[i].Remark;
                em.TargetTenantCode = list[i].TargetTenantCode;
                em.TenantCode = list[i].TenantCode;
                viewList.Add(em);
            }

            model.RowCount = rowcount;
            model.listModel = viewList;

            return model;
        }