コード例 #1
0
        public CatQueue GetQueue(string QueueToSearch, string PCCToSearch, string connectionName)
        {
            Database  db        = DatabaseFactory.CreateDatabase(connectionName);
            DbCommand dbCommand = db.GetStoredProcCommand(Resources.CatQueueResources.SP_GetQueue);

            db.AddInParameter(dbCommand, Resources.CatQueueResources.PARAM_QUERY, DbType.String, QueueToSearch);
            db.AddInParameter(dbCommand, Resources.CatQueueResources.PARAM_QUERY2, DbType.String, PCCToSearch);

            CatQueue item = new CatQueue();

            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                int _agent = dr.GetOrdinal(Resources.CatQueueResources.PARAM_AGENT);
                int _queue = dr.GetOrdinal(Resources.CatQueueResources.PARAM_QUEUE);
                int _pcc   = dr.GetOrdinal(Resources.CatQueueResources.PARAM_PCC);

                if (dr.Read())
                {
                    item.Agent = (dr[_agent] == DBNull.Value) ? Types.StringNullValue : dr.GetString(_agent);
                    item.Queue = (dr[_queue] == DBNull.Value) ? Types.StringNullValue : dr.GetString(_queue);
                    item.PCC   = (dr[_pcc] == DBNull.Value) ? Types.StringNullValue : dr.GetString(_pcc);
                }
            }

            return(item);
        }
コード例 #2
0
        //Extrae el UserName y lo asigna, coloca el foco en el txt
        private void ucCreateFirm_Load(object sender, EventArgs e)
        {
            ucAvailability.IsInterJetProcess = false;
            string   agent = string.Empty;
            CatQueue item  = CatQueueBL.GetQueue(Login.Firm, Login.PCC);

            if (!string.IsNullOrEmpty(item.Agent))
            {
                agent = item.Agent;
            }
            txtAuthorization.Text = agent;
            txtNumberFirm.Focus();
            lbPCC.BringToFront();
            txtCodeAgent.Text  = GetAllFirmModulesForNewUserBL.GetAgent().AgentCode;
            txtNumberFirm.Text = GetAllFirmModulesForNewUserBL.GetFirm().FirmNumber;


            DialogResult result = MessageBox.Show("¿Este usuario utiliza queue genérica?", Resources.Constants.MYCTS, MessageBoxButtons.YesNo, MessageBoxIcon.Information);

            if (result.Equals(DialogResult.Yes))
            {
                txtQueue.Text = "152";
            }
            else
            {
                txtQueue.Text = GetAllFirmModulesForNewUserBL.GetQueue().QueueCode;
            }
        }
コード例 #3
0
        /// <summary>
        /// Se envia el comando de acuerdo a los campos ingresados
        /// </summary>
        private void CommandsSend()
        {
            string   agent = string.Empty;
            CatQueue item  = CatQueueBL.GetQueue(Login.Firm, Login.PCC);

            if (!string.IsNullOrEmpty(item.Agent))
            {
                agent = item.Agent;
            }
            if ((!string.IsNullOrEmpty(txtDateSelected.Text)) &&
                (!string.IsNullOrEmpty(txtSolicitorName.Text)) &&
                string.IsNullOrEmpty(txtComment.Text))
            {
                send = Resources.Constants.COMMANDS_7TAW +
                       txtDateSelected.Text + Resources.Constants.COMMANDS_SLASH_END_IT_6 +
                       txtSolicitorName.Text + Resources.Constants.SLASH + agent;
            }
            else if ((!string.IsNullOrEmpty(txtDateSelected.Text)) &&
                     (!string.IsNullOrEmpty(txtSolicitorName.Text)) &&
                     (!string.IsNullOrEmpty(txtComment.Text)))
            {
                send = Resources.Constants.COMMANDS_7TAW + txtDateSelected.Text +
                       Resources.Constants.SLASH + txtComment.Text +
                       Resources.Constants.COMMANDS_END_IT_6 +
                       txtSolicitorName.Text + Resources.Constants.SLASH + agent;
            }
            using (CommandsAPI objCommands = new CommandsAPI())
            {
                objCommands.SendReceive(send);
            }
            Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCSETS_MAP);
        }
コード例 #4
0
        private void ucEnableDisable_Load(object sender, EventArgs e)
        {
            ucAvailability.IsInterJetProcess = false;
            string   agent = string.Empty;
            CatQueue item  = CatQueueBL.GetQueue(Login.Firm, Login.PCC);

            if (!string.IsNullOrEmpty(item.Agent))
            {
                agent = item.Agent;
            }
            txtAuthorization.Text = agent;
            rdoAdd.Focus();
        }
