コード例 #1
0
        public List <Model.UserAdmin> GetUserSelectItems(int id)
        {
            Business.Sys_UserAdmin Sys_UserAdmin = new Business.Sys_UserAdmin();
            List <Model.UserAdmin> list          = Sys_UserAdmin.GetUserAdminListByRoleCodeNo("Customer");

            Model.UserAdmin useradmin = Sys_UserAdmin.GetUserAdminByUserId(id);
            if (string.IsNullOrEmpty(useradmin.WorkUsersId))
            {
                return(list);
            }
            string[] checkList = useradmin.WorkUsersId.Split(',');
            string   msg       = string.Empty;



            return(Sys_UserAdmin.GetUserAdminListByRoleCodeNo("Customer"));
            //List<SelectListItem> deptSelectItems = new List<SelectListItem>();
            //SelectListItem item = new SelectListItem();
            //foreach (Model.UserAdmin d in UserAdminList)
            //{
            //    item = new SelectListItem();
            //    item.Text = d.RealName;
            //    item.Value = d.ID.ToString();
            //    item.Selected = false;
            //    deptSelectItems.Add(item);
            //}
            //return deptSelectItems;
        }
コード例 #2
0
        public List <SelectListItem> GetUserInfoSelectItems()
        {
            Business.Sys_UserAdmin Sys_UserAdmin   = new Business.Sys_UserAdmin();
            List <Model.UserAdmin> list            = Sys_UserAdmin.GetUserAdminListByRoleCodeNo("Customer");
            List <SelectListItem>  deptSelectItems = new List <SelectListItem>();
            SelectListItem         item            = new SelectListItem();

            item.Text     = "-请选择-";
            item.Value    = "";
            item.Selected = true;
            deptSelectItems.Add(item);
            foreach (Model.UserAdmin d in list)
            {
                item          = new SelectListItem();
                item.Text     = d.RealName;
                item.Value    = d.ID.ToString();
                item.Selected = false;
                deptSelectItems.Add(item);
            }
            return(deptSelectItems);
        }
コード例 #3
0
        /// <summary>
        /// 绑定养护人、客户
        /// </summary>
        /// <param name="rolecode"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public List <SelectListItem> GetUserInfoSelectItems(string rolecode, string type)
        {
            Business.Sys_UserAdmin Sys_UserAdmin   = new Business.Sys_UserAdmin();
            List <Model.UserAdmin> list            = new List <Model.UserAdmin>();
            List <SelectListItem>  deptSelectItems = new List <SelectListItem>();
            SelectListItem         item            = new SelectListItem();

            if (type == "0")
            {
                item.Text     = "-请选择-";
                item.Value    = "";
                item.Selected = true;
                deptSelectItems.Add(item);
                list = Sys_UserAdmin.GetUserAdminListByRoleCodeNo(rolecode);//不等于
                foreach (Model.UserAdmin d in list)
                {
                    item          = new SelectListItem();
                    item.Text     = d.RealName;
                    item.Value    = d.ID.ToString();
                    item.Selected = true;
                    deptSelectItems.Add(item);
                }
            }
            else
            {
                list = Sys_UserAdmin.GetAdminInfoList(rolecode);
                foreach (Model.UserAdmin d in list)
                {
                    item          = new SelectListItem();
                    item.Text     = d.OwnedCompany;
                    item.Value    = d.ID.ToString();
                    item.Selected = true;
                    deptSelectItems.Add(item);
                }
            }
            return(deptSelectItems);
        }