public ActionResult MembList() { List <int?> stores = _memberContract.Members.Select(c => c.StoreId).Distinct().ToList(); var li = _storeContract.Stores.Where(c => c.IsDeleted == false && c.IsEnabled == true && stores.Contains(c.Id)).Select(c => new SelectListItem() { Text = c.StoreName, Value = c.Id.ToString() }).ToList(); li.Insert(0, new SelectListItem() { Text = "下拉选择", Value = "" }); ViewBag.StoreIds = li; var colls = _collocationContract.Collocations.Where(c => c.IsDeleted == false && c.IsEnabled == true).Select(c => new SelectListItem() { Value = c.Id.ToString(), Text = c.CollocationName, }).ToList(); colls.Insert(0, new SelectListItem() { Text = "下拉选择", Value = "" }); ViewBag.CollocationIds = colls; ViewBag.Departments = CacheAccess.GetDepartmentListItem(_departmentContract, true); return(PartialView()); }
/// <summary> /// 载入创建数据 /// </summary> /// <returns></returns> public ActionResult Create() { #region 物品类型 var companyGoodsCategoryTypeFlagList = new List <SelectListItem>() { new SelectListItem() { Value = "", Text = "请选择" } }; foreach (var value in Enum.GetValues(typeof(CompanyGoodsCategoryTypeFlag))) { companyGoodsCategoryTypeFlagList.Add(new SelectListItem() { Value = Convert.ToInt32(value).ToString(), Text = (EnumHelper.GetValue <string>((CompanyGoodsCategoryTypeFlag)value)) }); } ViewBag.CompanyGoodsCategoryTypeFlagList = companyGoodsCategoryTypeFlagList; #endregion #region 部门 var li = CacheAccess.GetDepartmentListItem(_departmentContract, true, DepartmentTypeFlag.公司, DepartmentTypeFlag.店铺); ViewBag.Departments = li; #endregion return(PartialView()); }
public ActionResult Index() { #region 部门 var li = CacheAccess.GetDepartmentListItem(_departmentContract, true, DepartmentTypeFlag.公司, DepartmentTypeFlag.店铺); ViewBag.Departments = li; #endregion return(View()); }
public DepartmentController(IDepartmentContract departmentContract, IAdministratorContract administratorContract, IPermissionContract permissionContract, IModuleContract moduleContract) { _departmentContract = departmentContract; _administratorContract = administratorContract; _permissionContract = permissionContract; _moduleContract = moduleContract; var li = CacheAccess.GetDepartmentListItem(_departmentContract, true); ViewBag.Departments = li; }
/// <summary> /// 载入修改数据 /// </summary> /// <param name="Id"></param> /// <returns></returns> public ActionResult Update(int Id) { var result = _collocationContract.Collocations.Where(c => c.IsDeleted == false && c.IsEnabled == true && c.Id == Id).FirstOrDefault(); if (result != null && result.Admini != null) { var deps = CacheAccess.GetDepartmentListItem(_departmentContract, false); string seldepId = result.Admini.DepartmentId != null?result.Admini.DepartmentId.ToString() : null; var selcDep = deps.Where(c => c.Value == seldepId).FirstOrDefault(); selcDep.Selected = true; ViewBag.Departments = deps; ViewBag.stat = result.State; return(PartialView(result)); } return(Json(new OperationResult(OperationResultType.Error))); }
public ActionResult Update(int Id) { var result = _factorysContract.View(Id); Mapper.CreateMap <Factorys, FactorysDto>(); FactorysDto dto = Mapper.Map <Factorys, FactorysDto>(result); ViewBag.Departments = CacheAccess.GetDepartmentListItem(_DepartmentContract, true, DepartmentTypeFlag.设计); ViewBag.Brands = CacheAccess.GetBrand(_brandContract, true, false); ViewBag.Stores = result.Department.Stores.Where(w => w.IsEnabled && !w.IsDeleted).Select(s => new SelectListItem { Value = s.Id + "", Text = s.StoreName, }).ToList(); ViewBag.Storages = _StoreContract.Stores.Where(w => w.IsEnabled && !w.IsDeleted && w.Id == result.StoreId).SelectMany(s => s.Storages) .Where(w => w.IsEnabled && !w.IsDeleted).Select(s => new SelectListItem { Value = s.Id + "", Text = s.StorageName, }).ToList(); return(PartialView(dto)); }
/// <summary> /// 获取所有部门 /// </summary> /// <returns></returns> public JsonResult GetAllDepartment() { return(Json(CacheAccess.GetDepartmentListItem(_departmentContract, false), JsonRequestBehavior.AllowGet)); }
public ActionResult Index() { ViewBag.Departments = CacheAccess.GetDepartmentListItem(_departmentContract, true); return(View()); }
/// <summary> /// 载入创建数据 /// </summary> /// <returns></returns> public ActionResult Create() { ViewBag.Departments = CacheAccess.GetDepartmentListItem(_departmentContract, false); return(PartialView()); }
public ActionResult Create() { ViewBag.Departments = CacheAccess.GetDepartmentListItem(_DepartmentContract, true, DepartmentTypeFlag.设计); ViewBag.Brands = CacheAccess.GetBrand(_brandContract, true, false); return(PartialView()); }