示例#1
0
        private void Button1_Click(object sender, EventArgs e)
        {
            F_inicio f_Inicio = new F_inicio();

            f_Inicio.Show();
            Visible = false;
        }
示例#2
0
 private void Password_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         F_inicio f_Inicio = new F_inicio();
         f_Inicio.Show();
         Visible = false;
     }
 }
示例#3
0
        private void Button1_Click(object sender, EventArgs e)
        {
            if ((email.Text == "") && (password.Text == ""))
            {
                MessageBox.Show("Informe os dados necessarios", "Alerta!", MessageBoxButtons.OK);
            }
            else
            {
                Usuario usuario = new Usuario();
                usuario.email    = email.Text;
                usuario.password = password.Text;

                try
                {
                    string         URL     = "http://10.42.0.1:8080/EasyListRest/usuario?email=" + usuario.email + "&password="******"GET";
                    request.Accept = "application/json";
                    WebResponse    webResponse   = request.GetResponse();
                    HttpStatusCode response_code = ((HttpWebResponse)webResponse).StatusCode;

                    Stream       webStream      = webResponse.GetResponseStream();
                    StreamReader responseReader = new StreamReader(webStream);
                    string       response       = responseReader.ReadToEnd();

                    if (response_code == HttpStatusCode.OK)
                    {
                        if (!String.IsNullOrEmpty(response))
                        {
                            //MessageBox.Show("Os valores são" + response, "Alerta do sistema", MessageBoxButtons.OK);
                            LocalStorage localStorage = new LocalStorage();
                            Login        login        = JsonNet.Deserialize <Login>(response);
                            //   MessageBox.Show("Os valores são" + login.id, "Alerta do sistema", MessageBoxButtons.OK);
                            Visible = false;
                            F_inicio f_Inicio = new F_inicio();
                            f_Inicio.Show();
                        }
                        else
                        {
                            MessageBox.Show("Valores em branco.", "Alerta do sistema", MessageBoxButtons.OK);
                        }
                    }
                    else
                    {
                        MessageBox.Show("Erro no servidor:" + response, "Alerta do sistema", MessageBoxButtons.OK);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Erro no lado do servidor." + ex, "Alerta do sistema", MessageBoxButtons.OK);
                }
            }
        }