Esempio n. 1
0
        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
        }
Esempio n. 2
0
        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;
                
            }



        }