private void button1_Click(object sender, EventArgs e)
        {
            try {
                string name         = txtmarriagename.Text;
                string surname      = txtmarriagesurname.Text;
                string from_who     = txtmarriagewho.Text;
                string weddingdate  = txtmarriageweddate.Text;
                string weddingvenue = txtmarriagewvenue.Text;


                if (name == string.Empty)
                {
                    MessageBox.Show("Please enter name");
                    return;
                }
                if (surname == string.Empty)
                {
                    MessageBox.Show("Please enter surname");
                    return;
                }

                if (weddingdate == string.Empty)
                {
                    MessageBox.Show("Please enter wedding date");
                    return;
                }
                if (weddingvenue == string.Empty)
                {
                    MessageBox.Show("Please enter wedding venue");
                    return;
                }


                MarriageWitness m = new MarriageWitness();

                m.Name         = name;
                m.Surname      = surname;
                m.From_who     = from_who;
                m.Weddingdate  = weddingdate;
                m.Weddingvenue = weddingvenue;


                int result = m.AddMarriageW(m);

                if (result > 0)
                {
                    label6.Text = "Marriage Witness Added";

                    Adminpage adminpage = new Adminpage();
                    adminpage.Show();
                    this.Hide();
                }
                else
                {
                    label6.Text = "Marriage Witness not Added";

                    Adminpage adminpage = new Adminpage();
                    adminpage.Show();
                    this.Hide();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                string name         = txtgroomname.Text;
                string surname      = txtgroomsurname.Text;
                string phonenumber  = txtgroomphone.Text;
                string email        = txtgroomemail.Text;
                string username     = txtgroomusername.Text;
                string password     = txtgroomasswo.Text;
                string weddingdate  = txtgroomdate.Text;
                string weddingvenue = txtgroomvenue.Text;
                string bridename    = txtgroomsbride.Text;

                if (name == string.Empty)
                {
                    MessageBox.Show("Please enter name");
                    return;
                }
                if (surname == string.Empty)
                {
                    MessageBox.Show("Please enter surname");
                    return;
                }
                if (phonenumber == string.Empty)
                {
                    MessageBox.Show("Please enter phone number");
                    return;
                }
                if (email == string.Empty)
                {
                    MessageBox.Show("Please enter email");
                    return;
                }
                if (username == string.Empty)
                {
                    MessageBox.Show("Please enter username");
                    return;
                }
                if (password == string.Empty)
                {
                    MessageBox.Show("Please enter password");
                    return;
                }
                if (weddingdate == string.Empty)
                {
                    MessageBox.Show("Please enter wedding date");
                    return;
                }
                if (weddingvenue == string.Empty)
                {
                    MessageBox.Show("Please enter wedding venue");
                    return;
                }
                if (bridename == string.Empty)
                {
                    MessageBox.Show("Please enter groom name");
                    return;
                }


                Groom g = new Groom();


                g.Name         = name;
                g.Surname      = surname;
                g.Phonenumber  = phonenumber;
                g.Email        = email;
                g.Username     = username;
                g.Password     = password;
                g.Weddingdate  = weddingdate;
                g.Weddingvenue = weddingvenue;
                g.Bridename    = bridename;

                int result = g.AddGroom(g);

                if (result > 0)
                {
                    label10.Text = "Groom Added";

                    Adminpage adminpage = new Adminpage();
                    adminpage.Show();
                    this.Hide();
                }
                else
                {
                    label10.Text = "Groom not Added";

                    Adminpage adminpage = new Adminpage();
                    adminpage.Show();
                    this.Hide();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                string name         = txtbridename.Text;
                string surname      = txtbridesurname.Text;
                string phonenumber  = txtbrideprohne.Text;
                string email        = txtbrideemail.Text;
                string username     = txtbrideusernae.Text;
                string password     = txtbridepasswo.Text;
                string weddingdate  = txtbrideweddingdate.Text;
                string weddingvenue = txtbridevenue.Text;
                string groomname    = txtbridesgroom.Text;

                if (name == string.Empty)
                {
                    MessageBox.Show("Please enter name");
                    return;
                }
                if (surname == string.Empty)
                {
                    MessageBox.Show("Please enter surname");
                    return;
                }
                if (phonenumber == string.Empty)
                {
                    MessageBox.Show("Please enter phone number");
                    return;
                }
                if (email == string.Empty)
                {
                    MessageBox.Show("Please enter email");
                    return;
                }
                if (username == string.Empty)
                {
                    MessageBox.Show("Please enter username");
                    return;
                }
                if (password == string.Empty)
                {
                    MessageBox.Show("Please enter password");
                    return;
                }
                if (weddingdate == string.Empty)
                {
                    MessageBox.Show("Please enter wedding date");
                    return;
                }
                if (weddingvenue == string.Empty)
                {
                    MessageBox.Show("Please enter wedding venue");
                    return;
                }
                if (groomname == string.Empty)
                {
                    MessageBox.Show("Please enter groom name");
                    return;
                }

                Bride b = new Bride();

                b.Name         = name;
                b.Surname      = surname;
                b.Phonenumber  = phonenumber;
                b.Email        = email;
                b.Username     = username;
                b.Password     = password;
                b.Weddingdate  = weddingdate;
                b.Weddingvenue = weddingvenue;
                b.Groomname    = groomname;

                int result = b.AddBride(b);

                if (result > 0)
                {
                    label10.Text = "Bride Added";

                    Adminpage adminpage = new Adminpage();
                    adminpage.Show();
                    this.Hide();
                }
                else
                {
                    label10.Text = "Bride not Added";

                    Adminpage adminpage = new Adminpage();
                    adminpage.Show();
                    this.Hide();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                string name         = txtguestname.Text;
                string surname      = txtguestsurnm.Text;
                string whosewedding = txtwhosewed.Text;
                string weddingdate  = txtguestdate.Text;
                string weddingvenue = txtguestvene.Text;


                if (name == string.Empty)
                {
                    MessageBox.Show("Please enter name");
                    return;
                }
                if (surname == string.Empty)
                {
                    MessageBox.Show("Please enter surname");
                    return;
                }
                if (whosewedding == string.Empty)
                {
                    MessageBox.Show("Please enter wedding of who");
                    return;
                }

                if (weddingdate == string.Empty)
                {
                    MessageBox.Show("Please enter wedding date");
                    return;
                }
                if (weddingvenue == string.Empty)
                {
                    MessageBox.Show("Please enter wedding venue");
                    return;
                }


                Guests g = new Guests();

                g.Name         = name;
                g.Surname      = surname;
                g.Whosewedding = whosewedding;
                g.Weddingdate  = weddingdate;
                g.Weddingvenue = weddingvenue;


                int result = g.AddGuest(g);

                if (result > 0)
                {
                    label11.Text = "Guest Added";

                    Adminpage adminpage = new Adminpage();
                    adminpage.Show();
                    this.Hide();
                }
                else
                {
                    label11.Text = "Guest not Added";

                    Adminpage adminpage = new Adminpage();
                    adminpage.Show();
                    this.Hide();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                string name        = adminnm.Text;
                string surname     = adminsrname.Text;
                string phonenumber = adminpnum.Text;
                string email       = adminmail.Text;
                string username    = adminuser.Text;
                string password    = adminpass.Text;

                if (name == string.Empty)
                {
                    MessageBox.Show("Please enter name");
                    return;
                }
                if (surname == string.Empty)
                {
                    MessageBox.Show("Please enter surname");
                    return;
                }
                if (phonenumber == string.Empty)
                {
                    MessageBox.Show("Please enter phone number");
                    return;
                }
                if (email == string.Empty)
                {
                    MessageBox.Show("Please enter email");
                    return;
                }
                if (username == string.Empty)
                {
                    MessageBox.Show("Please enter username");
                    return;
                }
                if (password == string.Empty)
                {
                    MessageBox.Show("Please enter password");
                    return;
                }

                Admin a = new Admin();

                a.Name        = name;
                a.Surname     = surname;
                a.Phonenumber = phonenumber;
                a.Email       = email;
                a.Username    = username;
                a.Password    = password;

                int result = a.AddAdmin(a);

                if (result > 0)
                {
                    lblmes.Text = "Admin Added";

                    Adminpage adminpage = new Adminpage();
                    adminpage.Show();
                    this.Hide();
                }
                else
                {
                    lblmes.Text = "Admin not Added";

                    Adminpage adminpage = new Adminpage();
                    adminpage.Show();
                    this.Hide();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }