Esempio n. 1
0
        public async Task<ActionResult> Index(ExpenseAccountSM Sm,int Page=1,int PageSize=20)
        {
            var Dtos =  expenseAccountRepo.GetListByDto(Sm, ViewHelp.UserInfo(), Page, PageSize);
            var Vms = new PagedResult<ExpenseAccountListVM>()
            {
                CurrentPage = Dtos.CurrentPage,
                PageSize = Dtos.PageSize,
                RowCount = Dtos.RowCount,
                Stats = Dtos.Stats

            };
            Vms.Results = Mapper.Map<IList<ExpenseAccountListDTO>, IList<ExpenseAccountListVM>>(Dtos.Results);
            if (Request.IsAjaxRequest())
                return PartialView("_List", Vms);
            InitSearchSelect();
            return View(Vms);
        }
Esempio n. 2
0
        public async Task<ActionResult> FindLostAccountIndex(ExpenseAccountSM Sm, int Page = 1, int PageSize = 20)
        {
            if (!Request.IsAjaxRequest())
                Sm.ApproveStatus = (int)ExpenseAccountApproveStatus.WaitingApprove;
            var Dtos = expenseAccountRepo.GetLostAccountListByDto(Sm, ViewHelp.UserInfo(), Page, PageSize);
            var Vms = new PagedResult<ExpenseAccountListVM>()
            {
                CurrentPage = Dtos.CurrentPage,
                PageSize = Dtos.PageSize,
                RowCount = Dtos.RowCount,
                Stats = Dtos.Stats

            };
            Vms.Results = Mapper.Map<IList<ExpenseAccountListDTO>, IList<ExpenseAccountListVM>>(Dtos.Results);
            if (Request.IsAjaxRequest())
                return PartialView("_ApproveList", Vms);
            InitSearchSelect(true, Sm.ApproveStatus.Value);
            return View(Vms);
        }
Esempio n. 3
0
 public async Task<ActionResult> ToExcel(ExpenseAccountSM Sm)
 {
     var Dtos = expenseAccountRepo.GetExcelListByDto(Sm, ViewHelp.UserInfo());
     var Vms = Mapper.Map<List<ExpenseAccountExcelVM>>(Dtos);
     var FilePath = ExpenseAccountManager.Instance.ToExcel(Vms);
     Log(Vms, "路径:" + FilePath);
     return File(new FileStream(FilePath, FileMode.Open), "application/octet-stream","报销清单_"+ViewHelp.GetUserName() +"_" +DateTime.Now.ToString("yyyyMMddss")+".xls");
 }
Esempio n. 4
0
        public async Task<ActionResult> CompanyLimitDetail(ExpenseAccountSM Sm, int Page = 1, int PageSize = 20)
        {
            if (!Sm.CompanyId.HasValue)
            {
                var CompanyList = companyRepo.GetList(ViewHelp.GetRoleId());
                Sm.CompanyId = CompanyList.FirstOrDefault().Key.ToInt();
            }
            if (!Sm.CateId.HasValue)
            {
                var CateList = changeCateRepo.GetList(ViewHelp.GetRoleType(), CateDropType.Search, ViewHelp.GetCateIds());
                Sm.CateId = CateList.FirstOrDefault().Key.ToInt();
            }
            Sm.IsNotAccount = 0;
            Sm.ApproveStatus =(int) ExpenseAccountApproveStatus.PassApproved;
            var Dtos = expenseAccountRepo.GetListByDto(Sm, ViewHelp.UserInfo(), Page, PageSize);
            var Vms = new PagedResult<ExpenseAccountListVM>()
            {
                CurrentPage = Dtos.CurrentPage,
                PageSize = Dtos.PageSize,
                RowCount = Dtos.RowCount,
                Stats = Dtos.Stats

            };
            ViewBag.limit = companyLimitRepo.GetCompanyLimit(Sm.CompanyId.Value, Sm.CateId.Value, Sm.SDate, Sm.EDate);
            Vms.Results = Mapper.Map<IList<ExpenseAccountListDTO>, IList<ExpenseAccountListVM>>(Dtos.Results);
            if (Request.IsAjaxRequest())
                return PartialView("_CompanyLimitDetailList", Vms);
            CompanyLimitInitSearchSelect();
            return View(Vms);
        }