private void LoadList() { StringBuilder sb = new StringBuilder(); DataTable dt = null; int s_rstyle = pub.GetInt(AppPub.GetDropDownValue(cBrstyle), "-1"); if (s_rstyle > -1) { pub.StrAdd(ref sb, " rstyle=" + s_rstyle.ToString() + " ", " and "); } int s_lv = pub.GetInt(AppPub.GetDropDownValue(cBlv), "-1"); if (s_lv > -1) { pub.StrAdd(ref sb, " level=" + s_lv.ToString() + " ", " and "); } int s_zt = pub.GetInt(AppPub.GetDropDownValue(cBzt), "-1"); if (s_zt > -1) { pub.StrAdd(ref sb, " isuse=" + s_zt.ToString() + " ", " and "); } string sxm = AppPub.GetDropDownValue(cBsxm); string skey = tBskey.Text.Trim(); if (skey != "") { pub.StrAdd(ref sb, " " + sxm + " like '%" + skey + "%' ", " and "); } if (sb.Length > 0) { dt = App.DataOften.GetTable(App.MayorsPowers.MayorsPowerTable.Select(sb.ToString())); } else { dt = App.MayorsPowers.MayorsPowerTable; } vlist.Items.Clear(); for (int i = 0; i < dt.Rows.Count; i++) { ListViewItem itema = new ListViewItem((i + 1).ToString(), 0); string level = WebOften.GetListVal(AppList.L_MayorsLevel(), DataOften.GetVal(dt, "level", i)); itema.SubItems.Add(level); string rstyle = WebOften.GetListVal(AppList.L_MayorsRewardStyle(), DataOften.GetVal(dt, "rstyle", i)); itema.SubItems.Add(rstyle); itema.SubItems.Add(DataOften.GetVal(dt, "depict", i)); itema.SubItems.Add(DataOften.GetVal(dt, "name", i)); itema.SubItems.Add(DataOften.GetVal(dt, "sign", i)); itema.SubItems.Add(DataOften.GetVal(dt, "min", i)); itema.SubItems.Add(DataOften.GetVal(dt, "max", i)); itema.SubItems.Add(DataOften.GetVal(dt, "dw", i)); itema.SubItems.Add(DataOften.GetVal(dt, "mtype", i)); string qy = WebOften.GetListVal(AppList.L_IsUser(), DataOften.GetVal(dt, "isuse", i)); AppPub.SetSubItemsStyle(ref itema, qy, "已起用|已停用", "#69CE1F|#FF0000"); itema.SubItems.Add(DataOften.GetVal(dt, "mid", i)); vlist.Items.AddRange(new ListViewItem[] { itema }); } }