Example #1
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            WS_Agregar_Bec.AgregarClient add = new WS_Agregar_Bec.AgregarClient();
            int estante = add.InsertarEstante(txtPiso.Text, txtEstante.Text);

            if (estante != 0)
            {
                int stock = add.InsertarStock(int.Parse(txtStock.Text), 0, int.Parse(txtStock.Text), estante);

                if (stock != 0)
                {
                    int multi = add.InsertarMultimedia(txtCodigo.Text, ddlTipoMultimedia.Text, txtTitulo.Text, txtAutor.Text, txtAño.Text, stock);

                    if (multi != 0)
                    {
                        Session["regM"] = "si";
                        Response.Redirect("catalog.aspx");
                    }
                    else
                    {
                        IncorrectoMultimedia();
                    }
                }
                else
                {
                    IncorrectStock();
                }
            }
            else
            {
                IncorrectUbicacion();
            }
        }
Example #2
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            WS_Agregar_Bec.AgregarClient add = new WS_Agregar_Bec.AgregarClient();
            int estante = add.InsertarEstante(txtPiso.Text, txtEstante.Text);

            if (estante != 0)
            {
                int stock = add.InsertarStock(int.Parse(txtStock.Text), 0, int.Parse(txtStock.Text), estante);

                if (stock != 0)
                {
                    int libro = add.InsertarLibro(txtIsbn.Text, txtCodigo.Text, txtTitulo.Text, txtAutor.Text, ddlGenero.Text, txtAño.Text, 1, stock);

                    if (libro != 0)
                    {
                        Session["reg"] = "si";
                        Response.Redirect("catalog.aspx");
                    }
                    else
                    {
                        IncorrectLibro();
                    }
                }
                else
                {
                    IncorrectStock();
                }
            }
            else
            {
                IncorrectUbicacion();
            }
        }