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"); }
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); }
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); }
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); }
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"); }
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); }