예제 #1
0
 private void buttonCharge_Click(object sender, EventArgs e)
 {
     if (comboBoxTypePay.Text != String.Empty)
     {
         String typePay = comboBoxTypePay.Text;
         Int32  numberCard;
         if (typePay.ToUpper() == "EFECTIVO")
         {
             numberCard = 0;
         }
         else
         {
             Boolean isValid = Validaciones.validAndRequiredInt32MoreThan0(textBoxCardNumber.Text,
                                                                           "El numero de tarjeta de credito debe ser numerico y mayor a 0");
             if (isValid)
             {
                 numberCard = Convert.ToInt32(textBoxCardNumber.Text);
             }
             else
             {
                 return;
             }
         }
         ChargeStayHelper.charge(stayId, clientId, typePay, numberCard);
         MessageBox.Show("Se facturo correctamente la estadia: " + stayId, "", MessageBoxButtons.OK, MessageBoxIcon.Information);
         this.closeWindow();
     }
     else
     {
         MessageBox.Show("Debe seleccionar un tipo de pago", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #2
0
        private void loadCharge()
        {
            ChargeStayHelper.loadCharge(stayId, dgvChargeDetail);
            Double total = 0D;

            foreach (DataGridViewRow row in dgvChargeDetail.Rows)
            {
                Int32  count  = Convert.ToInt32(row.Cells[1].Value);
                Double charge = Convert.ToDouble(row.Cells[2].Value);

                total += (count * charge);
            }

            textBoxTotalCharge.Text = total.ToString();
        }
        private void buttonSearch_Click(object sender, EventArgs e)
        {
            if (textBoxBooking.Text == String.Empty)
            {
                MessageBox.Show("Debe ingresar un numero de reserva a facturar");
                return;
            }

            Int32 bookingId = Convert.ToInt32(textBoxBooking.Text);

            ChargeStayHelper.search(bookingId, dgvStay);

            buttonCharge.Enabled = false;
            if (dgvStay.RowCount < 1)
            {
                StayStatus status = ChargeStayHelper.getStatus(bookingId);
                showMessage(status);
            }
            else
            {
                buttonCharge.Enabled = true;
            }
        }