/// <summary> /// 加载平台列表 /// </summary> private void LoadPlatform() { List <SelectListItem> platformList = new List <SelectListItem>(); platformList.Add(new SelectListItem() { Text = "所有平台", Value = "0" }); foreach (var item in EnumHelper.BEnumToDictionary(typeof(Entity.APPVersionPlatforms))) { string text = EnumHelper.GetDescription <Entity.APPVersionPlatforms>((Entity.APPVersionPlatforms)item.Key); platformList.Add(new SelectListItem() { Text = text, Value = item.Key.ToString() }); } ViewData["PlatformsList"] = platformList; List <SelectListItem> typeList = new List <SelectListItem>(); typeList.Add(new SelectListItem() { Text = "所有类别", Value = "0" }); foreach (var item in EnumHelper.BEnumToDictionary(typeof(Entity.APPVersionType))) { string text = EnumHelper.GetDescription <Entity.APPVersionType>((Entity.APPVersionType)item.Key); typeList.Add(new SelectListItem() { Text = text, Value = item.Key.ToString() }); } ViewData["TypeList"] = typeList; }
/// <summary> /// 加载平台列表 /// </summary> private void LoadType() { List <SelectListItem> typeList = new List <SelectListItem>(); //typeList.Add(new SelectListItem() { Text = "所有类别", Value = "0" }); foreach (var item in EnumHelper.BEnumToDictionary(typeof(Entity.SysDbBackType))) { string text = EnumHelper.GetDescription((Entity.SysDbBackType)item.Key); typeList.Add(new SelectListItem() { Text = text, Value = item.Key.ToString() }); } ViewData["TypeList"] = typeList; BLL.BLLSysDbBack bll = new BLL.BLLSysDbBack(); var db_list = bll.GetSysDbList(); List <SelectListItem> dbList = new List <SelectListItem>(); dbList.Add(new SelectListItem() { Text = "请选择数据库", Value = "" }); foreach (var item in db_list) { dbList.Add(new SelectListItem() { Text = item.name, Value = item.name }); } ViewData["dbList"] = dbList; }
public ActionResult LogMethod(int page = 1, int type = 0, string word = "") { List <SelectListItem> typeList = new List <SelectListItem>(); typeList.Add(new SelectListItem() { Text = "所有日志", Value = "0" }); foreach (var item in EnumHelper.BEnumToDictionary(typeof(Entity.SysLogMethodType))) { string text = EnumHelper.GetDescription <Entity.SysLogMethodType>((Entity.SysLogMethodType)item.Key); typeList.Add(new SelectListItem() { Text = text, Value = item.Key.ToString() }); } ViewData["LogMethod_Type"] = typeList; word = WebHelper.UrlDecode(word); Models.ViewModelLogMethod response_model = new Models.ViewModelLogMethod(); response_model.page = page; response_model.word = word; //获取每页大小的Cookie response_model.page_size = TypeHelper.ObjectToInt(WebHelper.GetCookie("logmethodindex"), SiteKey.AdminDefaultPageSize); int total = 0; List <BLL.FilterSearch> filter = new List <BLL.FilterSearch>(); if (type != 0) { filter.Add(new BLL.FilterSearch("Type", type.ToString(), BLL.FilterSearchContract.等于)); } if (!string.IsNullOrWhiteSpace(word)) { filter.Add(new BLL.FilterSearch("Detail", word, BLL.FilterSearchContract.like)); } BLL.BaseBLL <Entity.SysLogMethod> bll = new BLL.BaseBLL <Entity.SysLogMethod>(); var list = bll.GetPagedList(page, response_model.page_size, ref total, filter, "AddTime desc", "SysUser"); response_model.DataList = list; response_model.total = total; response_model.total_page = CalculatePage(total, response_model.page_size); return(View(response_model)); }