protected void rblAuthor_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (rblAuthor.SelectedItem.Text == "Nuevo")
     {
         ent_Auth = bsn_author.checkAuthor(textName.Text, textLastName.Text);
         bsn_write.deleteWrite(ent_Auth.Id, code);
         clean();
         textName.Enabled        = true;
         textLastName.Enabled    = true;
         textNationality.Enabled = true;
         insert = 1;
     }
     else
     {
         listAdd();
         ddlAuthor.AutoPostBack = true;
         insert = 0;
     }
 }
        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);
        }
Esempio n. 3
0
        protected void ddlAuthor_SelectedIndexChanged(object sender, EventArgs e)
        {
            ent_auth = bsn_auth.checkAuthor(textName.Text, textLastName.Text);
            bsn_write.deleteWrite(ent_auth.Id, code);
            int valor = Convert.ToInt32(ddlAuthor.SelectedValue);

            foreach (EntClsAuthor auth in lstAuthor)
            {
                if (auth.Id == valor)
                {
                    ent_auth = auth;
                }
            }
            ShowAuthor(ent_auth);
        }
        protected void buttonCheckAuthor_Click(object sender, EventArgs e)
        {
            BsnClsAuthor bsn_author = new BsnClsAuthor();
            EntClsAuthor authorFind = bsn_author.checkAuthor(textNameAuth.Text, textLastName.Text);

            if (authorFind.Name == null)
            {
                textNationality.Enabled = true;
                change1 = 1;
            }
            else
            {
                textNameAuth.Text    = authorFind.Name;
                textLastName.Text    = authorFind.LastName;
                textNationality.Text = authorFind.Nationality;
            }
            buttonCheckAuthor.Enabled = false;
        }