Ejemplo n.º 1
0
        protected void ButModifPlato_Click(object sender, EventArgs e)
        {
            try {
                byte[] newB = lp.ConvertirImagenBinario(fileUpModimgPlato);

                if ((int)Session["lugar"] == 0)
                {
                    String m      = lp.ModificarPlato(Int32.Parse(txtBuscPLato.Text), txtModNombPlato.Text, txtModDescPlato.Text, txtModPrePlato.Text, newB, lp.EstadoHabilitado(dropModHabPlato.SelectedValue));
                    String script = string.Format("alert('" + m + "')");
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
                }
                else
                {
                    String m      = lp.ModificarPlato((int)Session["idPlato"], txtModNombPlato.Text, txtModDescPlato.Text, txtModPrePlato.Text, newB, lp.EstadoHabilitado(dropModHabPlato.SelectedValue));
                    String script = string.Format("alert('" + m + "')");
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
                }
            }
            catch {
                String script = string.Format("alert('No se Modifico revise parametros')");
                ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
            }
        }
Ejemplo n.º 2
0
        protected void ButGuardarPlato_Click(object sender, EventArgs e)
        {
            try {
                byte[] newB = lp.ConvertirImagenBinario(InsertarImagenPlato);

                String scriptText = lp.AgregarPlato(txtNombrePlato.Text, txtDescPlato.Text, txtPrecioPlato.Text, newB, lp.EstadoHabilitado(DropDownList1.SelectedValue));

                txtNombrePlato.Text = "";
                txtDescPlato.Text   = "";
                txtPrecioPlato.Text = "";

                String script = string.Format("alert('" + scriptText + "')");
                ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
            }
            catch {
                String script = string.Format("alert('No se inserto revise parametros')");
                ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
            }
        }