예제 #1
0
 private void btnCompleteRegister_Click(object sender, EventArgs e)
 {
     if (txtFirstName.Text != "" && txtFirstName.Text != "" && txtLastName.Text != "" && txtMail.Text != "" && txtUsername.Text != "" && txtPassword.Text != "")
     {
         // Initialize the customer with provided values
         Customer c = new Customer();
         c.FirstName   = txtFirstName.Text;
         c.LastName    = txtLastName.Text;
         c.UserName    = txtUsername.Text;
         c.password    = txtPassword.Text;
         c.EMail       = txtMail.Text;
         c.PicturePath = "..\\..\\Assets\\UserAvatars\\happy" + ".png";
         //add to db
         if (cda.AddItem(c))
         // alert the result
         {
             lblAlertSuccess.Visible = true;
             lblAlertSuccess.BringToFront();
         }
         else
         {
             lblAlertFail.Text    = "   Unavailable Values to Register";
             lblAlertFail.Visible = true;
             lblAlertFail.BringToFront();
         }
     }
     else
     {
         lblAlertFail.Text    = "Please fill the form!";
         lblAlertFail.Visible = true;
         lblAlertFail.BringToFront();
     }
 }