Beispiel #1
0
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            string vipid = textBox1.Text;

            if (vipid.Length == 0)
            {
                label15.Text = "";
                label16.Text = "";
                VGDiscount   = 1;
                label17.Text = "";
                label10.Text = price + "";
                label22.Text = 0 + "";
                return;
            }
            List <VipsMDL> list = VipsBLL.GetVip(int.Parse(textBox1.Text));

            if (list.Count <= 0)
            {
                label15.Text = "会员不存在/已过期";
                label16.Text = "";
                VGDiscount   = 1;
                label17.Text = "";
                label10.Text = price + "";

                return;
            }
            label15.Text = list[0].VipName;
            label16.Text = list[0].VGName;
            VGDiscount   = list[0].VGDiscount;
            label17.Text = VGDiscount.ToString();
            label10.Text = price * VGDiscount + "";
            label22.Text = price - (price * VGDiscount) + "";
        }
Beispiel #2
0
        private void FrmVip_Load(object sender, EventArgs e)
        {
            List <VipsMDL> list = VipsBLL.GetVip(0);

            list.Insert(0, new VipsMDL()
            {
                VipName = "添加", VipID = 0
            });
            foreach (VipsMDL item in list)
            {
                ListViewItem lvi = new ListViewItem();
                if (item.VipID == 0)
                {
                    lvi.ImageIndex = 0;
                }
                else
                {
                    lvi.ImageIndex = 1;
                }

                lvi.Tag  = item.VipID;
                lvi.Text = item.VipName;

                listView1.Items.Add(lvi);
            }
        }