protected void Page_Load(object sender, EventArgs e) { if (Session["User"] != null) { if (!IsPostBack) { Session["Group"] = null; } Class.User user = Session["User"] as Class.User; if (user.Type == 2) { MenuNonAmministratore.Visible = false; NavigationMenuAmministratore.Visible = true; } else { MenuNonAmministratore.Visible = true; NavigationMenuAmministratore.Visible = false; } lnklogout.Visible = true; } else { lnklogout.Visible = false; } // Constant.currentDatabase = "S:\\Rohdaten\\ImageSimilarity\\ImageDatabaseA"; }
protected void UpdateButton_Click(object sender, EventArgs e) { if (Page.IsValid) { Class.User user = new Class.User(); Class.Result res = new Class.Result(); user.Name = txtName.Text; user.Surname = txtSurname.Text; user.Username = txtUserName.Text; user.Email = txtEmail.Text; user.Password = txtPassword.Text; res = DataAccess.DataAccessUser.UpdateProfileView(Convert.ToInt64(iduser.Value), user); DataAccess.DataAccessUser.writeUserList(); if (res.result) { DivSuccess.Visible = true; DivError.Visible = false; } else { DivSuccess.Visible = false; DivError.Visible = true; lblError.Text = res.Message; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (HttpContext.Current.Session["User"] == null) { Response.Redirect("~/Account/Login.aspx"); } else { Class.User user = Session["User"] as Class.User; user = DataAccess.DataAccessUser.getUserById(user.Id_user); txtName.Text = user.Name; txtSurname.Text = user.Surname; txtEmail.Text = user.Email; txtPassword.Text = user.Password; txtUserName.Text = user.Username; iduser.Value = user.Id_user.ToString(); DivSuccess.Visible = false; } } }
protected void Page_Load(object sender, EventArgs e) { Class.User user = Session["User"] as Class.User; // - Martin long idTestCase = 0; if (HttpContext.Current.Session["IdTestCase"] != null) { idTestCase = Convert.ToInt64(HttpContext.Current.Session["IdTestCase"]); } // infos die immer da sind Class.TestCase tc = DataAccess.DataAccessTestCase.getTestCase().Where(p => p.IDTestcase == idTestCase).FirstOrDefault(); /* original: Class.TestCase tc = DataAccess.DataAccessTestCase.getTestCase(Convert.ToInt64(Session["IdTestCase"]));*/ // initialize manage object with all needed content managerView = new manageImg(tc, user); // spawn a thread to create the image packages ThreadStart thread = new ThreadStart(managerView.ThreadRun); task = new Thread(thread); task.Start(); if (task.IsAlive) // creation of everything finished => all necessary information are in Session["managerView"] { Session["managerView"] = managerView; Response.Redirect("~/managementImage/ViewImage_.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) // just first time { Class.User user = Session["User"] as Class.User; if (user == null) { Response.Redirect("~/Account/Login.aspx"); return; } lblNominativo.Text = user.title + " " + user.Name + " " + user.Surname; bindTestCase(user.Type, user.Id_user); } }
protected void lnkLogout_Click(object sender, EventArgs e) { if (Session["User"] != null) { Class.User user = (Class.User)Session["User"]; if (user.Id_user > 0) { Session["Group"] = null; Session["User"] = null; Session["IdTestCase"] = null; Session["EditTestcase"] = null; Session["Seed"] = null; } Response.Redirect("~/Account/Login.aspx"); } }