private void actualizarControlesUsu() { dgvVerDirecciones.DataSource = AdressDAO.getListaAdress(appUser.iduser); List <Product> listap = ProductDAO.GetListaProducts(); cmbAgregarProd.DataSource = null; cmbAgregarProd.DisplayMember = "idproduct"; cmbAgregarProd.DataSource = listap; }
private void ReloadControls() { Buisness actual = (Buisness)cmbNegocio.SelectedItem; int idBuis = actual.idbuisness; var productos = ProductDAO.getListProductsFromStore(idBuis); var negocios = BuisnessDAO.getList(); var direcciones = AdressDAO.getListAdressUser(UserId); cmbNegocio.DataSource = null; cmbNegocio.ValueMember = "idbuisness"; cmbNegocio.DisplayMember = "name"; cmbNegocio.DataSource = negocios; cmbProducto.DataSource = null; cmbProducto.ValueMember = "idproduct"; cmbProducto.DisplayMember = "name"; cmbProducto.DataSource = productos; cmbLocation.DataSource = null; cmbLocation.ValueMember = "idproduct"; cmbLocation.DisplayMember = "name"; cmbLocation.DataSource = direcciones; }
private void btnMofificarDirec_Click(object sender, EventArgs e) { try { if (txtNuevaDirec.Text.Length > 10 && txtModificarDireccion.Text.Length > 0) { AdressDAO.modificarDireccion(txtNuevaDirec.Text, Convert.ToInt32(txtModificarDireccion.Text)); MessageBox.Show("¡Direccion modificada exitosamente!.", "SourceCode", MessageBoxButtons.OK, MessageBoxIcon.Information); actualizarControlesUsu(); } else { MessageBox.Show("Favor digite una direccion (longitud minima, 10 caracteres)", "SourceCode", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } catch (Exception) { MessageBox.Show("La direccion, no se encuentra disponible.", "SourceCode", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnEliminarDirec_Click(object sender, EventArgs e) { try { if (txtEliminarDirec.Text.Length > 0) { AdressDAO.eliminarDireccion(Convert.ToInt32(txtEliminarDirec.Text)); MessageBox.Show("¡Direccion eliminada exitosamente!.", "SourceCode", MessageBoxButtons.OK, MessageBoxIcon.Information); actualizarControlesUsu(); } else { MessageBox.Show("Favor digite un id", "SourceCode", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } catch (Exception) { MessageBox.Show("El id no se encuentra disponible.", "SourceCode", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnAgregarDireccion_Click(object sender, EventArgs e) { try { if (txtDireccion.Text.Length > 10) { AdressDAO.insertarDireccion(appUser.iduser, txtDireccion.Text); MessageBox.Show("¡Direccion agregada exitosamente!.", "SourceCode", MessageBoxButtons.OK, MessageBoxIcon.Information); actualizarControlesUsu(); } else { MessageBox.Show("Favor digite una direccion (longitud minima, 10 caracteres)", "SourceCode", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } catch (Exception) { MessageBox.Show("La direccion, no se encuentra disponible.", "SourceCode", MessageBoxButtons.OK, MessageBoxIcon.Error); } }