Esempio n. 1
0
        private void BindList()
        {
            VipSoft.BLL.MemCard memCard = new BLL.MemCard();
            DataSet ds = memCard.GetList(pageSize, currentPage, out resCount, condition);
            this.dataGridView_List.DataSource = ds.Tables[0];

            for (int i = 0; i < dataGridView_List.Rows.Count; i++)
            {
                dataGridView_List.Rows[i].Cells[0].Value = false;
            }

            BindPage();
        }
        public void search_Click(object sender, EventArgs e)
        {
            String conditionStr = "";
            if (this.search_box.Text == null)
            {
                MessageBox.Show("请先录入会员卡号或者手机号。");
                search_box.Focus();
                return;
            }

            conditionStr += " cardid ='"+search_box.Text+"' or mobile ='"+search_box.Text+"' ";

            VipSoft.BLL.MemCard memCard = new BLL.MemCard();
            DataSet ds = memCard.GetList(conditionStr);
            DataTable dt = ds.Tables[0];
            if (dt != null && dt.Rows.Count > 0)
            {

                DataRow dr = dt.Rows[0];
                this.v_cardid.Text = dr["cardid"].ToString();
                this.name.Text = dr["name"].ToString();
                this.v_money.Text = dr["money"].ToString();
                this.totalMoney.Text = dr["totalMoney"].ToString();
                this.point.Text = dr["point"].ToString();
                this.mobile.Text = dr["mobile"].ToString();
                this.pasttime.Text = dr["pasttime"].ToString().Substring(0, 10);
                this.levelid.Text = dr["levelid"].ToString();
                this.id.Text = dr["id"].ToString();

            }
            else
            {

                this.v_cardid.Text = "";
                this.name.Text = "";
                this.v_money.Text ="";
                this.totalMoney.Text = "";
                this.point.Text = "";
                this.mobile.Text = "";
                this.pasttime.Text ="";
                this.levelid.Text = "";
                this.id.Text = "";
            }

            //SearchMem searchDlg = new SearchMem();

               // this.dataGridView_List.DataSource = ds.Tables[0];
        }