Esempio n. 1
0
        // End declaration

        protected void Page_Load(object sender, EventArgs e)
        {
            // It does this only the first time the page is loaded
            if (!IsPostBack)
            {
                // Get user index and usert object for that index
                userIndex = Convert.ToInt32(Request.QueryString["userId"]);
                users     = BUsers.getById(userIndex);

                // Save the user object in viewState
                ViewState["users"] = users;


                // Load the dropDownList
                DdlRegion.DataSource     = BRegions.getAll();
                DdlRegion.DataTextField  = "Name";
                DdlRegion.DataValueField = "RegionId";
                DdlRegion.DataBind();

                // DNI cannot be modified
                boxDNI.Enabled = false;
                boxDNI.Text    = users.Dni.ToString();

                // Set the value of the record
                DdlRegion.SelectedValue = users.RegionId.ToString();
                boxName.Text            = users.Name;
                boxLastName.Text        = users.LastName;

                boxSignUp.Text   = users.SignUpDate.ToString("dd/MM/yyyy");
                boxRenewal.Text  = users.RenewalDate.ToString("dd/MM/yyyy");
                boxUserName.Text = users.UserName;
                boxPass.Text     = users.Pass;
            }
        }
Esempio n. 2
0
        // End declaration

        protected void Page_Load(object sender, EventArgs e)
        {
            // It does this only the first time the page is loaded
            if (!IsPostBack)
            {
                // Get the record to update through the index in the url
                userIndex = Convert.ToInt32(Request.QueryString["userId"]);
                users     = BUsers.getById(userIndex);

                // Sets people id in viewState
                ViewState["users"] = users;

                // Load the dropDownList
                DdlRegion.DataSource     = BRegions.getAll();
                DdlRegion.DataTextField  = "Name";
                DdlRegion.DataValueField = "RegionId";
                DdlRegion.DataBind();

                // Set the value of the record
                DdlRegion.SelectedValue = users.RegionId.ToString();
                boxName.Text            = users.Name;
                boxLastName.Text        = users.LastName;
                boxDNI.Text             = users.Dni.ToString();
                boxSignUp.Text          = users.SignUpDate.ToShortDateString();
                boxRenewal.Text         = users.RenewalDate.ToShortDateString();
                boxUserName.Text        = users.UserName;
                boxPass.Text            = users.Pass;

                // Disable fields
                disableFields();
            }
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                // Fill the grid
                fillUsersGrid();

                // Fill drop down list
                DropDownRegion.DataSource     = BRegions.getAll();
                DropDownRegion.DataTextField  = "Name";
                DropDownRegion.DataValueField = "RegionId";
                DropDownRegion.DataBind();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // It does this only the first time the page is loaded
            if (!IsPostBack)
            {
                // Load the dropDownList
                DdlRegion.DataSource     = BRegions.getAll();
                DdlRegion.DataTextField  = "Name";
                DdlRegion.DataValueField = "RegionId";
                DdlRegion.DataBind();

                // Shows sign up date and renewal date (just 6 months more)
                boxSignUp.Text     = DateTime.Today.ToString("dd/MM/yyyy");
                boxRenewal.Enabled = false;
                boxRenewal.Text    = DateTime.Today.AddMonths(6).ToString("dd/MM/yyyy");
            }
        }