private void AddProfile(UciEngineProfile profile)
        {
            if (profilesListBox.Items.Contains(profile.Name))
            {
                throw new ArgumentException("Name already used");
            }

            Profiles.AddProfile(profile);
            profilesListBox.Items.Add(profile.Name);
        }
Ejemplo n.º 2
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (ValidatedInput())
            {
                String email      = TextBoxEmail.Text.ToString();
                String password   = TextBoxPassword.Text.ToString();
                String cppassword = TextBoxCPassword.Text.ToString();
                String fname      = TextBoxFname.Text.ToString();
                String lname      = TextBoxLname.Text.ToString();
                String acc_type   = "User";
                int    question   = 0;
                var    datenow    = DateTime.Now;
                String dateposted = datenow.ToShortDateString();


                Profiles prof   = new Profiles(-1, email, password, fname, lname, "", "", "", "", "", "", acc_type, question, dateposted, "");
                int      insCnt = prof.AddProfile();
                if (insCnt == 1)
                {
                    Response.Redirect("Login.aspx");
                }
            }
        }