Esempio n. 1
0
        //Envía las instrucciones a MySabre
        private void CommandsSend()
        {
            int    row   = 0;
            int    col   = 0;
            string send  = string.Empty;
            string res   = string.Empty;
            string sabre = "QS/";


            send = string.Concat(sabre, txtPCC.Text, txtQueue.Text, "/D-", txtAgentCode.Text);
            using (CommandsAPI objCommand = new CommandsAPI())
            {
                res = objCommand.SendReceive(send);
            }
            CommandsQik.searchResponse(res, string.Concat("UPDATE PROCESSED"), ref row, ref col);
            if (row != 0 || col != 0)
            {
                if (AssignQueueFirmBL.AssignQueueFirm("152", txtAgentCode.Text, txtPCC.Text))
                {
                    UpdateStatusAllFirmModulesBL.UpdateUnassignStatusQueue(txtQueue.Text);
                    MessageBox.Show("QUEUE CANCELADA", Resources.Constants.MYCTS, MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("HA OCURRIDO UN ERROR AL ACTUALIZAR", Resources.Constants.MYCTS, MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show("ERROR EN LA CONEXIÓN CON MySABRE", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Se envia el comando de acuerdo a los campos ingresados
        /// </summary>
        private void CommandsSend()
        {
            User usuarioDto = null;

            usuarioDto = UserBL.GetUser(txtNumberFirm.Text, txtPCC.Text);


            if (rbnBoth.Checked)
            {
                int    row    = 0;
                int    col    = 0;
                string result = string.Empty;
                string sabre  = string.Empty;

                using (CommandsAPI objCommand = new CommandsAPI())
                {
                    objCommand.SendReceive(string.Concat("QMOV/", usuarioDto.PCC, usuarioDto.Queue, "/", usuarioDto.PCC, "152"));
                }

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

                    using (CommandsAPI objCommand = new CommandsAPI())
                    {
                        objCommand.SendReceive(send);
                        result = objCommand.SendReceive(sabre);
                    }

                    CommandsQik.searchResponse(result, "DONE", ref row, ref col);
                    if (row != 0 || col != 0)
                    {
                        send = string.Concat("QS/", txtPCC.Text, txtQueue.Text, "/D-", txtAgent.Text);
                        using (CommandsAPI objCommand = new CommandsAPI())
                        {
                            objCommand.SendReceive(send);
                        }

                        CommandsAPI2.send_MessageToEmulator(string.Concat(Resources.Reservations.FIRMA_ELIMINADA_EXITO));
                        //DeleteUsersBL.DeleteUsers(txtNumberFirm.Text, txtPCC.Text);
                        EnableDisableFirmBL.EnableDisableFirm(txtNumberFirm.Text, txtPCC.Text, 2);
                        Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
                        MessageBox.Show(Resources.Reservations.FIRMA_FUE_ELIMINADA_EXITO, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show(Resources.Reservations.PRESENTO_ERROR, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        using (CommandsAPI objCommand = new CommandsAPI())
                        {
                            objCommand.SendReceive("I");
                        }
                    }
                }

                if (!string.IsNullOrEmpty(usuarioDto.Firm))
                {
                    UpdateStatusAllFirmModulesBL.UpdateUnassignStatusTA(usuarioDto.TA);
                    UpdateStatusAllFirmModulesBL.UpdateUnassignStatusQueue(usuarioDto.Queue);
                    UpdateStatusAllFirmModulesBL.UpdateUnassignStatusAgent(usuarioDto.Agent);
                    //UpdateStatusAllFirmModulesBL.UpdateUnassignStatusFirm(usuarioDto.Firm);
                }
                MessageBox.Show("FIRMA ELIMINADA CORRECTAMENTE", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }


            if (rbnMyCTS.Checked)
            {
                using (CommandsAPI objCommand = new CommandsAPI())
                {
                    objCommand.SendReceive(string.Concat("QMOV/", usuarioDto.PCC, usuarioDto.Queue, "/", usuarioDto.PCC, " 152"));
                }
                //DeleteUsersBL.DeleteUsers(txtNumberFirm.Text, txtPCC.Text);
                EnableDisableFirmBL.EnableDisableFirm(txtNumberFirm.Text, txtPCC.Text, 2);
                if (!string.IsNullOrEmpty(usuarioDto.Firm))
                {
                    UpdateStatusAllFirmModulesBL.UpdateUnassignStatusTA(usuarioDto.TA);
                    UpdateStatusAllFirmModulesBL.UpdateUnassignStatusQueue(usuarioDto.Queue);
                    UpdateStatusAllFirmModulesBL.UpdateUnassignStatusAgent(usuarioDto.Agent);
                    //UpdateStatusAllFirmModulesBL.UpdateUnassignStatusFirm(usuarioDto.Firm);
                }
                MessageBox.Show("LA FIRMA FUE ELIMINADA CON ÉXITO DE MyCTS", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
            }


            if (rbnSabre.Checked)
            {
                int    row    = 0;
                int    col    = 0;
                string result = string.Empty;
                string sabre  = string.Empty;

                using (CommandsAPI objCommand = new CommandsAPI())
                {
                    objCommand.SendReceive(string.Concat("QMOV/", usuarioDto.PCC, usuarioDto.Queue, "/", usuarioDto.PCC, " 152"));
                }

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

                    using (CommandsAPI objCommand = new CommandsAPI())
                    {
                        objCommand.SendReceive(send);
                        result = objCommand.SendReceive(sabre);
                    }

                    CommandsQik.searchResponse(result, "DONE", ref row, ref col);
                    if (row != 0 || col != 0)
                    {
                        send = string.Concat("QS/", txtPCC.Text, txtQueue.Text, "/D-", txtAgent.Text);
                        using (CommandsAPI objCommand = new CommandsAPI())
                        {
                            objCommand.SendReceive(send);
                        }

                        CommandsAPI2.send_MessageToEmulator(string.Concat(Resources.Reservations.FIRMA_ELIMINADA_EXITO));
                        Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
                    }
                    else
                    {
                        MessageBox.Show(Resources.Reservations.PRESENTO_ERROR, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        using (CommandsAPI objCommand = new CommandsAPI())
                        {
                            objCommand.SendReceive("I");
                        }
                    }
                }
                MessageBox.Show("FIRMA ELIMINADA CORRECTAMENTE", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }