Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            bool    x   = false;
            Cliente cli = new Cliente();

            if (numQ.Text.Length != 0 && codC.Text.Length != 0 && codH.Text.Length != 0)
            {
                cli.NumeroCliente = Int32.Parse(codC.Text);
                x = ControlaQuartos.EfetuarCheckIn(cli, Convert.ToDateTime(dataCheck.Text), Int32.Parse(numQ.Text), Int32.Parse(codH.Text));
            }
            else
            {
                MessageBox.Show("Campos por preencher!!!");
            }

            if (x == false)
            {
                MessageBox.Show("CheckIn efetuado!");
                this.Hide();
            }
            this.Close();
            m1 = new Thread(volta_Menu);
            m1.TrySetApartmentState(ApartmentState.STA);
            m1.Start();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            bool    x = false;
            Quarto  q = new Quarto();
            Cliente c = new Cliente();

            if (codH.Text.Length != 0 && numQ.Text.Length != 0 && numC.Text.Length != 0 && extra.Text.Length != 0)
            {
                c.NumeroCliente = Int32.Parse(numC.Text);
                q = new Quarto(c, Convert.ToDateTime(fimR.Text));
                x = ControlaQuartos.AddQuarto(q, Int32.Parse(numQ.Text), Int32.Parse(codH.Text));
            }
            else
            {
                MessageBox.Show("Campos por preencher!!!");
            }
            try
            {
                q = new Quarto(c, Convert.ToDateTime(fimR));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            if (x == false)
            {
                MessageBox.Show("Reserva ao quarto " + codH.Text + " adicionada!");
                this.Hide();
            }
            this.Close();
            m1 = new Thread(volta_Menu);
            m1.TrySetApartmentState(ApartmentState.STA);
            m1.Start();
        }
 private void button1_Click(object sender, EventArgs e)
 {
     if (codH.Text.Length != 0 && numQ.Text.Length != 0)
     {
         if (ControlaQuartos.RemoveQuarto(Int32.Parse(numQ.Text), Int32.Parse(codH.Text)) == Registo.Efetuado)
         {
             MessageBox.Show("O quarto foi removido com sucesso.");
         }
         else
         {
             MessageBox.Show("Quarto nao existe");
         }
     }
     else
     {
         MessageBox.Show("Campos por preencher!!!");
     }
     this.Close();
     m1 = new Thread(volta_Menu);
     m1.TrySetApartmentState(ApartmentState.STA);
     m1.Start();
 }
Esempio n. 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (numQ.Text.Length != 0 && codH.Text.Length != 0 && precoDia.Text.Length != 0)
            {
                MessageBox.Show("{0}", ControlaQuartos.EfetuaPagamento(Int32.Parse(numQ.Text), Int32.Parse(precoDia.Text), Int32.Parse(codH.Text)).ToString());
            }
            else
            {
                MessageBox.Show("Campos por preencher!!!");
            }

            /*
             * if (x == false)
             * {
             *  MessageBox.Show("Cliente " + nome.Text + " adicionado!");
             *  this.Hide();
             * }*/
            this.Close();
            m1 = new Thread(volta_Menu);
            m1.TrySetApartmentState(ApartmentState.STA);
            m1.Start();
        }