/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ProfileControl1.FillForm(Global.LoggedInUser); } StatusLabel.Visible = false; }
/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { UserService service = new UserService(); ProfileControl1.AdminView = true; ProfileControl1.FillForm(service.GetByID(UserID)); } }
/// <summary> /// Handles the Click event of the Submit control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void Submit_Click(object sender, EventArgs e) { if (!IsValid) { return; } //store new user information to database UserService service = new UserService(); User user = service.GetByID(UserID); ProfileControl1.FillUser(user); service.Update(user); }
/// <summary> /// Handles the Click event of the SubmitButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void SubmitButton_Click(object sender, EventArgs e) { StatusLabel.Visible = false; if (!Page.IsValid) { return; } ProfileControl1.FillUser(Global.LoggedInUser); UserService service = new UserService(); service.Update(Global.LoggedInUser); StatusLabel.Text = "Your profile has been updated."; StatusLabel.Visible = true; }
protected void SubmitButton_Click(object sender, EventArgs e) { if (!IsValid) { return; } UserRole role = (UserRole)Enum.Parse(typeof(UserRole), ProfileControl1.Security); User user = new User(role, ProfileControl1.Username, ProfileControl1.NewPassword1); ProfileControl1.FillUser(user); UserService userService = new UserService(); userService.Insert(user); RegisterPanel.Visible = false; StatusLabel.Text = "Thank you for registering. Your account will be reviewed soon."; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ProfileControl1.Editable = false; // get the developer UserService service = new UserService(); User dev = service.GetByID(DevID); // fill the form ProfileControl1.FillForm(dev); // bind complevels ddlComp.DataSource = Enum.GetNames(typeof(CompLevel)); ddlComp.DataBind(); ddlComp.Items.Insert(0, String.Empty); // select dev's comp level //ListItem item = ddlComp.Items.FindByValue(dev.Competency.ToString()); //if (item != null) // item.Selected = true; } }