public ProveedorAccion(string v, int v1) { InitializeComponent(); if (v1 == 1) { Text = v; btnModificar.Hide(); btnBorrar.Hide(); CodigoPostalBusiness codigoPostalBusiness = new CodigoPostalBusiness(); cmbCodigoPostal.DataSource = codigoPostalBusiness.listar(); lblId.Hide(); lblNumId.Hide(); } else if (v1 == 2) { Text = v; btnAgregar.Hide(); btnModificar.Hide(); } else if (v1 == 3) { Text = v; btnAgregar.Hide(); btnBorrar.Hide(); CodigoPostalBusiness codigoPostalBusiness = new CodigoPostalBusiness(); cmbCodigoPostal.DataSource = codigoPostalBusiness.listar(); } }
public AccionBorrarCodigoPostal() { InitializeComponent(); CodigoPostalBusiness codigoPostalBusiness = new CodigoPostalBusiness(); cmbCodigoPostal.DataSource = codigoPostalBusiness.listar(); }
private void btnModificar_Click_1(object sender, EventArgs e) { { ClienteAccion clienteAccion = new ClienteAccion("Modificar", 3); ClienteBusiness clienteBusiness = new ClienteBusiness(); CodigoPostalBusiness codigoPostalBusiness = new CodigoPostalBusiness(); Cliente cliente = new Cliente(); try { CodigoPostal codigoPostal = new CodigoPostal(); int num = Convert.ToInt32(lblNumId.Text.ToString()); cliente.Dni = Convert.ToInt64(txtDni.Text.ToString().Trim()); cliente.NroCliente = Convert.ToInt32(txtNumeroCliente.Text.Trim()); cliente.Apellido = txtApellido.Text.ToString().Trim(); cliente.Nombre = txtNombre.Text.ToString().Trim(); cliente.Direccion = txtDireccion.Text.ToString().Trim(); cliente.Cp = Convert.ToInt32(cmbCodigoPostal.SelectedValue.ToString()); cliente.Telefono = Convert.ToInt64(txtTelefono.Text); cliente.Mail = txtMail.Text.ToString().Trim(); clienteBusiness.eliminar(num); clienteBusiness.agregar(cliente); MessageBox.Show("Modificado con éxito"); this.Close(); cmbCodigoPostal.DataSource = codigoPostalBusiness.listar(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } }
public AccionAgregarCodigoPostal() { InitializeComponent(); CodigoPostalBusiness codigoPostalBusiness = new CodigoPostalBusiness(); cmbProvincia.DataSource = codigoPostalBusiness.listar(); CodigoPostal cod = (CodigoPostal)cmbProvincia.SelectedItem; }
public frmModificarUsuario2() { InitializeComponent(); PuestoBusiness puestoBusiness = new PuestoBusiness(); HorarioBusiness horarioBusiness = new HorarioBusiness(); CodigoPostalBusiness codigoPostalBusiness = new CodigoPostalBusiness(); cmbPuesto.DataSource = puestoBusiness.leerPuestos(); cmbHorarios.DataSource = horarioBusiness.leerHorarios(); cmbCodigoPostal.DataSource = codigoPostalBusiness.listar(); }
public frmAgregarUsuario() { InitializeComponent(); PuestoBusiness puestoBusiness = new PuestoBusiness(); HorarioBusiness horarioBusiness = new HorarioBusiness(); CodigoPostalBusiness codigoPostalBusiness = new CodigoPostalBusiness(); CodigoPostal codigoPostal = new CodigoPostal(); cmbPuesto.DataSource = puestoBusiness.leerPuestos(); cmbHorarios.DataSource = horarioBusiness.leerHorarios(); cmbCodigoPostal.DataSource = codigoPostalBusiness.listar(); rdbHombre.Checked = true; }
private void AccionAgregarCodigoPostal_Load(object sender, EventArgs e) { CodigoPostalBusiness codigoPostalBusiness = new CodigoPostalBusiness(); CodigoPostal codigoPostal = new CodigoPostal(); cmbProvincia.DataSource = codigoPostalBusiness.listar(); try { CodigoPostal cod = (CodigoPostal)cmbProvincia.SelectedItem; cmbProvincia.Text = cod.Provincia; cmbPais.Text = cod.Pais; } catch (Exception ex) { throw ex; } }
private void btnBorrar_Click(object sender, EventArgs e) { if (cmbCodigoPostal.Items.Count != 0) { CodigoPostalBusiness codigoPostalBusiness = new CodigoPostalBusiness(); CodigoPostal codigo = (CodigoPostal)cmbCodigoPostal.SelectedItem; codigoPostalBusiness.eliminar(codigo.cp); MessageBox.Show("Eliminado con exito"); cmbCodigoPostal.DataSource = codigoPostalBusiness.listar(); } else { CodigoPostalBusiness codigoPostalBusiness = new CodigoPostalBusiness(); cmbCodigoPostal.DataSource = codigoPostalBusiness.listar(); MessageBox.Show("No hay item para eliminar"); } }
public frmBorrarCP() { InitializeComponent(); CodigoPostalBusiness codigoPostalBusiness = new CodigoPostalBusiness(); cmbCodigoPostal.DataSource = codigoPostalBusiness.listar(); CodigoPostal codigoPostal = (CodigoPostal)cmbCodigoPostal.SelectedItem; if (cmbCodigoPostal.Items.Count == 0) { txtLocalidad.Text = ""; } else { txtLocalidad.Text = codigoPostal.Localidad; } }
public void cargarFormulario(Interno interno) { InitializeComponent(); lblid.Hide(); PuestoBusiness puestoBusiness = new PuestoBusiness(); HorarioBusiness horarioBusiness = new HorarioBusiness(); CodigoPostalBusiness codigoPostalBusiness = new CodigoPostalBusiness(); cmbPuesto.DataSource = puestoBusiness.leerPuestos(); cmbHorarios.DataSource = horarioBusiness.leerHorarios(); cmbCodigoPostal.DataSource = codigoPostalBusiness.listar(); lblid.Text = interno.idinterno.ToString(); txtDNI.Text = interno.Dni.ToString(); txtLegajo.Text = interno.NumeroLegajo.ToString(); txtNombre.Text = interno.Nombre.ToString(); txtApellido.Text = interno.Apellido.ToString(); dtpFnac.Text = interno.Fnac.ToLongDateString(); txtDireccion.Text = interno.Direccion.ToString(); if (cmbCodigoPostal.Items.Count == 0) { cmbCodigoPostal.Text = "Vacio"; txtLocalidad.Text = "Vacio"; txtProvincia.Text = "Vacio"; txtPais.Text = "Vacio"; } else { cmbCodigoPostal.Text = interno.codigoPostal.cp.ToString(); txtLocalidad.Text = interno.codigoPostal.Localidad.ToString(); txtProvincia.Text = interno.codigoPostal.Provincia.ToString(); txtPais.Text = interno.codigoPostal.Pais.ToString(); } cmbPuesto.SelectedIndex = (interno.puesto.IdPuesto) - 1; cmbHorarios.SelectedIndex = (interno.horario.id) - 1; txtUsuario.Text = interno.Usuario.ToString(); txtClave.Text = interno.Clave.ToString(); if (interno.Sexo.Contains("Hombre")) { rdbHombre.Checked = true; } else { rdbMujer.Checked = true; } txtMail.Text = interno.mail.ToString(); }
private void btnModificar_Click(object sender, EventArgs e) { { ProveedorAccion proveedorAccion = new ProveedorAccion("Modificar", 3); ProveedorBusiness proveedorBusiness = new ProveedorBusiness(); CodigoPostalBusiness codigoPostalBusiness = new CodigoPostalBusiness(); Proveedor proveedor = new Proveedor(); try { CodigoPostal codigoPostal = new CodigoPostal(); int num = Convert.ToInt32(lblNumId.Text.ToString()); proveedor.cuit = txtCuit.Text.ToString().Trim(); proveedor.numeroProveedor = Convert.ToInt32(txtNumeroProveedor.Text.Trim()); proveedor.apellido = txtApellido.Text.ToString().Trim(); proveedor.nombre = txtNombre.Text.ToString().Trim(); proveedor.direccion = txtDireccion.Text.ToString().Trim(); proveedor.cp = Convert.ToInt32(cmbCodigoPostal.SelectedValue.ToString()); proveedor.telefono = Convert.ToInt64(txtTelefono.Text.ToString()); proveedor.mail = txtMail.Text.ToString().Trim(); proveedor.inicioActividad = Convert.ToDateTime(dtpFnac.Value.ToString()); proveedorBusiness.eliminar(num); proveedorBusiness.agregar(proveedor); MessageBox.Show("Modificado con éxito"); this.Close(); cmbCodigoPostal.DataSource = codigoPostalBusiness.listar(); //proveedorAccion.Show(); // ProveedorBusiness proveedor = new ProveedorBusiness(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } }