Пример #1
0
 private void btnRegister_Click(object sender, EventArgs e)
 {
     if (txtUserName.Text == "" || txtPassword.Text == "" || txtContact.Text == "" || txtAnswer.Text == "")
     {
         MessageBox.Show("Incomplete Information!");
     }
     else
     {
         bool valid  = false;
         bool valids = false;
         localhost.Service1 server = new localhost.Service1();
         server.RegisterAdmin(txtUserName.Text, txtPassword.Text, txtContact.Text, cmbQuestion.Text, txtAnswer.Text, out valid, out valids);
         if (valid)
         {
             MessageBox.Show("Admin Registered!");
         }
         else
         {
             MessageBox.Show("Can not register more than one admin!");
         }
         txtUserName.Text = "";
         txtPassword.Text = "";
         txtContact.Text  = "";
         txtAnswer.Text   = "";
     }
 }