示例#1
0
        private void gunaGradientButton1_Click(object sender, EventArgs e)
        {
            String firstName      = fName.Text;
            String lastName       = lName.Text;
            String email1         = email.Text;
            String password1      = password.Text;
            String repeatPassword = rPassword.Text;
            String designation1   = designation.Text;
            Guid   UniqueID       = Guid.NewGuid();
            String id;

            id = UniqueID.ToString();
            if (password1 == repeatPassword)
            {
                if ((firstName != "") && (lastName != "") && (email1 != "") && (password1 != "") && (designation1 != ""))
                {
                    Console.WriteLine("fName Not Null");
                    User user = new User(id, firstName, lastName, email1, password1, designation1);
                    Console.WriteLine(user.Designation);
                    Form1 newForm         = new Form1();
                    DatabaseConnection db = new DatabaseConnection();
                    bool res = db.addUser(user);
                    Console.WriteLine(res);
                    if (res == true)
                    {
                        fmAlert fm = new fmAlert();
                        fm.Show();
                        fName.Text       = "";
                        lName.Text       = "";
                        email.Text       = "";
                        password.Text    = "";
                        rPassword.Text   = "";
                        designation.Text = "";
                    }
                }
                else
                {
                    err fm = new err();
                    fm.Show();
                    fName.Text       = "";
                    lName.Text       = "";
                    email.Text       = "";
                    password.Text    = "";
                    rPassword.Text   = "";
                    designation.Text = "";
                }
            }

            else
            {
                MessageBox.Show("Password does not match");
            }
        }
示例#2
0
        private void gunaGradientButton1_Click(object sender, EventArgs e)
        {
            String             descrip = gunaTextBox1.Text;
            DatabaseConnection db      = new DatabaseConnection();
            bool res = db.addFeedbacks(state, descrip);

            if (res == true)
            {
                fmAlert fm = new fmAlert();
                fm.Show();
            }
            else
            {
                err er = new err();
                er.Show();
            }
            gunaTextBox1.Text = "";
            state             = "";
        }