protected void Page_Load(object sender, EventArgs e) { string name = Request.Form["name"]; string email = Request.Form["email"]; string address = Request.Form["address"]; int cpf = Convert.ToInt32(Request.Form["cpf"]); string username = Request.Form["username"]; string password = Request.Form["password"]; if (Page.IsPostBack) { clDataAccess insert = new clDataAccess(); clUsers validate = new clUsers(); //VERIFICA SE JA EXISTE O USERNAME if (!validate.containsUser(username) && name != "" && address != "" && cpf.ToString() != "" && email != "" && username != "" && password != "") { insert.Registeruser(name, address, cpf, email, username, password); Response.Redirect("Login.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { clProblem teste2 = new clProblem(); teste2.UserProblem(2); string user = Request.Form["usuario"]; string password = Request.Form["senha"]; string recoveryemail = Request.QueryString["email"]; #region // Verifica Email if (recoveryemail != null) { clUsers ReturnEmail = new clUsers(); string passwordrecovered = ReturnEmail.EmailRecovery(recoveryemail); if (passwordrecovered != null) { Response.Write(" FAZER O envio da " + passwordrecovered + " Para o email " + recoveryemail); } else { Response.Write(passwordrecovered); } } #endregion // Loga com os dados do banco #region // Login if (Page.IsPostBack) { clUsers Validation = new clUsers(); bool LoginValidation = Validation.LoginValidation(user, password); if (LoginValidation == true) { //Cria Cookie HttpCookie CookieLogon = new HttpCookie("cokieusuario"); CookieLogon.Value = user; CookieLogon.Expires = DateTime.Now.AddDays(1); Response.Cookies.Add(CookieLogon); //Cria Sessão Session["NomeUsuario"] = user; Response.Redirect("fixcity.aspx"); } else { Response.Write("Falha no login"); } } #endregion }
protected void Page_Load(object sender, EventArgs e) { //Botoes da Pagina btnResolvido.Click += BtnResolvido_Click; btnNaoResolvido.Click += BtnNaoResolvido_Click; //Verifica o usuario loga e sua permissão string Login = Session["NomeUsuario"] == null ? "" : Session["NomeUsuario"].ToString(); clUsers User = new clUsers(); User.UserReturn(Login); int codRole = User.pcodRoles; //clPermissions Verifypermission = new clPermissions(); // bool permission = Verifypermission.VerifyPermission(codRole, (int)Permissions.Full); if (codRole == 2 || codRole == 1) { string Usuario; Usuario = Session["NomeUsuario"] == null ? "" : Session["NomeUsuario"].ToString(); Usuario = (string)Session["NomeUsuario"] + ""; if (Usuario.Length > 0) { //Motras os problemas na tela principal clProblem busca = new clProblem(); busca.ReturnProblem(30); string labeldescricao = busca.pDescription; int labelnome = busca.pcodSubCategory; DateTime labeldata = busca.pDate; string imagemfoto = busca.pPhoto; LDescription.Text = labeldescricao; LName.Text = Convert.ToString(labelnome); LDate.Text = Convert.ToString(labeldata); IPhoto.ImageUrl = imagemfoto; LDescription2.Text = labeldescricao; LName2.Text = Convert.ToString(labelnome); LDate2.Text = Convert.ToString(labeldata); IPhoto2.ImageUrl = imagemfoto; LabelNome.Text = User.pName; LabelNome.Visible = true; <<<<<<< HEAD busca.MarkSolved(21); busca.MarkSolved(22); ======= // busca.MarkSolved(21); >>>>>>> fe2fae13f23d6ccc85627a76be66a646fe8fa74d } else { Response.Redirect("login.aspx"); } } else { Response.Write("VOCÊ NÃO POSSUI PERMISSAO PARA ACESSAR"); Response.Redirect("login.aspx"); } string destroy = Request.Form["logout"]; if (destroy != null) { Session.Abandon(); Response.Redirect("login.aspx"); } }
private void BtnResolvido_Click(object sender, EventArgs e) { string Login = Session["NomeUsuario"] == null ? "" : Session["NomeUsuario"].ToString(); clUsers User = new clUsers(); User.UserReturn(Login); int CodUser = User.pcodUser; clProblem myproblems = new clProblem(); myproblems.UserProblem(CodUser); if (myproblems.pSolved == 0) { LName.Text = Convert.ToString(myproblems.pDescription); LDate.Text = Convert.ToString(myproblems.pDate); IPhoto.ImageUrl = myproblems.pPhoto; } }