Ejemplo n.º 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            ServiceReference.Restaurant restaurant = new ServiceReference.Restaurant
            {
                Name = LoginUserName.Text,

                Psw = LoginPassword.Text
            };
            ServiceReference.RestaurantWCFServiceClient client = new ServiceReference.RestaurantWCFServiceClient();
            int F = client.Login(restaurant);

            MessageBox.Show(F.ToString());
            if (F == 1)
            {
                MessageBox.Show("Hi " + restaurant.Name + ",\n" + "Welcome to My Cafe");
                MenuPage MP = new MenuPage();
                this.Hide();
                MP.Show();
            }
            else
            {
                MessageBox.Show("Your UserName and Password are incorrect try again or create a new account");
            }
            LoginUserName.Text = " ";
            LoginPassword.Text = " ";
        }
Ejemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            ServiceReference.Restaurant restaurant = new ServiceReference.Restaurant
            {
                Name   = txtName.Text,
                Gender = CmbGender.Text,
                // DateOfBirth = dateTimePicker1.Value,
                Psw = txtPass.Text
            };

            ServiceReference.RestaurantWCFServiceClient client = new ServiceReference.RestaurantWCFServiceClient();
            client.SaveDetails(restaurant);
            MessageBox.Show("Saved");
            //MessageBox.Show(restaurant.Psw);

            txtName.Text          = " ";
            CmbGender.Text        = " ";
            dateTimePicker1.Value = DateTimePicker.MinimumDateTime;
            txtPass.Text          = " ";
        }