Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            var    ws    = new wsClass();
            string pesan = ws.cekLogin("", "");

            MessageBox.Show(pesan);
        }
Exemple #2
0
        private void btLogin_Click(object sender, EventArgs e)
        {
            string user = txtUser.Text;
            string pass = txtPass.Text;

            if (user == "" || pass == "")
            {
                MessageBox.Show("Username dan Password belum di isi");
            }
            else
            {
                pbLoading.Visible = true;
                try
                {
                    var      ws     = new wsClass();
                    string   pesan  = ws.cekLogin(user, pass);
                    string[] respon = pesan.Split('|');
                    string   pes    = "";
                    pbLoading.Visible = false;
                    if (respon[0] == "failed")
                    {
                        MessageBox.Show("Login Gagal");
                    }
                    else
                    {
                        //MessageBox.Show("Login Berhasil");
                        Main frm = new Main();
                        this.Hide();
                        frm.Show();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                    pbLoading.Visible = false;
                }
            }
        }