Exemple #1
0
        public List <EntClsSearch> queryForIsbnName()
        {
            List <EntClsSearch> resultList = new List <EntClsSearch>();
            BsnClsSearch        bsn_search = new BsnClsSearch();

            resultList = bsn_search.ForIsbnBook(searchvalue);
            if (resultList.Count() == 0)
            {
                return(null);
            }
            return(resultList);
        }
Exemple #2
0
        public EntClsSearch queryForIsbnName()
        {
            EntClsSearch resultQuery = new EntClsSearch();
            BsnClsSearch bsn_search  = new BsnClsSearch();

            resultQuery = bsn_search.ForIsbnBook(searchvalue);
            if (resultQuery.Book == null)
            {
                return(null);
            }
            return(resultQuery);
        }
Exemple #3
0
        public List <EntClsSearch> queryForNameEditorial()
        {
            char signo = '%';
            List <EntClsSearch> resultList = new List <EntClsSearch>();
            BsnClsSearch        bsn_search = new BsnClsSearch();
            string searchN = signo + searchvalue + signo;

            resultList = bsn_search.ForNameEditorial(searchN);
            if (resultList.Count() == 0)
            {
                return(null);
            }
            return(resultList);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["admin"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            searchvalue = Session["search"].ToString();
            Response.Write(searchvalue);
            List <EntClsSearch> searchCategory = new List <EntClsSearch>();
            BsnClsSearch        bls_search     = new BsnClsSearch();

            searchCategory = bls_search.ForCategoryBook(searchvalue);
            loadGrid(searchCategory);
        }
Exemple #5
0
        public List <EntClsSearch> queryForAuthorCompleteName()
        {
            List <EntClsSearch> resultList = new List <EntClsSearch>();
            string       name;
            string       lastName;
            BsnClsSearch bsn_search = new BsnClsSearch();

            name       = bsn_search.returnName(searchvalue);
            lastName   = bsn_search.returnLastName(searchvalue);
            resultList = bsn_search.ForAuthorCompleteName(name, lastName);
            if (resultList.Count() == 0)
            {
                return(null);
            }
            return(resultList);
        }
        protected void buttonRegister_Click(object sender, EventArgs e)
        {
            BsnClsBook bsn_Libro = new BsnClsBook();
            EntClsBook bookFind  = bsn_Libro.checkBook(textTitle.Text);

            if (bookFind.Code == null)
            {
                if (change1 == 1)
                {
                    BsnClsAuthor bsn_author = new BsnClsAuthor();
                    bsn_author.insertAuthor(textNameAuth.Text, textLastName.Text, textNationality.Text);
                }
                if (change2 == 1)
                {
                    BsnClsEditorial bsn_editorial = new BsnClsEditorial();
                    bsn_editorial.insertEditorial(textNameEdit.Text, textCountry.Text, textCity.Text);
                }
                EntClsSearch consulExist = new EntClsSearch();
                BsnClsSearch bsn_search  = new BsnClsSearch();
                consulExist = bsn_search.ForCodeBook(textCode.Text);
                if (consulExist.Book == null)
                {
                    //verificar que no se repita el isbn
                    consulExist = bsn_search.ForIsbnBook(textIsbn.Text);
                    if (consulExist.Book == null)
                    {
                        //verificar que no se repita el titulo
                        consulExist = bsn_search.ForNameBook(textTitle.Text);
                        if (consulExist.Book == null)
                        {
                            EntClsAuthor obj_Author = registerBook();
                            BsnClsWrite  bsn_write  = new BsnClsWrite();
                            bsn_write.insertWrite(obj_Author.Id, textCode.Text);
                            registerSucces();
                            clear();
                        }
                        else
                        {
                            string script = @"<script type='text/javascript'>
                            alert('Ya existe este libro ingrese otro');
                            </script>";
                            ScriptManager.RegisterStartupScript(this, typeof(Page), "BookAdmin", script, false);
                        }
                    }
                    else
                    {
                        string script = @"<script type='text/javascript'>
                    alert('Ya existe ese ISBN ingrese otro');
                    </script>";
                        ScriptManager.RegisterStartupScript(this, typeof(Page), "BookAdmin", script, false);
                    }
                }
                else
                {
                    string script = @"<script type='text/javascript'>
                    alert('Ya existe ese codigo ingrese otro');
                    </script>";
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "BookAdmin", script, false);
                }
            }
            else
            {
                registerFail();
            }
        }