コード例 #1
0
        private void btnRegister_Click(object sender, RoutedEventArgs e)
        {
            vali = new validation();

            string name,surname,ID, Email,cellNumber,  password, vpassword;
             string  msg = "";

            ID = txtID.Text;
            name = txtname.Text;
            surname = txtSurname.Text;
            cellNumber = txtCellNumber.Text;
            Email = txtEmail.Text;
            password = txtPassword.ToString();
            vpassword = txtVpasswrd.ToString();

            //msg =vali.validateString(name);

            if (vali.IDValidation(ID) != "")
            {
                msg += vali.IDValidation(ID) + "\n";
                //txtID.Focus();
            }
            if(vali.validateString(name) != "")
            {
                msg += vali.validateString(name) + "\n";
                
            }
            if(vali.validateCellNum(cellNumber) != "")
            {
                msg += "cellNumber" + vali.validateCellNum(cellNumber) + "\n";
            }




            if (chkTerm.IsChecked == false)
            {
                msg += "chect the terms and condition" + "\n";

            }
            if(msg == "" ) 
            {
                string msgR = "Thanks you for registering with our EMS service";
                messageR(msgR);
            }
            else
            {
                messageBox(msg);
            }


        }
コード例 #2
0
        private void btnUpdate_Click(object sender, RoutedEventArgs e)
        {
            objValidate = new validation();

            string cellNumber, Email, address;
             string msg = "" ;
             string msg1;
            cellNumber = txtCellNum.Text;
            Email = txtEmail.Text;
            address = txtAddress.Text;

            if(objValidate.validateCellNum(cellNumber) != "" )
            {
                msg += objValidate.validateCellNum(cellNumber)+ "\n";
            }
            else if(objValidate.validateEmail(Email) != "")
            {
                msg += objValidate.validateEmail(Email) + "\n";
            }else if(address == "")
            {
                msg += "please provide your address \n";
            
            }
            else
            {
                msg1 = "Thanks you for updating your information ";
                //lblDisplay.Text = msg1;
                
                //this.Frame.Navigate(typeof(HomePage));
            }
    
            msg1 = "Thanks you for updating your information ";
            if (msg != "")
                lblDisplay.Text = msg;
            else
                lblDisplay.Text = msg1;
        }