Пример #1
0
        private void LoadMember()
        {
            //根据会员编号和会员电话进行查询
            Dictionary <string, string> dic = new Dictionary <string, string>();

            if (txtId.Text != "")
            {
                dic.Add("mid", txtId.Text);
            }
            if (txtPhone.Text != "")
            {
                dic.Add("mPhone", txtPhone.Text);
            }

            VIPInfoBll miBll = new VIPInfoBll();
            var        list  = miBll.GetList(dic);

            if (list.Count > 0)
            {
                //根据信息查到了会员
                VIPInfo mi = list[0];
                lblMoney.Text     = mi.MCount.ToString();
                lblTypeTitle.Text = mi.MTypeTitle;
                lblDiscount.Text  = mi.MDiscount.ToString();

                //计算折扣价
                lblPayMoneyDiscount.Text =
                    (Convert.ToDecimal(lblPayMoney.Text) * Convert.ToDecimal(lblDiscount.Text)).ToString();
            }
            else
            {
                MessageBox.Show("会员信息有误");
            }
        }
Пример #2
0
        /// <summary>
        /// 刷新和初始化查询
        /// </summary>
        void Refresh()
        {
            //这里将初始化dgv和查询功能做在一起
            Dictionary <string, string> dic = new Dictionary <string, string>();

            if (txtNameSearch.Text != "")
            {
                dic.Add("mname", txtNameSearch.Text);
            }
            if (txtPhoneSearch.Text != "")
            {
                dic.Add("mphone", txtPhoneSearch.Text);
            }

            txtId.Text       = "添加时无编号";
            txtNameAdd.Text  = "";
            txtPhoneAdd.Text = "";
            txtMoney.Text    = "";
            btnSave.Text     = "保存";

            dgvList.AutoGenerateColumns = false;
            dgvList.DataSource          = bll.GetList(dic);
            dgvList.ClearSelection();
        }