private void button5_Click(object sender, EventArgs e) { //Valida la carga SQL: bool check = true; if (!this.validar.validarTexBoxVacio(textBox1, e, errorProvider1)) { //Valida nombre check = false; } if (!this.validar.validarTexBoxVacio(textBox6, e, errorProvider1)) { //Valida costo check = false; } if (!this.validar.validarTexBoxVacio(textBox2, e, errorProvider1)) { //Valida timepo check = false; } if (!this.validar.validarTexBoxVacio(textBox3, e, errorProvider1)) { //Valida Porcion check = false; } if (pictureBox1.Image == null) { //Valida si tiene una imagen cargada: check = false; } if (!this.validar.validarComboBoxVacio(comboBox1, e, errorProvider1)) { //Valida Tipo1 check = false; } if (!this.validar.validarComboBoxVacio(comboBox2, e, errorProvider1)) { //Valida tipo2 check = false; } if (dataGridView2.RowCount == 1) { //Valida si tiene al menos un registro check = false; } if (check) { this.guardarReceta(); MessageBox.Show("Receta guardada!"); RECETA recetaRefresh = new RECETA(); this.ventPadre = recetaRefresh; ventPadre.Show(); this.Dispose(); } else { MessageBox.Show("Carga de campos invalida!"); } }
public LISTA_DE_COMPRAS(RECETA ventPadre, DataTable dtReceta) { InitializeComponent(); this.ventPadre = ventPadre; this.dtBackUp = dtReceta.Copy(); this.dataGridView1.DataSource = dtBackUp; }
public EDITAR_RECETAS(RECETA ventPadre, int index, DataTable receta, DataTable ingredientes) { InitializeComponent(); this.ventPadre = ventPadre; this.idReceta = index; cargarSeleccion(index, receta, ingredientes); }
public CARGAR_COMIDAS(string perfil, string Receta, RECETA ventPadre) { InitializeComponent(); this.ventPadre = ventPadre; this.login = perfil; this.Receta = Receta; DateTime dya = DateTime.Today; fechaActual = dya.ToShortDateString(); this.cargarComida(); }
private void btn_Recetas_Click(object sender, EventArgs e) { if (pictureBox1.Image == null) { //sin perfil RECETA receta_form = new RECETA(this); this.Hide(); receta_form.Show(); } else { //Con perfil RECETA receta_form = new RECETA(this, login); this.Hide(); receta_form.Show(); } }
private void button6_Click(object sender, EventArgs e) { //Borrar receta de la base de datos: string confirmacion = MessageBox.Show("Eliminar Receta de la Base de datos?", "CUIDADO!", MessageBoxButtons.OKCancel).ToString(); if (string.Compare(confirmacion, "Ok") == 1) { String sql = "Update Recetas set "; sql += " Estado_Rec=0"; sql += " WHERE IdReceta_Rec=" + idReceta + ""; SQL.agregarDatosSQL(sql); MessageBox.Show("Receta Eliminada!"); RECETA recetaRefresh = new RECETA(); this.ventPadre = recetaRefresh; ventPadre.Show(); this.Dispose(); } }
public BUSQUEDA_RECETAS(RECETA ventPadre) { InitializeComponent(); this.ventPadre = ventPadre; }