protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                // Get the index of the book to update
                index = Convert.ToInt32(Request.QueryString["bookId"]);

                // Get the record and save it in viewstate
                bookToUpdate = BBooks.getById(index);
                ViewState["bookToUpdate"] = bookToUpdate;

                // Load Section dropDownList
                ddlSection.DataSource     = BSection.getAll();
                ddlSection.DataTextField  = "Name";
                ddlSection.DataValueField = "SectionId";
                ddlSection.DataBind();

                // Fill the textBoxes
                boxTitle.Text            = bookToUpdate.Title;
                boxAuthor.Text           = bookToUpdate.Author;
                ddlSection.SelectedValue = bookToUpdate.SectionId.ToString();

                boxIbsn.Enabled = false;
                boxIbsn.Text    = bookToUpdate.Ibsn.ToString();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                // Load dropDownList
                ddlSection.DataSource     = BSection.getAll();
                ddlSection.DataTextField  = "Name";
                ddlSection.DataValueField = "SectionId";
                ddlSection.DataBind();

                // Set today date
                boxPurchase.Text = DateTime.Today.ToString("dd/MM/yyyy");
            }
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            GridMainList.DataSource = null;

            if (!IsPostBack)
            {
                // Fill filter
                DropDownSection.DataSource     = BSection.getAll();
                DropDownSection.DataTextField  = "Name";
                DropDownSection.DataValueField = "SectionId";
                DropDownSection.DataBind();


                // Fill the grid
                fillBookDTO();
            }
        }