private void btnRegister_Click(object sender, EventArgs e)
        {
            if (txtFirstName.Text == "")
            {
                WarningFN.Visible = true;
                WarningFN.Text    = "First name is mandatory";
            }
            else
            {
                RegDetails user = new RegDetails
                {
                    FirstName = txtFirstName.Text,
                    LastName  = txtLastName.Text,
                    Email     = txtEmail.Text,
                    Mobile    = Convert.ToInt64(txtMobile.Text),
                    UserName  = txtUserName.Text,
                    Password  = txtPassword.Text,
                    Confirm   = txtConfirm.Text
                };

                string Response = user.ImplementBusinessLogics(user);
                if (Response != "Congrats!!! Your account is sucessfully registered")
                {
                    if (Response == "invalid name")
                    {
                        WarningFN.Visible = true;
                        WarningFN.Text    = "First name is mandatory";
                    }
                }
                MessageBox.Show(Response);
                if (Response == "Congrats!!! Your account is sucessfully registered")
                {
                    this.Hide();
                    Login objLogin = new Login();
                    objLogin.Show();
                }
            }
        }
示例#2
0
        private void btnRegister_Click(object sender, EventArgs e)
        {
            
            RegDetails user = new RegDetails
            {
                FirstName = txtFirstName.Text,
                LastName = txtLastName.Text,
                Email = txtEmail.Text,
                Mobile = Convert.ToInt64(txtMobile.Text),
                UserName = txtUserName.Text,
                Password = txtPassword.Text,
                Confirm = txtConfirm.Text
            };
            bool Response = user.ImplementBusinessLogics(user);
            if (Response)
            {
                MessageBox.Show("Data saved sucessfully");

            }
            else
            {
                MessageBox.Show("Failed to save data");
            }
        }