コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            PlannerControl2 plannerControl2 = new PlannerControl2();

            this.Controls.Clear();
            this.Controls.Add(plannerControl2);
        }
コード例 #2
0
        private void addCustomer()
        {
            name        = tbUserName.Text;
            number      = tbContactNumber.Text;
            residence   = cbCountryOfResidance.Text;
            email       = tbEmail.Text;
            nationality = cbNationality.Text;
            language    = tbPreferredLanguage.Text;

            String sql = "INSERT INTO customers (name,phone_number,residence,email, nationality, c_language) VALUES('" + name + "','" + number + "','" + residence + "','" + email + "','" + nationality + "','" + language + "')";


            if (tbUserName.Text.Equals("") || tbContactNumber.Text.Equals("") || cbCountryOfResidance.Text.Equals("") || tbEmail.Text.Equals("") || cbNationality.Text.Equals("") || tbPreferredLanguage.Text.Equals(""))
            {
                MessageBox.Show("Please fill all the required fields..");
            }
            else
            {
                try
                {
                    MySqlCommand    command = new MySqlCommand(sql, conn);
                    MySqlDataReader dataReader;
                    conn.Open();
                    dataReader = command.ExecuteReader();

                    //assigning email to email in plannerControl2
                    PlannerControl2 control2 = new PlannerControl2();
                    //plannerControl2.UserMail = email;
                    //end


                    MessageBox.Show("Successfully saved...!");
                    conn.Close();

                    /*
                     * plannerControl2 = new PlannerControl2();
                     * this.Controls.Add(plannerControl2);
                     * addUserInBuilder.Hide();
                     */

                    addUserInBuilder         = new AddUserInBuilder();
                    plannerControl2          = new PlannerControl2();
                    plannerControl2.UserMail = tbEmail.Text;
                    this.Controls.Clear();
                    this.Controls.Add(plannerControl2);
                }
                catch (Exception e)
                {
                    MessageBox.Show("There is a error while attepmting to add records : " + e);
                    conn.Close();
                }
            }
        }
コード例 #3
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (txtEmail.Text != "")
     {
         PlannerControl2 plannerControl2 = new PlannerControl2();
         plannerControl2.UserMail = (userMail + date);
         this.Controls.Clear();
         this.Controls.Add(plannerControl2);
     }
     else
     {
         MessageBox.Show("please select a user to proceed ");
     }
 }
コード例 #4
0
        private void addCustomer()
        {
            //String sql = "INSERT INTO user_credentials (name,phone_number,residence,email, nationality, c_language) VALUES('" + name + "','" + number + "','" + residence + "','" + email + "','" + nationality + "','" + language + "')";


            if (pass.Text.Equals(rePass.Text))
            {
                String sql = "INSERT INTO user_credentials (user_id, user_name, user_type, access_code) VALUES('" + tbEmail.Text + "','" + tbUserName.Text + "','" + cbCountryOfResidance.Text + "','" + pass.Text + "')";

                if (tbUserName.Text.Equals("") || cbCountryOfResidance.Text.Equals("") || tbEmail.Text.Equals("") || rePass.Text.Equals(""))
                {
                    MessageBox.Show("Please fill all the required fields..");
                }
                else
                {
                    try
                    {
                        MySqlCommand    command = new MySqlCommand(sql, conn);
                        MySqlDataReader dataReader;
                        conn.Open();
                        dataReader = command.ExecuteReader();

                        //assigning email to email in plannerControl2
                        PlannerControl2 control2 = new PlannerControl2();
                        //plannerControl2.UserMail = email;
                        //end


                        MessageBox.Show("Successfully saved...!");
                        conn.Close();
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show("There is a error while attepmting to add records : " + e);
                        conn.Close();
                    }
                }
            }
            else
            {
                MessageBox.Show("passwords are not matching");
            }
        }
コード例 #5
0
        private void addToTrip()
        {
            String arrivalDate  = txtArrivalDate.Text;
            String depatureDate = txtDepatureDate.Value.Date.ToShortDateString();
            String triptId      = (userMail + date);

            PlannerControl3 plannerControl3 = new PlannerControl3();

            plannerControl3.BringToFront();


            plannerControl3.l3.Text = txtNoOfDays.Text;


            plannerControl3.controlAdults     = txtAdults.Text;
            plannerControl3.controlChildren   = txtChildrents.Text;
            plannerControl3.controlCategory   = cmbCategary.Text;
            plannerControl3.controlSingleRoom = txtSingle.Text;
            plannerControl3.controlDoubleRoom = txtDouble.Text;
            plannerControl3.controlTripleRoom = txtTriple.Text;
            plannerControl3.controlTripId     = triptId;
            plannerControl3.controlHStatus    = cmbCategary.Text;
            plannerControl3.controlDays       = Convert.ToInt16(txtNoOfDays.Text);

            String sql = "INSERT INTO trips " +
                         "(tripId, " +
                         "arivalDate, " +
                         "depatureDate, " +
                         "adults, " +
                         "childrents, " +
                         "noOfDays, " +
                         "noOfRooms, " +
                         "singleRoom, " +
                         "doubleRoom, " +
                         "tripleRoom, " +
                         "meal, " +
                         "starGategory) " +
                         "VALUES('"
                         + triptId + "','"
                         + arrivalDate + "','"
                         + depatureDate + "','"
                         + txtAdults.Text + "','"
                         + txtChildrents.Text + "','"
                         + txtNoOfDays.Text + "','"
                         + txtNoOfRooms.Text + "','"
                         + txtSingle.Text + "','"
                         + txtDouble.Text + "','"
                         + txtTriple.Text + "','"
                         + cmbMeals.Text + "','"
                         + cmbCategary.Text + "')";


            try
            {
                MySqlCommand    command = new MySqlCommand(sql, conn);
                MySqlDataReader dataReader;
                conn.Open();
                dataReader = command.ExecuteReader();

                MessageBox.Show("Successfully added...!");
                conn.Close();

                plannerControl2 = new PlannerControl2();
                this.Controls.Clear();
                this.Controls.Add(plannerControl3);
            }
            catch (Exception e)
            {
                MessageBox.Show("There is a error while attepmting to add records : " + e);
                conn.Close();
            }
        }