Пример #1
0
 private void Add_Click(object sender, EventArgs e)
 {
     if (CheckInput())
     {
         bool flag = TicketInfoManager.AddTicket(tbTicketType.Text, tbTicketPrice.Text);
         tbTicketType.Text  = "";
         tbTicketPrice.Text = "";
         MessageBox.Show("添加成功");
         dgvBFInfo.DataSource = TicketInfoManager.SelectTicketAll();
     }
 }
Пример #2
0
        private void FrmBF_Load(object sender, EventArgs e)
        {
            dgvBFInfo.AutoGenerateColumns = false;
            dgvBFInfo.DataSource          = TicketInfoManager.SelectTicketAll();
            DataGridViewColumn Type_Column = new DataGridViewTextBoxColumn();

            Type_Column.HeaderText       = "餐票类型";
            Type_Column.DataPropertyName = "Ticket_Type";
            dgvBFInfo.Columns.Add(Type_Column);
            DataGridViewColumn Price_Column = new DataGridViewTextBoxColumn();

            Price_Column.HeaderText       = "餐票价格";
            Price_Column.DataPropertyName = "Ticket_Price";
            dgvBFInfo.Columns.Add(Price_Column);
        }
Пример #3
0
        private void Delete_Click(object sender, EventArgs e)
        {
            int index = -1;

            index = dgvBFInfo.CurrentRow.Index;
            string name = dgvBFInfo.Rows[index].Cells[0].Value.ToString();
            bool   flag = TicketInfoManager.DeleteMemberByName(name);

            if (flag == true)
            {
                dgvBFInfo.DataSource = TicketInfoManager.SelectTicketAll();
            }
            else
            {
                MessageBox.Show("删除失败。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }