Example #1
0
        private void btnEditCustomers_Click(object sender, EventArgs e)
        {
            if (grdCostumers.SelectedRows.Count > 0)
            {
                AddOrUpdateCustomerForm form = new AddOrUpdateCustomerForm(this);

                form.isEdit            = true;
                form.lblCustomer.Text  = "Modificar Datos";
                form.txtDni.Text       = grdCostumers.CurrentRow.Cells["DNI"].Value.ToString();
                form.txtNombre.Text    = grdCostumers.CurrentRow.Cells["Nombre"].Value.ToString();
                form.txtApellido.Text  = grdCostumers.CurrentRow.Cells["Apellido"].Value.ToString();
                form.txtDireccion.Text = grdCostumers.CurrentRow.Cells["Direccion"].Value.ToString();
                form.txtTelefono.Text  = grdCostumers.CurrentRow.Cells["Telefono"].Value.ToString();
                form.idCustomer        = grdCostumers.CurrentRow.Cells["Id"].Value.ToString();
                form.Show();
            }
            else
            {
                MessageBox.Show("Seleccione una fila!!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #2
0
        private void btnAddCustomers_Click(object sender, EventArgs e)
        {
            AddOrUpdateCustomerForm form = new AddOrUpdateCustomerForm(this);

            form.ShowDialog();
        }