Exemplo n.º 1
0
        private void InitSearchSelect()
        {
            var CompanyList = companyRepo.GetList(ViewHelp.GetRoleId());

            ViewBag.CompanyList = new SelectList(CompanyList, "Key", "Value");
            var CateList = changeCateRepo.GetList(ViewHelp.GetRoleType(), CateDropType.Report, ViewHelp.GetCateIds());

            ViewBag.CateList = new SelectList(CateList, "Key", "Value");
        }
Exemplo n.º 2
0
        private void InitSelect(int CateId = 0, int CompanyId = 0, int SeasonType = 0)
        {
            var CateList = changeCateRepo.GetList(ViewHelp.GetRoleType(), CateDropType.Report, ViewHelp.GetCateIds());

            ViewBag.CateList = new SelectList(CateList, "Key", "Value", CateId);
            var CompanyList = companyRepo.GetList(ViewHelp.GetRoleId());

            ViewBag.CompanyList = new SelectList(CompanyList, "Key", "Value", CompanyId);
            var SeasonTypeList = SeasonTypeEnum.Autumn.GetEnumList();

            ViewBag.SeasonTypeList = new SelectList(SeasonTypeList, "Key", "Value", SeasonType);
        }
Exemplo n.º 3
0
        private void InitSelect(int CateId = 0, int CompanyId = 0)
        {
            var CateList = changeCateRepo.GetList(ViewHelp.GetRoleType(), CateDropType.Form, ViewHelp.GetCateIds());

            ViewBag.CateList = new SelectList(CateList, "Key", "Value", CateId);
            var CateGroupList = changeCateRepo.GetGroupList(ViewHelp.GetRoleType(), CateDropType.Form, ViewHelp.GetCateIds());

            ViewBag.CateGroupList = new KeyValueGroupVM(CateGroupList, CateId);
            //录入人和amdin在录入的时候可以录入所有人的公司,
            //也只有录入人和admin可以编辑和新增,所以目前都是可以选所有的
            var CompanyList = companyRepo.GetList(ViewHelp.GetRoleId());

            ViewBag.CompanyList = new SelectList(CompanyList, "Key", "Value", CompanyId);
        }
Exemplo n.º 4
0
        private async Task InitSelect(int UserId = 0, int?CompanyTypeId = null, int?ParentCompanyId = null)
        {
            var List = await UserAccountRepo.GetUserList(new SystemUserSM());

            var UserList = List.Select(o => new { Key = o.UserId, Value = o.UserName + "(" + o.LoginEmail + "," + o.RoleName + ")" }).ToList();

            ViewBag.UserList = new SelectList(UserList, "Key", "Value", UserId);
            var CompanyTypeList = CompanyType.City.GetEnumList();

            ViewBag.CompanyTypeList = new SelectList(CompanyTypeList, "Key", "Value", CompanyTypeId);

            var ParentCompanyIdList = companyRepo.GetList(ViewHelp.GetRoleId(), CompanyType.City);

            ViewBag.ParentCompanyIdList = new SelectList(ParentCompanyIdList, "Key", "Value", ParentCompanyId);
        }
Exemplo n.º 5
0
        private void InitSearchSelect(bool IsFromApprove = false, int ApproveStatus = 0)
        {
            var DateTypeList = ExpenseAccountDateType.OccurDate.GetEnumList();

            ViewBag.DateTypeList = new SelectList(DateTypeList, "Key", "Value");
            var CateList = changeCateRepo.GetList(ViewHelp.GetRoleType(), CateDropType.Search, ViewHelp.GetCateIds());

            ViewBag.CateList = new SelectList(CateList, "Key", "Value");
            var ApproveStatusList = ExpenseAccountApproveStatus.Created.GetEnumList();

            if (IsFromApprove)
            {
                ApproveStatusList = ApproveStatusList.Where(o => o.Key != (int)ExpenseAccountApproveStatus.Created).ToList();
            }

            ViewBag.ApproveStatusList = new SelectList(ApproveStatusList, "Key", "Value", ApproveStatus);

            var CompanyList = companyRepo.GetList(ViewHelp.GetRoleId());

            ViewBag.CompanyList = new SelectList(CompanyList, "Key", "Value");
        }
Exemplo n.º 6
0
        public async Task <ActionResult> CompanyLimitDetail(ExpenseAccountSM Sm, int Page = 1, int PageSize = 20)
        {
            DateTime sDate, eDate;

            Sm.Year.GetDateByYear(out sDate, out eDate);
            Sm.SDate = sDate;
            Sm.EDate = eDate;
            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.Year);
            Vms.Results   = Mapper.Map <IList <ExpenseAccountListDTO>, IList <ExpenseAccountListVM> >(Dtos.Results);
            if (Request.IsAjaxRequest())
            {
                return(PartialView("_CompanyLimitDetailList", Vms));
            }
            CompanyLimitInitSearchSelect();
            return(View(Vms));
        }
        private void InitSelect(int CompanyId = 0)
        {
            var CompanyList = companyRepo.GetList(ViewHelp.GetRoleId());

            ViewBag.CompanyList = new SelectList(CompanyList, "Key", "Value", CompanyId);
        }