Exemplo n.º 1
0
 /// <summary>
 /// 司机表格编辑、删除
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgvDriverListSJ_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvDriverListSJ.Columns[e.ColumnIndex].Name == "btnEditDriver")
     {
         Form blackNameListEdit = new EditDriverForm(GetDriverByRow());
         blackNameListEdit.Show();
     }
     if (dgvDriverListSJ.Columns[e.ColumnIndex].Name == "btnDeleteDriver")
     {
         try
         {
             int Id = Convert.ToInt32(dgvDriverListSJ.CurrentRow.Cells["Id"].Value.ToString());
             if (MessageBox.Show("确定删除?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
             {
                 driverListBll.DeleteById(Id);
                 MessageBox.Show("删除成功");
                 dgvDriverListSJ.DataSource         = driverListBll.FindAllInfo();
                 dgvDriverListSJ.Columns[4].Visible = false;
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 司机表格编辑、删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvDriverListSJ_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dgvDriverListSJ.Columns[e.ColumnIndex].Name == "btnEditDriver")
            {
                Form blackNameListEdit = new EditDriverForm(GetDriverByRow());
                blackNameListEdit.Show();
            }
            if (dgvDriverListSJ.Columns[e.ColumnIndex].Name == "btnDeleteDriver")
            {

                try
                {
                    int Id = Convert.ToInt32(dgvDriverListSJ.CurrentRow.Cells["Id"].Value.ToString());
                    if (MessageBox.Show("确定删除?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        driverListBll.DeleteById(Id);
                        MessageBox.Show("删除成功");
                        dgvDriverListSJ.DataSource = driverListBll.FindAllInfo();
                        dgvDriverListSJ.Columns[4].Visible = false;
                    }

                }
                catch (Exception ex)
                {

                    MessageBox.Show(ex.Message);
                }
            }
        }
Exemplo n.º 3
0
 //新增司机
 private void btnAddDriver_Click(object sender, EventArgs e)
 {
     Form DriverListEdit = new EditDriverForm();
     DriverListEdit.Show();
 }
Exemplo n.º 4
0
        //新增司机
        private void btnAddDriver_Click(object sender, EventArgs e)
        {
            Form DriverListEdit = new EditDriverForm();

            DriverListEdit.Show();
        }