Example #1
0
        public ActionResult MyFunds(BillsSearchModel info)
        {
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToRoute(new { controller = "Login", action = "LogOut" }));
            }
            int   user = PageValidate.FilterParam(User.Identity.Name);
            Bills dal  = new Bills(db);

            if (!RoleCheck.CheckHasAuthority(user, db, "经费管理"))
            {
                info.userId = user;
            }
            info.PageSize = 0;
            info.userId   = user;
            var bills = dal.GetApplyList(info).ToList();

            foreach (var bill in bills)
            {
                bill.contents         = dal.getContents(bill.reimbursementCode, 0).ToList();
                bill.attachmentsCount = dal.getAttachments(bill.reimbursementCode, 0).Count();
            }
            ViewData["Bills"] = bills;
            List <SelectOption> options = DropDownList.RespondStateSelect();

            ViewData["RState"] = DropDownList.SetDropDownList(options);
            return(View(info));
        }