protected void VPUpdateProfile_Click(object sender, EventArgs e) { ViewProfilePanel.Visible = false; EditPanel.Visible = true; userId = int.Parse(Session["userid"].ToString()); userExistingSkills = new BindingList <string>(service.GetUserSkills(userId)); VPSkillsLB.DataSource = userExistingSkills; VPSkillsLB.DataBind(); Label14.Text = ""; Label13.Text = ""; }
protected void Page_Load(object sender, EventArgs e) { Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1)); Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetNoStore(); Guid sessionId = (Guid)Session["sessionId"]; // user = new DbUser(); user = service.DisplayProfile(sessionId); //trap the selected item if (LBAddedSkills.SelectedIndex > -1) { removeSelectedItem = LBAddedSkills.SelectedItem.ToString(); } if (LBExisitingSkills.SelectedIndex > -1) { addedSelectedItem = LBExisitingSkills.SelectedItem.ToString(); } //refill the bidinglist //add the trapped item to the bindinglist #region Postback if (!Page.IsPostBack) { //newlyAddedSkills; //EditPanel.Visible = false; ViewProfilePanel.Visible = true; EditPanel.Visible = false; //Fill the View and Edit Profile labels and TextBox fields TxtBoxFname.Text = user.FirstName; VPFirstNameLbl.Text = user.FirstName; TxtBoxLName.Text = user.LastName; VPLastNameLbl.Text = user.LastName; TxtBoxEmail.Text = user.Email; VPEmailLbl.Text = user.Email; TxtBoxDegree.Text = user.Degree; VPPDegreeLbl.Text = user.Degree; TxtBoxLocation.Text = user.Location; VPLocLbl.Text = user.Location; TxtBoxModules.Text = user.Modules; VPModulesLbl.Text = user.Modules; //Fill the ComboBox for Status and Stream FillDropDownLists(); CmbBoxStatus.SelectedValue = user.TStatus; VPStatusLbl.Text = user.TStatus; CmbBoxStream.SelectedValue = user.Stream; VpStreamLbl.Text = user.Stream; //Add theImage for the Consultant Add_Image(); //Fill the user existing skills fields userId = int.Parse(Session["userid"].ToString()); userExistingSkills = new BindingList <string>(service.GetUserSkills(userId)); LBAddedSkills.DataSource = userExistingSkills; LBAddedSkills.DataBind(); //Fill the List of available skills from the database dbExistingSkills = new BindingList <string>(service.DisplaySkills()); //Get rid of the skills already added for the user for (int i = 0; i < dbExistingSkills.Count; i++) { foreach (string j in userExistingSkills) { if (j == dbExistingSkills[i]) { dbExistingSkills.RemoveAt(i); } } } LBExisitingSkills.DataSource = dbExistingSkills; LBExisitingSkills.DataBind(); } #endregion userId = int.Parse(Session["userid"].ToString()); userExistingSkills = new BindingList <string>(service.GetUserSkills(userId)); VPSkillsLB.DataSource = userExistingSkills; VPSkillsLB.DataBind(); Label14.Text = ""; Label13.Text = ""; }