private void BtnSave_Click(object sender, EventArgs e) { Capitulos n = new Capitulos(); n.idserie = Convert.ToInt32(CmbSerie.SelectedValue); n.idtemporada = Convert.ToInt32(CmbTemporada.SelectedValue); n.miniatura = TxtMiniatura.Text; n.consecutivo = Convert.ToInt32(TxtNumero.Text); n.titulo = TxtTitulo.Text; n.status = Convert.ToBoolean(CmbStatus.SelectedIndex); bool resp = n.GuardarCapitulo(); if (resp) { MessageBox.Show("Se ha guardado el capitulo con exito", "Guardado con exito", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtMiniatura.Clear(); TxtNumero.Text = Convert.ToString(n.consecutivo + 1); TxtTitulo.Clear(); LoadGrid(); } else { MessageBox.Show("Error al guardar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void BtnEliminar_Click(object sender, EventArgs e) { if (TxtTitulo.Text != string.Empty) { IObjectContainer BD = Db4oFactory.OpenFile(Util.NombreArchivo); string nom = TxtTitulo.Text; try { IList <Libro> consulta = BD.Query <Libro>(z => z.Titulo == nom); foreach (Libro item in consulta) { BD.Delete(item); MessageBox.Show("Registro eliminado"); TxtTitulo.Clear(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); MessageBox.Show("No hay registros que coincidan"); } finally { BD.Close(); } } else { MessageBox.Show("Inserta la clave"); } }
private void BtnAGREGAR_Click(object sender, EventArgs e) { if (TxtTitulo.Text != string.Empty && TxtNumRegistro.Text != string.Empty) { IObjectContainer BD = Db4oFactory.OpenFile(Util.NombreArchivo); Patente P = new Patente(""); // ProduccionAcademica pro = new ProduccionAcademica(); P.Titulo = TxtTitulo.Text; P.NoRegistro = TxtNumRegistro.Text; try { BD.Store(P); BD.Commit(); } finally { BD.Close(); } MessageBox.Show("EXITO!!! Se Guardo"); TxtNumRegistro.Clear(); TxtTitulo.Clear(); } else { MessageBox.Show("Hay campos Vacios"); } }
private void BtnAGREGAR_Click(object sender, EventArgs e) { if (TxtTitulo.Text != string.Empty && TxtTitulo.Text != string.Empty && TxtISBN.Text != string.Empty) { IObjectContainer BD = Db4oFactory.OpenFile(Util.NombreArchivo); Autor a = new Autor(""); Libro L = new Libro(""); L.Titulo = TxtTitulo.Text; a.Nombre = TxtAutor.Text; L.Autor = a; L.ISBN = int.Parse(TxtISBN.Text); try { BD.Store(L); BD.Commit(); } finally { BD.Close(); } MessageBox.Show("EXITO!!! Se Guardo"); TxtTitulo.Clear(); TxtISBN.Clear(); TxtAutor.Clear(); } else { MessageBox.Show("Hay campos Vacios"); } }
/// <summary> /// Limpia el formulario de creación de libros /// </summary> public void cleanBookInfo() { TxtAutor.Clear(); TxtEditorial.Clear(); TxtTitulo.Clear(); ChkNuevo.Checked = false; PicImagen.Image = null; }
private bool ValidarCampos() { // campos obligatorios if (cboPlan.Text == string.Empty) { cboPlan.BackColor = Color.Red; cboPlan.Focus(); return(false); } else { cboPlan.BackColor = Color.White; } if (TxtTitulo.Text == string.Empty) { TxtTitulo.BackColor = Color.Red; TxtTitulo.Focus(); return(false); } else { TxtTitulo.BackColor = Color.White; } if (cboResponsable.Text == string.Empty) { cboResponsable.BackColor = Color.Red; cboResponsable.Focus(); return(false); } else { cboResponsable.BackColor = Color.White; } return(true); }
private void btnGuardar_Click_1(object sender, EventArgs e) { IObjectContainer BD = Db4oFactory.OpenFile(Util.NombreArchivo); Patente pt = new Patente(""); pt.Titulo = TxtTitulo.Text; IList <Patente> resultados = BD.Query <Patente>(x => x.Titulo == TxtTitulo.Text); if (resultados.Count > 0) { Patente v = new Patente(""); v = resultados.First <Patente>(); //Estudiante v = new Estudiante("",""); //v.NoControl = TxtNumcontrol.Text; v.Titulo = TxtTitulo.Text; v.NoRegistro = TxtNumRegistro.Text; BD.Store(v); BD.Commit(); MessageBox.Show("Exito!!! Se Modifico"); TxtNumRegistro.Clear(); TxtTitulo.Clear(); } else { MessageBox.Show("Error!!! No se Modifico"); } TxtNumRegistro.Clear(); TxtTitulo.Clear(); btnGuardar.Visible = false; BD.Close(); }
private void btnGuardar_Click(object sender, EventArgs e) { IObjectContainer BD = Db4oFactory.OpenFile(Util.NombreArchivo); Libro pel = new Libro(""); pel.Titulo = TxtTitulo.Text; IList <Libro> resultados = BD.Query <Libro>(x => x.Titulo == TxtTitulo.Text); if (resultados.Count > 0) { Libro v = new Libro(""); v = resultados.First <Libro>(); //Estudiante v = new Estudiante("",""); // v.NoControl = TxtNumcontrol.Text; v.Autor.Nombre = TxtAutor.Text; v.ISBN = int.Parse(TxtISBN.Text); BD.Store(v); BD.Commit(); MessageBox.Show("Exito!!! Se Modifico"); TxtAutor.Clear(); TxtISBN.Clear(); TxtTitulo.Clear(); } else { MessageBox.Show("Error!!! No se Modifico"); } TxtAutor.Clear(); TxtISBN.Clear(); TxtTitulo.Clear(); btnGuardar.Visible = false; BD.Close(); }
private void label3_Click(object sender, EventArgs e) { TxtTitulo.Paste(); }
private void ClearTxt() { TxtTitulo.Clear(); TxtNota.Clear(); }
/// <summary>Guardar() /// Este metodo se ejecuta cuando se presiona el boton Guardar. /// Permite hacer validaciones antes de ejecutar el metodo Viajar() /// </summary> public void Guardar() { if (String.IsNullOrEmpty(TxtNomPerfil.Text)) { XtraMessageBox.Show("Nombre perfil no puede quedar vacío", GLReferences.Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information); TxtNomPerfil.Focus(); } if (String.IsNullOrEmpty(TxtFrmGet.Text) && !String.IsNullOrEmpty(TxtNomPerfil.Text)) { XtraMessageBox.Show("Formulario Get no puede quedar vacío", GLReferences.Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information); TxtFrmGet.Focus(); } if (String.IsNullOrEmpty(TxtProyecto.Text) && !String.IsNullOrEmpty(TxtFrmGet.Text)) { XtraMessageBox.Show("Proyecto no puede quedar vacío", GLReferences.Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information); TxtProyecto.Focus(); } if (String.IsNullOrEmpty(TxtTitulo.Text) && !String.IsNullOrEmpty(TxtProyecto.Text)) { XtraMessageBox.Show("Título no puede quedar vacío", GLReferences.Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information); TxtTitulo.Focus(); } if (LueOrigenD.Text == "[Vacío]" && !String.IsNullOrEmpty(TxtTitulo.Text) && !String.IsNullOrEmpty(TxtNomPerfil.Text) && !String.IsNullOrEmpty(TxtFrmGet.Text)) { XtraMessageBox.Show("Debe seleccionar el origen de los datos", GLReferences.Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information); LueOrigenD.Focus(); } if (String.IsNullOrEmpty(LueCampoPrincipal.Text) && !String.IsNullOrEmpty(TxtTitulo.Text)) { XtraMessageBox.Show("Debe seleccionar el campo principal", GLReferences.Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information); LueCampoPrincipal.Focus(); } bool viajar = false; int parar = 0; if (dtGrillaCamposVisibles.Rows.Count != 0) { for (int i = 0; i < dtGrillaCamposVisibles.Rows.Count; i++) { String indc = dtGrillaCamposVisibles.Rows[i][3].ToString(); if (parar == 1) { break; } for (int j = 0; j < dtGrillaCamposVisibles.Rows.Count; j++) { if (indc == dtGrillaCamposVisibles.Rows[j][3].ToString() && j != i) { XtraMessageBox.Show("El indice no se puede repetir", GLReferences.Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information); viajar = false; parar = 1; break; } else { viajar = true; } } } } else { viajar = true; } if (viajar && !String.IsNullOrEmpty(TxtTitulo.Text) && !String.IsNullOrEmpty(LueCampoPrincipal.Text) && !String.IsNullOrEmpty(TxtFrmGet.Text) && !String.IsNullOrEmpty(TxtProyecto.Text) && !String.IsNullOrEmpty(TxtNomPerfil.Text) && LueOrigenD.Text != "[Vacío]") { Viajar(); } }