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 }); } }
private void frmMayors_Load(object sender, EventArgs e) { AppPub.SetComboBoxItems(cBrstyle, "|全部||" + App.AppList.L_MayorsRewardStyle(), ""); AppPub.SetComboBoxItems(cBlv, "|全部||" + App.AppList.L_MayorsLevel(), ""); AppPub.SetComboBoxItems(cBzt, "|全部||" + App.AppList.L_IsUser(), ""); AppPub.SetComboBoxItems(cBsxm, App.AppList.L_MayorsSearchType(), "depict"); ynlmin = App.pub.GetInt(tBnlmin.Text, "10"); ynlmax = App.pub.GetInt(tBnlmax.Text, "12"); yzymin = App.pub.GetInt(tBzymin.Text, "0"); yzymax = App.pub.GetInt(tBzymax.Text, "2"); yjsmin = App.pub.GetInt(tBjsmin.Text, "0"); yjsmax = App.pub.GetInt(tBjsmax.Text, "2"); ydwmin = App.pub.GetInt(tBdwmin.Text, "0"); ydwmax = App.pub.GetInt(tBdwmax.Text, "2"); ymodmin = App.pub.GetInt(tBmodmin.Text, "5"); ymodmax = App.pub.GetInt(tBmodmax.Text, "6"); LoadList(); }