/// <summary>
        /// Se envia el comando de acuerdo a los campos ingresados
        /// </summary>
        private void CommandsSend()
        {
            int    row         = 0;
            int    col         = 0;
            string result      = string.Empty;
            string sabre       = string.Empty;
            string change      = string.Empty;
            bool   notcontinue = false;

            string send = string.Concat("HB", txtNumberFirm.Text);

            sabre  = string.Concat("H/AUTH BY ", txtAuthorization.Text);
            change = string.Concat("HH/A", txtAgentCode.Text);
            using (CommandsAPI objCommand = new CommandsAPI())
            {
                result = objCommand.SendReceive(send);
            }
            CommandsQik.searchResponse(result, "NEW EMPLOYEE", ref row, ref col);
            if (row != 0 || col != 0)
            {
                using (CommandsAPI objCommand = new CommandsAPI())
                {
                    objCommand.SendReceive("I");
                }
                MessageBox.Show(Resources.Reservations.LA_FIRMA_NO_EXISTE, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                notcontinue = true;
            }

            if (!notcontinue)
            {
                using (CommandsAPI objCommand = new CommandsAPI())
                {
                    objCommand.SendReceive(sabre);
                    result = objCommand.SendReceive(change);
                }


                CommandsQik.searchResponse(result, "DUP", ref row, ref col);
                if (row != 0 || col != 0)
                {
                    row = 0;
                    col = 0;
                    MessageBox.Show(Resources.Reservations.INICIALES_YA_EXISTEN_INGRESE_OTRAS, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                CommandsQik.searchResponse(result, "DONE", ref row, ref col);
                if (row != 0 || col != 0)
                {
                    using (CommandsAPI objCommand = new CommandsAPI())
                    {
                        objCommand.SendReceive("I");
                    }
                    CommandsAPI2.send_MessageToEmulator(string.Concat(Resources.Reservations.CODIGO_CAMBIADO_CON_EXITO));
                    UpdateUsersBL.UpdateUsers(txtNumberFirm.Text, txtPCC.Text, txtAgentCode.Text, null, null);
                    MessageBox.Show(Resources.Reservations.CAMBIO_CODIGO_AGENTE_EXITOSO, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
                }
            }
        }
Example #2
0
        /// <summary>
        /// Se envia el comando de acuerdo a los campos ingresados
        /// </summary>
        private void CommandsSend()
        {
            int    row    = 0;
            int    col    = 0;
            string result = string.Empty;
            string sabre  = string.Empty;
            string change = string.Empty;
            string name   = string.Empty;

            string send = string.Concat("HB", txtNumberFirm.Text);

            using (CommandsAPI objCommand = new CommandsAPI())
            {
                result = objCommand.SendReceive(send);
            }
            CommandsQik.searchResponse(result, "NOT ALLOWED IN", ref row, ref col);
            if (row != 0 || col != 0)
            {
                using (CommandsAPI objCommand = new CommandsAPI())
                {
                    objCommand.SendReceive("I");
                    result = objCommand.SendReceive(send);
                }
                CommandsQik.searchResponse(result, "NEW EMPLOYEE", ref row, ref col);
                if (row != 0 || col != 0)
                {
                    MessageBox.Show(Resources.Reservations.LA_FIRMA_NO_EXISTE, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            CommandsQik.searchResponse(result, "NEW EMPLOYEE", ref row, ref col);
            if (row != 0 || col != 0)
            {
                using (CommandsAPI objCommand = new CommandsAPI())
                {
                    objCommand.SendReceive("I");
                }
                MessageBox.Show(Resources.Reservations.LA_FIRMA_NO_EXISTE, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                row    = 0;
                col    = 0;
                send   = string.Empty;
                send   = string.Concat("H/AUTH BY ", txtAuthorization.Text);
                sabre  = string.Concat("H/NAM@", txtLastName.Text, "/", txtInitial.Text);
                change = string.Concat("HE");

                using (CommandsAPI objCommand = new CommandsAPI())
                {
                    objCommand.SendReceive(send);
                    objCommand.SendReceive(sabre);
                    objCommand.SendReceive(change);
                    objCommand.SendReceive("I");
                }
                CommandsAPI2.send_MessageToEmulator(string.Concat(Resources.Reservations.CAMBIO_NOMBRE_SABRE_EXITOSO));
                name = string.Concat(txtInitial.Text, " ", txtLastName.Text);
                UpdateUsersBL.UpdateUsers(txtNumberFirm.Text, txtPCC.Text, null, name, name.ToLower());
                MessageBox.Show(Resources.Reservations.CAMBIO_NOMBRE_EXITOSO, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
            }
        }