コード例 #5
0
        //Extrae el UserName y lo coloca en autorización y coloca el foco en el txt
        private void ucChangeName_Load(object sender, EventArgs e)
        {
            ucAvailability.IsInterJetProcess = false;
            string   agent = string.Empty;
            CatQueue item  = CatQueueBL.GetQueue(Login.Firm, Login.PCC);

            if (!string.IsNullOrEmpty(item.Agent))
            {
                agent = item.Agent;
            }
            txtAuthorization.Text = agent;
            lbPCC.BringToFront();
            txtNumberFirm.Focus();
        }
コード例 #6
0
        private void CommandsSend()
        {
            string agent = string.Empty;


            CatQueue item = CatQueueBL.GetQueue(Login.Firm, Login.PCC);

            if (!string.IsNullOrEmpty(item.Agent))
            {
                agent = item.Agent;
            }

            send = string.Concat(Resources.Constants.COMMANDS_6_NAME,
                                 txtSolicitorName.Text.ToUpper() + Resources.Constants.SLASH + agent);
            using (CommandsAPI objCommands = new CommandsAPI())
            {
                objCommands.SendReceive(send);
            }
        }
コード例 #7
0
        public static CatQueue GetQueue(string QueueToSearch, string PCCToSearch)
        {
            CatQueue    item        = new CatQueue();
            CatQueueDAL objCatQueue = new CatQueueDAL();

            try
            {
                try
                {
                    item = objCatQueue.GetQueue(QueueToSearch, PCCToSearch, CommonENT.MYCTSDBSECURITY_CONNECTION);
                }
                catch (Exception ex)
                {
                    new EventsManager.EventsManager(ex, EventsManager.EventsManager.OrigenError.BaseDeDatos);
                    item = objCatQueue.GetQueue(QueueToSearch, PCCToSearch, CommonENT.MYCTSDBSECURITYBACKUP_CONNECTION);
                }
            }
            catch { }
            return(item);
        }
コード例 #8
0
        /// <summary>
        /// Se envia el comando de acuerdo a los campos ingresados
        /// </summary>
        private void CommandsSend()
        {
            string   agent = string.Empty;
            CatQueue item  = CatQueueBL.GetQueue(Login.Firm, Login.PCC);

            if (!string.IsNullOrEmpty(item.Agent))
            {
                agent = item.Agent;
            }
            if ((!string.IsNullOrEmpty(txtSolicitorName.Text)))
            {
                send = string.Concat(Resources.Constants.COMMANDS_6_NAME,
                                     txtSolicitorName.Text + Resources.Constants.SLASH + agent);
                using (CommandsAPI objCommands = new CommandsAPI())
                {
                    objCommands.SendReceive(send);
                }
            }
            else if ((!string.IsNullOrEmpty(txtPCC.Text)))
            {
                string extract;
                string send;
                extract = txtPCC.Text;
                extract = extract.Substring(0, 4);
                send    = string.Concat(Resources.Constants.COMMANDS_6CHANGE_TA_SLASH,
                                        extract + Resources.Constants.INDENT + agent);
                using (CommandsAPI objCommands = new CommandsAPI())
                {
                    objCommands.SendReceive(send);
                }
            }
            else if (!string.IsNullOrEmpty(txtGroups.Text))
            {
                send = string.Concat(Resources.Constants.COMMANDS_6_NAME,
                                     txtGroups.Text);
                using (CommandsAPI objCommands = new CommandsAPI())
                {
                    objCommands.SendReceive(send);
                }
            }
        }
コード例 #9
0
        /// <summary>
        /// Takes in a string of Animal Type that can be either Cat or Dog and a string Name.
        /// Creates a Node for that Animal and places it at the back of it's respective Queue.
        /// Affixes a Timestamp for Dequeue use.
        /// </summary>
        /// <param name="animal">Can be either Cat or Dog.  If anything else is specified no action is taken.</param>
        /// <param name="name">The Name to identify the Animal by.</param>
        public void Enqueue(string animal, string name)
        {
            if (animal.ToLower() != "cat" && animal.ToLower() != "dog")
            {
                return;
            }
            else
            {
                Int32         unixTimestamp = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds; // UTC Timestamp code found on Stack Overflow
                Node <string> node          = new Node <string>(animal, unixTimestamp, name);

                if (animal.ToLower() == "cat")
                {
                    CatQueue.Enqueue(node);
                }
                else
                {
                    DogQueue.Enqueue(node);
                }
            }
        }
