예제 #1
0
        protected void btnUpdateCont_Click(object sender, EventArgs e)
        {
            if (insert == 1)
            {
                if (valNameEditorial())
                {
                    errorEditorial();
                }
                else
                {
                    Session["book"] = code;
                    bsn_edit.insertEditorial(textName.Text, textCountry.Text, textCity.Text);
                    ent_edit = bsn_edit.checkEditorial(textName.Text);
                    Session.Add("edit", ent_edit.Id);
                    Response.Redirect("BookRegister.aspx");
                }
            }

            if (insert == 0)
            {
                Session["book"] = code;
                Session.Add("edit", ent_edit.Id);
                Response.Redirect("BookRegister.aspx");
            }
            else
            {
                Session["book"] = code;
                ent_edit        = bsn_edit.checkEditorial(textName.Text);
                Session.Add("edit", ent_edit.Id);
                Response.Redirect("BookRegister.aspx");
            }
        }
예제 #2
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     ent_edit   = bsn_edit.checkEditorial(textName.Text);
     lstEditVal = bsn_edit.valEdit(ent_edit.Id);
     if (lstEditVal.Count() > 0)
     {
         errorDeleteEdit();
     }
     else
     {
         bsn_edit.deleteEditorial(ent_edit.Id);
         SucceDeleteEdit();
         listAdd();
     }
 }
        protected EntClsAuthor registerBook()
        {
            int             itemSelec  = (ddlCategory.SelectedIndex) + 1;
            BsnClsBook      bsn_book   = new BsnClsBook();
            BsnClsEditorial bsn_edit   = new BsnClsEditorial();
            EntClsEditorial obj_edit   = bsn_edit.checkEditorial(textNameEdit.Text);
            int             idedit     = obj_edit.Id;
            int             stock      = Convert.ToInt16(textStock.Text);
            EntClsAuthor    obj_author = new EntClsAuthor();
            BsnClsAuthor    bsn_author = new BsnClsAuthor();

            obj_author = bsn_author.checkAuthor(textNameAuth.Text, textLastName.Text);
            bsn_book.insertBook(textTitle.Text, textCode.Text, textIsbn.Text, textDate.Text, Convert.ToInt16(textStock.Text), itemSelec, idedit, "Disponible", 1);
            return(obj_author);
        }
        protected void buttonCheckEditorial_Click(object sender, EventArgs e)
        {
            BsnClsEditorial bsn_editorial = new BsnClsEditorial();
            EntClsEditorial editFind      = bsn_editorial.checkEditorial(textNameEdit.Text);

            if (editFind.Name == null)
            {
                textCity.Enabled    = true;
                textCountry.Enabled = true;
                change2             = 1;
            }
            else
            {
                textNameEdit.Text = editFind.Name;
                textCountry.Text  = editFind.Country;
                textCity.Text     = editFind.City;
            }
            buttonCheckEditorial.Enabled = false;
        }