Ejemplo n.º 1
0
        private void btnCar_Click(object sender, EventArgs e)
        {
            frmCar frm = new frmCar();

            frm.Show();
            this.Hide();
        }
Ejemplo n.º 2
0
        private void DataGridView3_CellContentClick(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
        {
            var senderGrid = (DataGridView)sender;

            var cell = ((DataGridView)sender).SelectedCells[0];

            if (cell.Value.ToString() == "ویرایش")
            {
                var    id  = Convert.ToInt16(((DataGridView)sender).CurrentRow.Cells[2].Value);
                frmCar frm = new frmCar((int)id);
                frm.ShowDialog();
            }
            else if (cell.Value.ToString() == "حذف")
            {
                var id     = Convert.ToInt16(((DataGridView)sender).CurrentRow.Cells[2].Value);
                var result = MessageBox.Show("آیا اطمینان دارید ؟ ", "حذف", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes)
                {
                    BaseData.removeItem((int)id, "cars");
                }
            }
        }
Ejemplo n.º 3
0
        private void btnNewCar_Click(object sender, EventArgs e)
        {
            frmCar frm = new frmCar();

            frm.ShowDialog();
        }