zoukankan      html  css  js  c++  java
  • checkedListBox使用例子

      #region 初始化资料查询界面
            public void InitFeelsInfoGrid()
            {
                EatGood.Model.FoodManage.SearchFeelKind model = new EatGood.Model.FoodManage.SearchFeelKind();

                model.FShopId = fshopid.ToString();


                #region 动态组织SQL语句
                string stre = null;
                for (int i = 0; i < checkedListBox2.Items.Count; i++)
                {
                    if (checkedListBox2.GetItemChecked(i))
                    {
                        stre += "FeelKindName in('" + checkedListBox2.GetItemText(checkedListBox2.Items[i]) + "') or ";
                    }
                }
                if (stre != null)
                {
                    model.FeelKindName = strw + "(" + stre.Substring(0, stre.Length - 3) + ")";
                }
                stre = null;
                for (int i = 0; i < checkedListBox3.Items.Count; i++)
                {
                    if (checkedListBox3.GetItemChecked(i))
                    {
                        stre += "kindname in('" + checkedListBox3.GetItemText(checkedListBox3.Items[i]) + "') or ";
                    }
                }
                if (stre != null)
                {
                    model.Kindname = strw + "(" + stre.Substring(0, stre.Length - 3) + ")";
                }

                #endregion
                model.FeelNo = textBox1.Text.Trim();
                model.FeelName = textBox2.Text.Trim();
                SQL = model.GetSQLFromTempl();
                DataSet ds = sfk.SearchFeelsInfo(SQL);
                BindFeelsInfoGrid(ds);
            }

            private void BindFeelsInfoGrid(DataSet ds)
            {
                SongTao3 st3 = new SongTao3();
                st3.Show();
                this.Hide();
                if (checkBox1.Checked)
                {
                    st3.dataGridView1.DataSource = ds.Tables[0].DefaultView;
                }
                else
                {
                    st3.dataGridView1.DataSource = ds.Tables[0].DefaultView;
                    st3.dataGridView1.Columns.Remove("comname");
                }
            }
            #endregion 

  • 相关阅读:
    CSU 1605 数独
    HDU 1426 dancing links解决数独问题
    FZU 1686 dlx重复覆盖
    hdu 2295 dlx重复覆盖+二分答案
    zju 3209 dancing links 求取最小行数
    hust 1017 dancing links 精确覆盖模板题
    POJ 1724 二维费用最短路
    【转载】学习总结:初等数论(3)——原根、指标及其应用
    【poj3415-Common Substrings】sam子串计数
    【hdu4436/LA6387-str2int】sam处理不同子串
  • 原文地址:https://www.cnblogs.com/a1991322/p/2650714.html
Copyright © 2011-2022 走看看