private void BtnModificar_Click(object sender, EventArgs e) { if (DgvProveedor.SelectedRows.Count > 0) { int rowindex = DgvProveedor.CurrentRow.Index; if (rowindex != -1) { try { modificar = 1; CamposReadOnly(false); BotonesEnables(false); TxtRuc.Enabled = false; TxtRazonSocial.Focus(); //llenando campos TxtRuc.Text = DgvProveedor.CurrentRow.Cells[1].Value.ToString(); TxtRazonSocial.Text = DgvProveedor.CurrentRow.Cells[2].Value.ToString(); TxtCiudad.Text = DgvProveedor.CurrentRow.Cells[3].Value.ToString(); TxtDireccion.Text = DgvProveedor.CurrentRow.Cells[4].Value.ToString(); TxtEmail.Text = DgvProveedor.CurrentRow.Cells[5].Value.ToString(); TxtTelefono.Text = DgvProveedor.CurrentRow.Cells[6].Value.ToString(); } catch { // } } } else { MessageBox.Show("Seleccione un registro"); } }
private void LimpiarRegistros() { NombreEmpresa = null; TxtNombreEmpresa.Clear(); RazonSocial = null; TxtRazonSocial.Clear(); Direccion = null; TxtDireccion.Clear(); Id_Impuesto = 0; CmbImpuesto.SelectedValue = 0; Id_Moneda = 0; CmbMoneda.SelectedValue = 0; RdbSI.Checked = false; RdbNO.Checked = false; Trabaja_Impuesto = null; ChkCodigoBarras.Checked = false; Modo_Busqueda = null; ChkTeclado.Checked = false; Carpeta_Copia_Seguridad = null; TxtRutaCopiaSeguridad.Clear(); Correo_EnvioReportes = null; TxtCorreoEmpresa.Clear(); Ultima_Fecha_Copia_Seguridad = null; Ultima_Fecha_Copia_Date = DateTime.Now; Frecuencia_Copias = 0; Id_Estatus = 0; Tipo_Empresa = null; Redondeo_Total = null; PctbxLogo.Image = Properties.Resources.LgoEsferaBlancTrasp; Calle = null; TxtCalle.Clear(); Numero_Interno = null; TxtNumInterno.Clear(); Numero_Externo = null; TxtNumExterno.Clear(); Entre_Calles = null; TxtEntreCalles.Clear(); Id_Colonia = 0; //CmbColonias.SelectedValue=0; Codigo_Postal = 0; TxtCodigoPostal.Clear(); Id_Municipio = 0; //CmbxMunicipio.SelectedValue=0; Id_Estado = 0; //Convert.ToInt32(CmbxEstado.SelectedValue); Id_Pais = 0; CmbPais.SelectedValue = 0; Direccion = null; }
private void BtnCancelar_Click_1(object sender, EventArgs e) { BtnContrato.Enabled = false; BtnTrabajador.Enabled = false; TxtDireccion.Clear(); txtEmail.Clear(); TxtNit.Clear(); TxtPaginaWeb.Clear(); TxtRazonSocial.Clear(); TxtRepresentante.Clear(); TxtTelefono.Clear(); TxtTelRepresentante.Clear(); pbxFotografia.Image = null; DgvEmpresa.ClearSelection(); TxtNit.Focus(); }
private void BtnGuardar_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(TxtRuc.Text)) { MessageBox.Show("Digite Ruc", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); TxtRuc.Focus(); } else if (string.IsNullOrEmpty(TxtRazonSocial.Text)) { MessageBox.Show("Digite Razon Social", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); TxtRazonSocial.Focus(); } else if (string.IsNullOrEmpty(TxtCiudad.Text)) { MessageBox.Show("Digite Ciudad", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); TxtCiudad.Focus(); } else if (string.IsNullOrEmpty(TxtDireccion.Text)) { MessageBox.Show("Digite Dirección", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); TxtDireccion.Focus(); } /*else if (string.IsNullOrEmpty(TxtEmail.Text)) * { * MessageBox.Show("Digite Correo Electrónico", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); * TxtEmail.Focus(); * }*/ else if (string.IsNullOrEmpty(TxtTelefono.Text)) { MessageBox.Show("Digite Teléfono", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); TxtTelefono.Focus(); } else { Guardar(); } }