예제 #1
0
        private void BtnSignup_Click(object sender, EventArgs e)
        {
            int flag = 0;

            Listener user = new Listener();

            MemoryStream ms = new MemoryStream();

            picUser.Image.Save(ms, picUser.Image.RawFormat);
            user.picture = ms.ToArray();


            user.fName    = txtFname.Text;
            user.lName    = txtLname.Text;
            user.email    = txtEmail.Text;
            user.password = txtPasswd.Text;

            if (!string.IsNullOrEmpty(cmbG1.Text))
            {
                user.prefrence1 = cmbG1.Text;
            }
            else
            {
                errGenre.Visible = true;
            }

            if (!string.IsNullOrEmpty(cmbG2.Text))
            {
                user.prefrence2 = cmbG2.Text;
            }
            else
            {
                errGenre.Visible = true;
            }

            if (rbMale.Checked)
            {
                user.gender = "M";
            }
            else if (rbFemale.Checked)
            {
                user.gender = "F";
            }
            else
            {
                errGender.Visible = true;
                flag = 1;
            }

            if (flag == 0)
            {
                user.saveListener();
                Ui_UserLogin login = new Ui_UserLogin();
                login.Show();
                this.Close();
            }
        }
예제 #2
0
        private void BtnSignup_Click(object sender, EventArgs e)
        {
            int flag = 0;

            Artist creator = new Artist();

            MemoryStream ms = new MemoryStream();

            picUser.Image.Save(ms, picUser.Image.RawFormat);
            creator.picture = ms.ToArray();


            creator.fName     = txtFname.Text;
            creator.lName     = txtLname.Text;
            creator.stageName = txtStagename.Text;
            creator.email     = txtEmail.Text;
            creator.password  = txtPasswd.Text;


            if (rbMale.Checked)
            {
                creator.gender = "M";
            }
            else if (rbFemale.Checked)
            {
                creator.gender = "F";
            }
            else
            {
                errGender.Visible = true;
                flag = 1;
            }

            if (flag == 0)
            {
                creator.saveArtist();
                Ui_UserLogin login = new Ui_UserLogin();
                login.Show();
                this.Close();
            }
        }