Ejemplo n.º 1
0
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            int    flag = 0;
            string email = "", passwd = "";

            if (!string.IsNullOrEmpty(txtEmail.Text.Trim()))
            {
                email = txtEmail.Text;
            }
            else
            {
                flag             = 1;
                errEmail.Visible = true;
            }

            if (!string.IsNullOrEmpty(txtPassword.Text.Trim()))
            {
                passwd = txtPassword.Text;
            }
            else
            {
                flag = 1;
                errPassword.Visible = true;
            }

            if (flag == 0)
            {
                if (!chkArtist.Checked)
                {
                    if (user.loginListener(email, passwd) == 0)
                    {
                        errEmail.Visible    = false;
                        errPassword.Visible = false;
                        Ui_ListenerHome home = new Ui_ListenerHome();
                        home.populateHome(email, passwd);
                        home.Show();
                        this.Hide();
                    }
                    else
                    {
                        errEmail.Visible    = true;
                        errPassword.Visible = true;
                    }
                }
                else
                {
                    if (creator.loginArtist(email, passwd) == 0)
                    {
                        errEmail.Visible    = false;
                        errPassword.Visible = false;
                        Ui_ArtistHome home = new Ui_ArtistHome();
                        home.populateHome(email, passwd);
                        home.Show();
                        this.Hide();
                    }
                    else
                    {
                        errEmail.Visible    = true;
                        errPassword.Visible = true;
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public void senderListener(Ui_ListenerHome home)
 {
     list = home;
 }