private void button2_Click(object sender, EventArgs e)
        {
            Customer_Home ch = new Customer_Home(user);

            this.Hide();
            ch.Show();
        }
Example #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            LoginService loginService = new LoginService();

            try
            {
                if (textBox1.Text == string.Empty || textBox2.Text == string.Empty)
                {
                    MessageBox.Show("Username or Password can not be empty.");
                }

                else
                {
                    Login ln = new Login();
                    ln.Username = textBox1.Text;
                    ln.Password = textBox2.Text;
                    Login result = loginService.LoginValidation(ln);
                    if (result.UserType > 0)
                    {
                        if (result.UserType == 1)
                        {
                            Admin1stpage ap = new Admin1stpage(result);
                            this.Hide();
                            ap.Show();
                        }
                        else if (result.UserType == 2)
                        {
                            Customer_Home ch = new Customer_Home(result);
                            this.Hide();
                            ch.Show();
                        }
                        else
                        {
                            MessageBox.Show("User does not exist.");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Invalid Username or Password");
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Invalid Username or Password");
            }
        }
        private void button3_Click_1(object sender, EventArgs e)
        {
            try
            {
                if (textBox1.Text == string.Empty || textBox2.Text == string.Empty)
                {
                    MessageBox.Show("Check Booking Id or Feedback");
                }
                else
                {
                    BookingService bs   = new BookingService();
                    Booking        b    = bs.GetById(Convert.ToInt32(textBox2.Text));
                    string         type = b.EventType;

                    FeedbackService feedService = new FeedbackService();
                    int             result      = feedService.Insert(new Feedback()
                    {
                        Feedback_Details = textBox1.Text, Id = Convert.ToInt32(textBox2.Text), Event_Type = type
                    });

                    if (result > 0)
                    {
                        MessageBox.Show("Feedback added.");
                        Customer_Home ch = new Customer_Home();
                        this.Hide();
                        ch.Show();
                    }
                    else
                    {
                        MessageBox.Show("Error");
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Incorrect Input");
            }
        }
        public void InsertInto(string a, string b, string c, int d, int p, string food, string equipment, double cost)
        {
            BookingService bService = new BookingService();
            int            result   = bService.Insert(new Booking()
            {
                EventType = a, Vanue = b, Date = c, NoOfGuest = d, Status = p, SelectedFood = food, SelectedEquipment = equipment, Cost = cost
            });

            if (result > 0)
            {
                BookingService bs = new BookingService();
                var            x  = bs.GetAllBooking();
                foreach (var s in x)
                {
                    m = s.Id;
                }

                if (Convert.ToInt32(textBox4.Text) > 0)
                {
                    Mailsend(m);
                    MessageBox.Show("request successsful!\n Remember your Booking Id is  " + m);
                    Customer_Home       ch = new Customer_Home();
                    Customer_Book_Event cb = new Customer_Book_Event();
                    cb.Hide();
                    ch.Show();
                }
                else
                {
                    MessageBox.Show("Number Of Guests can not be 0");
                }
            }
            else
            {
                MessageBox.Show("Error");
            }
        }