/// <summary>
 /// Gets all the information this page needs.
 /// </summary>
 public override void CheckTypeAndFill()
 {
     if (!LoginCheck.LoggedIn || user == null)
         Response.Redirect("login.aspx");
     else if (user.UserCv.CvID == 0 && user.UserCompany.CompanyID != 0)
     {
         service = new MatchyService();
         UserMapping mapping = new UserMapping();
         CvMapping cvMapping = new CvMapping();
         user = mapping.mapFromService(service.GetUser(Int32.Parse(profileId))[0]);
         user.UserCv = cvMapping.mapFromService(service.GetCv(getURL())[0]);
         Session["UserObject"] = user;
     }
     else
     {
         var contentPlaceHolder = (ContentPlaceHolder)Master.FindControl("contentPlaceholderHeader");
         var profileLink = (LinkButton)contentPlaceHolder.FindControl("profileLink");
         profileLink.CssClass = "active";
     }
 }
Beispiel #2
0
 /// <summary>
 /// The standard changeURL for profilescreen
 /// </summary>
 public virtual void changeURL()
 {
     int parseable;
     if (url.Contains("="))
     {
         if(url.Contains("profile="))
             profileId = Request.QueryString["profile"];
         else
             profileId = Request.QueryString["company"];
     }
     service = new MatchyService();
     UserMapping mapping = new UserMapping();
     if (Int32.TryParse(profileId, out parseable))
     {
         try
         {
             user = mapping.mapFromService(service.GetUser(Int32.Parse(profileId))[0]);
             Session["UserObject"] = user;
         }
         catch
         {
             if (user.UserCv.CvID != 0)
                 Response.Redirect("profile.aspx?profile=" + string.Format(user.ProfileId.ToString()));
             else
                 Response.Redirect("company.aspx?company=" + string.Format(user.ProfileId.ToString()));
         }
     }
     else
     {
         if (user.UserCv.CvID != 0)
             Response.Redirect("profile.aspx?profile=" + string.Format(user.ProfileId.ToString()));
         else
             Response.Redirect("company.aspx?company=" + string.Format(user.ProfileId.ToString()));
     }
 }