コード例 #10
0
 /// <summary>
 /// Returns either a Cat or a Dog from the front of their respective Queues depending on what is prefered.
 /// If no preference is entered then the Animal that has been in the Queues the longest will be returned.
 /// </summary>
 /// <param name="pref">Dog, Cat or No Preference.</param>
 /// <returns>The Animal indicated by pref, or the Animal that has been in Queue the longest.</returns>
 public Node <string> Dequeue(string pref)
 {
     if (pref.ToLower() == "cat")
     {
         return(CatQueue.Dequeue());
     }
     else if (pref.ToLower() == "dog")
     {
         return(DogQueue.Dequeue());
     }
     else
     {
         if (CatQueue.Front.Timestamp >= DogQueue.Front.Timestamp)
         {
             return(CatQueue.Dequeue());
         }
         else
         {
             return(DogQueue.Dequeue());
         }
     }
 }
コード例 #11
0
        /// <summary>
        /// Envia el record localizador a la Queue del agente
        /// </summary>
        private void QueueAgent()
        {
            string send           = string.Empty;
            string queueAgent     = string.Empty;
            string queueClient    = string.Empty;
            string queueConsolid  = string.Empty;
            string queue          = string.Empty;
            string personalQueue  = string.Empty;
            string remarkConsolid = string.Empty;
            bool   haveQueue      = false;

            CatQueue item = CatQueueBL.GetQueue(Login.Firm, Login.PCC);

            if (!string.IsNullOrEmpty(item.Queue))
            {
                queue = item.Queue;

                queueAgent = string.Format(Resources.Constants.COMMANDS_QP_SLA_AGENT_SLA_11,
                                           queue);

                if (!string.IsNullOrEmpty(queue))
                {
                    haveQueue = true;
                }
                else
                {
                    haveQueue = false;
                }
            }

            List <DKTemp> listDKTemp = DKTempBL.GetDKTemp(ucFirstValidations.DK, true);

            if (!listDKTemp.Count.Equals(0))
            {
                if (activeStepsCorporativeQC.CorporativeQualityControls[0].Attribute1.StartsWith(Resources.TicketEmission.Constants.CONSOLID))
                {
                    if (ucTicketsEmissionInstructions.wayPayment.Equals(Resources.TicketEmission.Constants.PAYMENT_CASH) ||
                        ucTicketsEmissionInstructions.wayPayment.Equals(Resources.TicketEmission.Constants.PAYMENT_AMERICANEXPRESS))
                    {
                        queueClient   = listDKTemp[0].Queue;
                        personalQueue = string.Format(Resources.Constants.COMMANDS_CROSSLORAINE_CLIENT_SLA_11,
                                                      queueClient);

                        remarkConsolid = activeStepsCorporativeQC.CorporativeQualityControls[0].RemarkRobot;

                        if (!string.IsNullOrEmpty(remarkConsolid))
                        {
                            using (CommandsAPI objCommand = new CommandsAPI())
                            {
                                objCommand.SendReceive(remarkConsolid);
                            }
                        }
                    }
                    else if (ucTicketsEmissionInstructions.wayPayment.Equals(Resources.TicketEmission.Constants.PAYMENT_CREDITCARD))
                    {
                        queueClient   = listDKTemp[0].Queue2;
                        personalQueue = string.Format(Resources.Constants.COMMANDS_CROSSLORAINE_CLIENT_SLA_11,
                                                      queueClient);
                    }
                    else
                    {
                        personalQueue = string.Empty;
                    }
                }
                else
                {
                    queueClient   = listDKTemp[0].Queue;
                    personalQueue = string.Format(Resources.Constants.COMMANDS_CROSSLORAINE_CLIENT_SLA_11,
                                                  queueClient);
                }
            }


            if (haveQueue)
            {
                if (!string.IsNullOrEmpty(queueAgent) && !string.IsNullOrEmpty(queueClient))
                {
                    send = string.Empty;
                    send = string.Concat(queueAgent,
                                         personalQueue);
                    using (CommandsAPI objCommand = new CommandsAPI())
                    {
                        objCommand.SendReceive(send);
                    }
                }
                else if (!string.IsNullOrEmpty(queueAgent) && string.IsNullOrEmpty(queueClient))
                {
                    using (CommandsAPI objCommand = new CommandsAPI())
                    {
                        objCommand.SendReceive(queueAgent);
                    }
                }
            }
        }