protected void Page_Load(object sender, EventArgs e) { if (!this.User.Identity.IsAuthenticated) { Response.Redirect(this.ResolveUrl(string.Format("~/Account/Login?ReturnUrl={0}", HttpUtility.UrlEncode("/Account/Profile")))); } if (this.User.IsInRole("User")) { var eventArgs = new FindUserEventArgs(this.User.Identity.GetUserId()); this.FindRegularUser(this, eventArgs); var skills = this.LoginView.FindControl("Skills") as Repeater; skills.DataSource = this.Model.FoundRegularUser.Skills; skills.DataBind(); var projects = this.LoginView.FindControl("Projects") as Repeater; projects.DataSource = this.Model.FoundRegularUser.Projects; projects.DataBind(); } else if (this.User.IsInRole("Firm")) { var eventArgs = new FindUserEventArgs(this.User.Identity.GetUserId()); this.FindFirmUser(this, eventArgs); } }
private void FindRegularUser(object sender, FindUserEventArgs e) { if (String.IsNullOrEmpty(e.Id)) { return; } else { var regularUser = this.userService.GetRegularUserById(e.Id); View.Model.FoundRegularUser = regularUser; } }
private void FindFirmUser(object sender, FindUserEventArgs e) { if (String.IsNullOrEmpty(e.Id)) { return; } else { var firmUser = this.firmService.GetFirmUserById(e.Id); View.Model.FoundFirmUser = firmUser; } }
private void OnGetLoggedInUser(object sender, FindUserEventArgs e) { this.View.Model.LoggedInUser = this.userService.GetRegularUserById(e.Id); }
private void OnGetFirm(object sender, FindUserEventArgs e) { this.View.Model.Firm = this.firmService.GetFirmUserById(e.Id); }