示例#1
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            String cusName = textBox1.Text;
            String cusPhn  = textBox2.Text;
            String email   = textBox3.Text;
            String vehicle = textBox4.Text;
            // String dtaTime = dateTimePicker1.Value.ToString("yyyy-MM-dd");
            Guid   UniqueID = Guid.NewGuid();
            String id;

            id = UniqueID.ToString();
            if ((cusName != "") && (cusPhn != "") && (email != "") && (vehicle != ""))
            {
                Appoinment         appoinment = new Appoinment(id, cusName, cusPhn, email, vehicle, dateTimePicker1.Value.ToString());
                DatabaseConnection db         = new DatabaseConnection();
                db.addAppoinment(appoinment);
            }
            else
            {
                err er = new err();
                er.Show();
                textBox1.Text = "";
                textBox2.Text = "";
                textBox3.Text = "";
                textBox4.Text = "";
            }
        }
示例#2
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");
            }
        }
示例#3
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             = "";
        }