protected void Button2_Click(object sender, EventArgs e)
        {
            DALUsuario oDALUsuario = new DALUsuario();

            if (oDALUsuario.Insert(new Usuario(Pass.Text, 2, TextBox1.Text, "0", TXTEmail.Text, TXTPhones.Text)))
            {
                ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "mensagem", "AlertInsertSuccessful()", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "mensagem", "AlertInsertFailed()", true);
            }
        }
Example #2
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            DALUsuario oDALUsuario = new DALUsuario();
            string     phones      = "";

            foreach (ListItem li in selectedPhones.Items)
            {
                phones += li.Text + ";";
            }
            if (oDALUsuario.Insert(new Usuario(Pass.Text, 2, TextBox1.Text, "aaa", TextBox2.Text, phones)))
            {
                ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "mensagem", "AlertInsertSuccessful()", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "mensagem", "AlertInsertFailed()", true);
            }
        }
Example #3
0
        public ActionResult Signin(string nome, string email, string senha)
        {
            string     error   = null;
            DALUsuario DALUser = new DALUsuario();
            Usuario    user    = new Usuario(nome, email, senha);

            //cadastro deu certo
            if (DALUser.Insert(user, ref error))
            {
                Session["UsuarioLogado"] = user; //sessão para manter o login do usuário
                return(RedirectToAction("Index", "Home"));
            }
            //cadastro não deu certo
            else
            {
                ViewBag.ErrorSignin = error;
                return(View());
            }
        }
Example #4
0
        public bool InserirUsuario(int usuarioId)
        {
            DALUsuario DALobjeto = new DALUsuario();

            return(DALobjeto.Insert(usuarioId));
        }