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); }
public async Task <ActionResult> Index(CompanyPerformanceSM sm) { var CompanyList = companyRepo.GetList(); ViewBag.CompanyList = new SelectList(CompanyList, "Key", "Value"); var Dtos = companyPerformanceRepo.GetList(sm); var models = Mapper.Map <List <CompanyPerformanceVM> >(Dtos); if (Request.IsAjaxRequest()) { return(PartialView("_List", models)); } return(View(models)); }
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); }
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 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 InitSelect(int roleType = 0, string companyIds = "", int?viewRightType = 0) { var List = CompanyRepo.GetList(); if (!string.IsNullOrEmpty(companyIds)) { var ids = companyIds.Split(','); var ListTemp = new List <KeyValueVM>(); foreach (var CompanyId in List.Where(o => !companyIds.Contains(o.Key))) { ListTemp.Add(CompanyId); } List = ListTemp; } ViewBag.CompanySelect = new SelectList(List, "Key", "Value"); ViewBag.RoleTypeList = new SelectList(RoleType.Admin.GetEnumList(), "Key", "Value", roleType); ViewBag.ViewRightTypeList = new SelectList(new RoleViewRightType().GetEnumList(), "Key", "Value", viewRightType); }