protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["admin"] == null)
            {
                Response.Redirect("Login.aspx");
            }

            if (Session["book"] != null)
            {
                ent_write             = bsn_write.SearchAuthorOfBook(Session["book"].ToString());
                ent_Auth              = bsn_author.checkAuthorForId(ent_write.IdAuthor);
                textName.Text         = ent_Auth.Name;
                textLastName.Text     = ent_Auth.LastName;
                textNationality.Text  = ent_Auth.Nationality;
                btnUpdateCont.Visible = true;
                insert          = 3;
                code            = Session["book"].ToString();
                Session["book"] = null;
            }
            else
            {
                if (Session["regis"] != null)
                {
                    btnNextEditorial.Visible = true;
                }
            }
            if (!IsPostBack)
            {
                rblAuthor.AutoPostBack = true;
            }
        }
Esempio n. 2
0
        public EntClsWrite SearchAuthorOfBook(string code)
        {
            EntClsWrite obj_book       = new EntClsWrite();
            string      storeProcedure = "SearchAuthorOfBook";

            using (DbConnection con = dpf.CreateConnection())
            {
                con.ConnectionString = constr;
                using (DbCommand cmd = dpf.CreateCommand())
                {
                    cmd.Connection  = con;
                    cmd.CommandText = storeProcedure;
                    cmd.CommandType = CommandType.StoredProcedure;
                    DbParameter param = cmd.CreateParameter();
                    param.DbType        = DbType.String;
                    param.ParameterName = "code";
                    param.Value         = code;
                    cmd.Parameters.Add(param);

                    con.Open();

                    using (DbDataReader dr = cmd.ExecuteReader())
                    {
                        if (dr.Read())
                        {
                            obj_book = new EntClsWrite((int)dr["id"]);
                        }
                    }
                }
            }
            return(obj_book);
        }
Esempio n. 3
0
        protected void showBook(EntClsBook ent_book)
        {
            txtTitle.Text = ent_book.Name;
            txtStock.Text = Convert.ToString(ent_book.Stock);
            txtCode.Text  = ent_book.Code;
            EntClsWrite  ent_write  = bsn_write.listWriteForCode(ent_book.Code);
            EntClsAuthor ent_author = bsn_auth.checkAuthorForId(ent_write.IdAuthor);

            txtAuthor.Text = ent_author.Name + ' ' + ent_author.LastName;
            txtStateB.Text = ent_book.StateB;
        }
        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;
        }