Example #1
0
        private string obtieneNombreIP(string hostname)
        {
            string ipName = "";
            // obtengo el nombre de la ip para la impresora con la que se va a imprimir
            UConnection DB  = new UConnection(ConfigurationManager.AppSettings.Get("ipBD"), ConfigurationManager.AppSettings.Get("serverBD"), ConfigurationManager.AppSettings.Get("usuarioBD"), ConfigurationManager.AppSettings.Get("passBD"));
            string      sql = "select SU_IMPRESORA from FRSALIDA_IMPNAME where SU_NAME = '" + hostname + "' and SU_TIPO = 'PASE'";

            try
            {
                if (DB.EjecutaSQL(sql))
                {
                    while (DB.ora_DataReader.Read())
                    {
                        ipName = Convert.ToString(DB.ora_DataReader["SU_IMPRESORA"]);
                    }
                }
            }
            catch (Exception ex)
            {
                //MessageBox.Show("OCURRIÓ UN ERROR AL TRATAR DE OBTENER LA IMPRESORA PARA EL VOUCHER." + ex.Message, "FAVOR DE REPORTARLO A SU ÁREA DE SISTEMAS");
            }
            finally
            {
                DB.Dispose();
            }
            return(ipName);
        }
Example #2
0
        protected void btnEnviar_Click(object sender, EventArgs e)
        {
            lblaviso.Text = "";
            if (txtBrazalete.Text == "")
            {
                //Mensaje segun idioma
                if (lang)
                {
                    ShowNotification("Bracelet empty", "Please, you must enter the bracelet number to check out.", NotificationType.info);
                }
                else
                {
                    ShowNotification("Brazalete vacio", "Debe ingresar su numero de brazalete para poder realizar el check out.", NotificationType.info);
                }
                Timer1.Enabled = true;
                return;
            }
            if (txthabi.Text == "")
            {
                //Mensaje segun idioma
                if (lang)
                {
                    ShowNotification("Room empty", "Please, you must enter the room number to check out.", NotificationType.info);
                }
                else
                {
                    ShowNotification("Habitacion vacio", "Debe ingresar su numero de habitación para poder realizar el check out.", NotificationType.info);
                }
                Timer1.Enabled = true;
                return;
            }
            if (txthabi.Text.Length > 6)
            {
                //Mensaje segun idioma
                if (lang)
                {
                    ShowNotification("Too many chars in room field", "Please, verify.", NotificationType.info);
                }
                else
                {
                    ShowNotification("Habitacion no existe", "Favor de verificar.", NotificationType.info);
                }
                Timer1.Enabled = true;
                return;
            }
            // reviso fechas de contabilidad, check out y actual
            // obtengo la fecha de contabilidad
            fecCont = obtenerFechaContabilidad();
            DateTime Hoy = DateTime.Today;

            fecha_actual = Hoy.ToString("dd-MM-yyyy");
            fecha_cont   = fecCont.ToString("dd-MM-yyyy");
            // si es diferente la fecha de hoy contra la de la contabilidad, no pasa
            if (fecha_actual != fecha_cont)
            {
                if (lang)
                {
                    ShowNotification("System problem", "Please go to the front desk.", NotificationType.error);
                }
                else
                {
                    ShowNotification("Error en sistema", "Favor de ir a recepción.", NotificationType.error);
                }
                DB.Dispose();
                Timer1.Enabled = true;
                return;
            }

            // obtengo el numero de reservacion por medio del brazalete
            obtenerReservaPorBrazalete();
            int cbr = arrbr.Count;

            if (cbr == 0)
            {
                if (lang)
                {
                    ShowNotification("Bracelet not found", "Please verify the bracelet number and try again.", NotificationType.error);
                }
                else
                {
                    ShowNotification("Bracelete no encontrado", "Por favor verifique el numero de brazalete e intentelo de nuevo.", NotificationType.error);
                }
                DB.Dispose();
                Timer1.Enabled = true;
            }
            else if (cbr == 1)
            {
                reserva = ((BrazaR)arrbr[0]).Reserva;
                ViewState["reserva"] = reserva;
                validacionesCheckout();
            }
            else
            {
                if (lang)
                {
                    ShowNotification("Select your reservation", "Please, select you reservation based on the register name and room .", NotificationType.info);
                }
                else
                {
                    ShowNotification("Seleccione su reservación", "Por favor seleccione su reserva basandose en el nombre registrado y la habitación.", NotificationType.info);
                }
                ArraytoGrid();
                mpePopUp.Show();
            }
        }