예제 #1
0
        private void GetListToViewBag(Area pht)
        {
            List <Area> phts = bll.Areas.ToList();

            if (pht != null)
            {
                Area pht0 = phts.Find(i => i.Id == pht.Id);
                if (pht0 != null)
                {
                    phts.Remove(pht0);//删除本身,编辑时不能让自己成为自己的子节点
                }
            }
            SelectList list = new SelectList(phts, "Id", "Name");

            ViewBag.List = list.AsEnumerable();

            ViewBag.EnumList = EnumToList.EnumToListChoice <AreaTypes>();
            //List<SelectListItem> list2 = new List<SelectListItem>();
            //var enumtype = typeof(Types);
            //foreach (var obj in Enum.GetValues(enumtype))
            //{
            //    list2.Add(new SelectListItem { Text = obj.ToString(), Value = obj.ToString() });
            //}

            //ViewBag.EnumList = list2;
        }
예제 #2
0
        private void GetListToViewBag()
        {
            List <Area> Pts    = bll.Areas.ToList();
            SelectList  PtList = new SelectList(Pts, "Id", "Name");

            ViewBag.PtList = PtList.AsEnumerable();

            ViewBag.Abutment_DevTypesList  = EnumToList.EnumToListChoice <Abutment_DevTypes>();
            ViewBag.Abutment_StatusList    = EnumToList.EnumToListChoice <Abutment_Status>();
            ViewBag.Abutment_RunStatusList = EnumToList.EnumToListChoice <Abutment_RunStatus>();
        }
        private void GetListToViewBag()
        {
            List <Area>            areaList  = bll.Areas.ToList();
            SelectList             selList   = new SelectList(areaList, "Id", "Name");
            IList <SelectListItem> TypeItem  = EnumToList.EnumToListChoice <ArchorTypes>();
            IList <SelectListItem> StartItem = EnumToList.EnumToListChoice <IsStart>();

            ViewBag.selList   = selList.AsEnumerable();
            ViewBag.TypeItem  = TypeItem;
            ViewBag.StartItem = StartItem;
        }
예제 #4
0
        private void GetListToViewBag()
        {
            List <Area> Pts    = bll.Areas.ToList();
            SelectList  PtList = new SelectList(Pts, "Id", "Name");

            ViewBag.PtList = PtList.AsEnumerable();

            List <CardRole> CardRoles    = bll.CardRoles.ToList();
            SelectList      CardRoleList = new SelectList(CardRoles, "Id", "Name");

            ViewBag.CardRoleList = CardRoleList.AsEnumerable();

            ViewBag.EnumList            = EnumToList.EnumToListChoice <RepeatDay>();
            ViewBag.TimeSettingTypeList = EnumToList.EnumToListChoice <TimeSettingType>();
            ViewBag.AreaAccessTypeList  = EnumToList.EnumToListChoice <AreaAccessType>();
        }
        private void GetListToViewBag()
        {
            List <Area> Pts    = bll.Areas.ToList();
            SelectList  PtList = new SelectList(Pts, "Id", "Name");

            ViewBag.PtList = PtList.AsEnumerable();

            List <LocationCard> Tags    = bll.LocationCards.ToList();
            SelectList          TagList = new SelectList(Tags, "Id", "Name");

            ViewBag.TagList = TagList.AsEnumerable();

            ViewBag.EnumList = EnumToList.EnumToListChoice <RepeatDay>();

            List <SelectListItem> RepeatTypeList = new List <SelectListItem>();

            RepeatTypeList.Add(new SelectListItem {
                Text = "每天", Value = "每天"
            });
            RepeatTypeList.Add(new SelectListItem {
                Text = "星期一", Value = "星期一"
            });
            RepeatTypeList.Add(new SelectListItem {
                Text = "星期二", Value = "星期二"
            });
            RepeatTypeList.Add(new SelectListItem {
                Text = "星期三", Value = "星期三"
            });
            RepeatTypeList.Add(new SelectListItem {
                Text = "星期四", Value = "星期四"
            });
            RepeatTypeList.Add(new SelectListItem {
                Text = "星期五", Value = "星期五"
            });
            RepeatTypeList.Add(new SelectListItem {
                Text = "星期六", Value = "星期六"
            });
            RepeatTypeList.Add(new SelectListItem {
                Text = "星期天", Value = "星期天"
            });
            RepeatTypeList.Add(new SelectListItem {
                Text = "一次", Value = "一次"
            });
            ViewBag.RepeatTypeList = RepeatTypeList;
        }
예제 #6
0
        private void GetDepListToViewBag(Department dep)
        {
            List <Department> deps = bll.Departments.ToList();

            if (dep != null)
            {
                Department dep0 = deps.Find(i => i.Id == dep.Id);
                if (dep0 != null)
                {
                    deps.Remove(dep0);//删除本身,编辑时不能让自己成为自己的子节点
                }
            }
            SelectList             list     = new SelectList(deps, "Id", "Name");
            IList <SelectListItem> listItem = EnumToList.EnumToListChoice <DepartType>();

            ViewBag.List    = list.AsEnumerable();
            ViewBag.selList = listItem;
        }
예제 #7
0
        private void GetListToViewBag(Area pht)
        {
            List <Area> phts = bll.Areas.ToList();

            if (pht != null)
            {
                Area pht0 = phts.Find(i => i.Id == pht.Id);
                if (pht0 != null)
                {
                    phts.Remove(pht0);//删除本身,编辑时不能让自己成为自己的子节点
                }
            }
            SelectList list = new SelectList(phts, "Id", "Name");

            ViewBag.List = list.AsEnumerable();

            ViewBag.EnumList = EnumToList.EnumToListChoice <AreaTypes>();
        }