日期:2014-05-20 浏览次数:20854 次
<select name="UType" id="UType" data-val-required="UType 字段是必需的。" data-val-number="字段 UType 必须是一个数字。" data-val="true"><option value="">请选择行业</option> <option value="1" selected="selected">精英设计师</option> </select>
<select name="HangYe" id="HangYe"><option value="">请选择行业</option> <option value="2">展馆设计</option> </select>
#region 个人分类 var usertype = context.UserTypes.OrderByDescending(t => t.Sort).ToList(); var gerenitemlist = new List<SelectListItem>(); var gerendefault = new SelectListItem(); gerendefault.Value = ""; gerendefault.Text = "选择分类"; gerenitemlist.Add(gerendefault); foreach (var entity in usertype) { var item = new SelectListItem(); item.Value = entity.TID.ToString(); item.Text = entity.TName; gerenitemlist.Add(item); } ViewBag.UserType = gerenitemlist; #endregion #region 所在行业 var tid = user.Iscompany ? 2 : 1; var hangye = context.Industrys.Where(i => i.TID == tid).ToList(); var hyitemlist = new List<SelectListItem>(); var itemdefault = new SelectListItem(); itemdefault.Value = ""; itemdefault.Text = "请选择行业"; hyitemlist.Add(itemdefault); foreach (var entity in hangye) { var item = new SelectListItem(); item.Value = entity.InID.ToString(); item.Text = entity.InName; hyitemlist.Add(item); } ViewBag.hangye = hyitemlist; #endregion