예제 #1
0
 public ThankYou(UserRestaurante restaurante1, Pedido p)
 {
     InitializeComponent();
     restaurante      = restaurante1;
     pedidoCriado     = p;
     txtBox_code.Text = pedidoCriado.Code;
 }
예제 #2
0
 public YourDonation(UserRestaurante restaurante1, Pedido p, Pedido edited1 = null)
 {
     InitializeComponent();
     restaurante          = restaurante1;
     pedido               = p;
     edited               = edited1;
     _descricao           = p.Descricao;
     _horas               = p.HorasDeRecolha;
     _contAdicional       = p.ConteudoAdicional;
     txtBox_donation.Text = ("DESCRIPTION: " + _descricao + "\nPICK'UP TIME: " + _horas + "\nEXTRA INFO: " + _contAdicional).ToUpper();
 }
예제 #3
0
 public SignUpRestaurant(UserRestaurante restaurante = null)
 {
     InitializeComponent();
     InitializeComponent();
     if (restaurante != null)
     {
         txtBoxCode_Restaurante.Text     = restaurante.codeRestaurante;
         txtBoxNome_Restaurante.Text     = restaurante.nomeRestaurante;
         ComboBoxCidade_Restaurante.Text = restaurante.cidadeRestaurante;
         txtBoxMorada_Restaurante.Text   = restaurante.moradaRestaurante;
     }
 }
 public DonateFood(UserRestaurante restaurante1, Pedido p = null)
 {
     InitializeComponent();
     restaurante = restaurante1;
     if (p != null)
     {
         edited = p;
         txtBox_descricao.Text         = p.Descricao;
         comboBox1.Text                = p.HorasDeRecolha;
         txtBox_conteudoAdicional.Text = p.ConteudoAdicional;
     }
 }
        public PastDonations(UserRestaurante restaurante1)
        {
            InitializeComponent();
            restaurante = restaurante1;

            foreach (Pedido p in restaurante.pedidosPassadosRestaurante)
            {
                if (p.Aceite)
                {
                    lstBoxPastDonations.Items.Add(p.withDateString());
                }
            }
        }
        public CurrentDonations(UserRestaurante restaurante1)
        {
            InitializeComponent();
            restaurante = restaurante1;

            lstBoxCurrDonations.Items.Clear();

            foreach (Pedido p in restaurante.pedidosRestaurante)
            {
                if (!p.Aceite)
                {
                    lstBoxCurrDonations.Items.Add(p.withCodeString());
                }
            }
        }
예제 #7
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (txtBoxCode_Restaurante.Text == "" || txtBoxNome_Restaurante.Text == "" || ComboBoxCidade_Restaurante.SelectedIndex == -1 || txtBoxMorada_Restaurante.Text == "")
            {
                MessageBox.Show("Please fill in all fields");
            }
            else
            {
                if (allVerifications(txtBoxCode_Restaurante.Text, txtBoxNome_Restaurante.Text, txtBoxMorada_Restaurante.Text) == 1)
                {
                    MessageBox.Show("Your certificate code should have between 4 and 10 characters");
                }
                else if (allVerifications(txtBoxCode_Restaurante.Text, txtBoxNome_Restaurante.Text, txtBoxMorada_Restaurante.Text) == 2)
                {
                    MessageBox.Show("Your restaurant name should have between 4 and 25 characters");
                }
                else if (allVerifications(txtBoxCode_Restaurante.Text, txtBoxNome_Restaurante.Text, txtBoxMorada_Restaurante.Text) == 3)
                {
                    MessageBox.Show("Your restaurant name must have at least one letter");
                }
                else if (allVerifications(txtBoxCode_Restaurante.Text, txtBoxNome_Restaurante.Text, txtBoxMorada_Restaurante.Text) == 4)
                {
                    MessageBox.Show("Your address must have at least 10 characters");
                }
                else if (allVerifications(txtBoxCode_Restaurante.Text, txtBoxNome_Restaurante.Text, txtBoxMorada_Restaurante.Text) == 5)
                {
                    MessageBox.Show("Your address must have at least one letter");
                }
                else if (allVerifications(txtBoxCode_Restaurante.Text, txtBoxNome_Restaurante.Text, txtBoxMorada_Restaurante.Text) == 0)
                {
                    UserRestaurante restaurante1 = new UserRestaurante();
                    restaurante1.codeRestaurante   = txtBoxCode_Restaurante.Text;
                    restaurante1.nomeRestaurante   = txtBoxNome_Restaurante.Text;
                    restaurante1.cidadeRestaurante = ((ComboBoxItem)ComboBoxCidade_Restaurante.SelectedItem).Content.ToString();
                    restaurante1.moradaRestaurante = txtBoxMorada_Restaurante.Text;

                    WeAreAlmostReadyR weAreAlmostReadyR = new WeAreAlmostReadyR(restaurante1);
                    this.NavigationService.Navigate(weAreAlmostReadyR);
                }
            }
        }
 public WeAreAlmostReadyR(UserRestaurante restaurante1)
 {
     InitializeComponent();
     restauranteFinal = restaurante1;
 }
 public HelloRestaurant(UserRestaurante restaurante1)
 {
     InitializeComponent();
     restaurante = restaurante1;
     LabelHelloRestaurant.Content += restaurante.nomeRestaurante.ToUpper();
 }
예제 #10
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            Boolean         existeCaridade    = false;
            Boolean         existeRestaurante = false;
            UserCaridade    caridade          = new UserCaridade();
            UserRestaurante restaurante       = new UserRestaurante();


            if (txtBox_EmailLogIn.Text == "" || txtBox_PswLogIn.Password.ToString().Equals(""))
            {
                MessageBox.Show("Please fill in all fields");
            }

            else
            {
                foreach (UserCaridade c in CreateClasses.ListaCaridades)
                {
                    if (c.emailCaridade == txtBox_EmailLogIn.Text)
                    {
                        existeCaridade = true;
                        caridade       = c;
                    }
                }

                foreach (UserRestaurante r in CreateClasses.ListaRestaurantes)
                {
                    if (r.emailRestaurante == txtBox_EmailLogIn.Text)
                    {
                        existeRestaurante = true;
                        restaurante       = r;
                    }
                }

                if (existeCaridade)
                {
                    if (!caridade.passwordCaridade.Equals(txtBox_PswLogIn.Password))
                    {
                        MessageBox.Show("The password provided is incorrect");
                    }
                    else
                    {
                        HelloCharity helloCharity = new HelloCharity(caridade);
                        this.NavigationService.Navigate(helloCharity);
                    }
                }

                else if (existeRestaurante)
                {
                    if (!restaurante.passwordRestaurante.Equals(txtBox_PswLogIn.Password))
                    {
                        MessageBox.Show("The password provided is incorrect");
                    }
                    else
                    {
                        HelloRestaurant helloRestaurant = new HelloRestaurant(restaurante);
                        this.NavigationService.Navigate(helloRestaurant);
                    }
                }

                else
                {
                    MessageBox.Show("Unknown username");
                }
            }
        }
 public Pedido(UserRestaurante r)
 {
     _restauranteDoador = r;
 }