private void BtnNuevo_Click(object sender, EventArgs e) { TxtEditar.Text = "Nuevo"; Limpiar(); TxtCod_deposito.Focus(); Botones(); }
public void Listar() { try { Ds = EDeposito.Listar(); TxtCod_deposito.Text = Ds.Tables[0].Rows[0]["cod_deposito"].ToString(); TxtCod_depositov.Text = Ds.Tables[0].Rows[0]["cod_deposito"].ToString(); TxtDesc_deposito.Text = Ds.Tables[0].Rows[0]["desc_deposito"].ToString(); TxtResp_deposito.Text = Ds.Tables[0].Rows[0]["resp_deposito"].ToString(); TxtUbicacion.Text = Ds.Tables[0].Rows[0]["ubicacion_deposito"].ToString(); TxtFecha_reg.Text = Ds.Tables[0].Rows[0]["fecha_reg"].ToString(); TxtDireccion_adm.Text = Ds.Tables[0].Rows[0]["direccion_adm"].ToString(); TxtScompras.Text = Ds.Tables[0].Rows[0]["scompras"].ToString(); TxtSventas.Text = Ds.Tables[0].Rows[0]["sventas"].ToString(); TxtActivo.Text = Ds.Tables[0].Rows[0]["activo"].ToString(); TxtCampo1.Text = Ds.Tables[0].Rows[0]["campo1"].ToString(); TxtCampo2.Text = Ds.Tables[0].Rows[0]["campo2"].ToString(); TxtCampo3.Text = Ds.Tables[0].Rows[0]["campo3"].ToString(); TxtCampo4.Text = Ds.Tables[0].Rows[0]["campo4"].ToString(); TxtCampo5.Text = Ds.Tables[0].Rows[0]["campo5"].ToString(); TxtCampo6.Text = Ds.Tables[0].Rows[0]["campo6"].ToString(); TxtEditar.Text = "Listar"; Registros(); } catch (Exception Ex) { TxtEditar.Text = "Nuevo"; Limpiar(); TxtCod_deposito.Focus(); string rpta = Ex.Message; MensajeOk("Tabla Vacia, esta en modo Ingreso"); Show(); } }
private void GenerarCod() { try { int rpta = Convert.ToInt32(EDeposito.GenerarCod(TxtCod_deposito.Text)); TxtCod_deposito.Text = Pref + rpta.ToString(TxtCadena.Text); } catch (Exception Ex) { MensajeError(" Solo se puede Generar Codigos Numericos " + Ex.StackTrace); TxtCod_deposito.Focus(); } }