Пример #1
0
        protected void ShowBook(EntClsBook book)
        {
            textTitle.Text       = book.Name;
            textIsbn.Text        = book.Isbn;
            textDatePublish.Text = book.DatePublish;
            textStock.Text       = Convert.ToString(book.Stock);
            textState.Text       = book.StateB;
            EntClsCategory ent_categ = bsn_cate.listCategoryForid(book.IdCateg);

            textCategory.Text = ent_categ.Name;
            EntClsEditorial ent_edit = bsn_edit.checkEditorialForId(book.IdEdit);

            textEdit.Text = ent_edit.Name;
            EntClsWrite  ent_write  = bsn_write.listWriteForCode(book.Code);
            EntClsAuthor ent_author = bsn_auth.checkAuthorForId(ent_write.IdAuthor);

            textAuthor.Text = ent_author.Name + ' ' + ent_author.LastName;
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["admin"] == null)
            {
                Response.Redirect("Login.aspx");
            }

            if (Session["edit"] == null || Session["author"] == null)
            {
                Response.Redirect("Autor.aspx");
            }
            if (Session["book"] != null)
            {
                btnUpdate.Visible   = true;
                btnRegister.Visible = false;
                btnUpdate.Enabled   = true;
                ent_book            = bsn_book.SearchBook(Session["book"].ToString());
                textTitle.Text      = ent_book.Name;
                textCode.Text       = ent_book.Code;
                textCode.Enabled    = false;
                textDate.Text       = ent_book.DatePublish;
                textIsbn.Text       = ent_book.Isbn;
                textStock.Text      = Convert.ToString(ent_book.Stock);
                ent_category        = bsn_category.listCategoryForid(ent_book.IdCateg);
                Session["book"]     = null;
            }
            else
            {
                if (Session["regis"] != null)
                {
                    btnRegister.Enabled = true;
                    btnUpdate.Visible   = false;
                }
            }
            idEditorial = Convert.ToInt32(Session["edit"].ToString());
            idAuthor    = Convert.ToInt32(Session["author".ToString()]);
            if (!IsPostBack)
            {
                loadDropDownList();
                ddlCategory.AutoPostBack = true;
                ddlState.AutoPostBack    = true;
            }
        }