public void AddToolsOnlineQueues(AddToolsOnlineQueues queue, string connectionName)
        {
            Database  db       = DatabaseFactory.CreateDatabase(connectionName);
            DbCommand dbcomand = db.GetStoredProcCommand(Resources.AddToolsOnlineQueuesResources.SP_AddToolOnlineQueues);

            db.AddInParameter(dbcomand, Resources.AddToolsOnlineQueuesResources.PARAM_QUEUES, DbType.Int32, queue.Queue);
            db.AddInParameter(dbcomand, Resources.AddToolsOnlineQueuesResources.PARAM_PCC, DbType.String, queue.PCC);
            db.AddInParameter(dbcomand, Resources.AddToolsOnlineQueuesResources.PARAM_PICCODE, DbType.Int32, queue.PicCode);
            db.AddInParameter(dbcomand, Resources.AddToolsOnlineQueuesResources.PARAM_DESCRIPTION, DbType.String, queue.Descripcion);
            db.ExecuteNonQuery(dbcomand);
        }
        public static void AddToolsOnlineQueues(AddToolsOnlineQueues queue)
        {
            AddToolsOnlineQueuesDAL objQueues = new AddToolsOnlineQueuesDAL();

            try
            {
                try
                {
                    objQueues.AddToolsOnlineQueues(queue, CommonENT.MYCTSDB_CONNECTION);
                }
                catch (Exception ex)
                {
                    new EventsManager.EventsManager(ex, EventsManager.EventsManager.OrigenError.BaseDeDatos);
                    objQueues.AddToolsOnlineQueues(queue, CommonENT.MYCTSDBBACKUP_CONNECTION);
                }
            }
            catch
            { }
        }
        //Agrega los datos de la nueva Queue
        private void btnAccept_Click(object sender, EventArgs e)
        {
            if (chkDelete1.Checked == false && chkDelete2.Checked == false && chkDelete3.Checked == false && chkDelete4.Checked == false && chkDelete5.Checked == false &&
                Validation)
            {
                AddToolsOnlineQueues queueOnline = new AddToolsOnlineQueues();

                if (txtName3.Text != string.Empty)
                {
                    queueOnline.Descripcion = txtName3.Text;
                    queueOnline.Queue       = Convert.ToInt32(txtQueue3.Text);
                    queueOnline.PCC         = ((ListItem)cmbPCC3.SelectedItem).Value;
                    queueOnline.PicCode     = Convert.ToInt32(((ListItem)cmbPicCode3.SelectedItem).Value);
                }
                else if (txtName4.Text != string.Empty)
                {
                    queueOnline.Descripcion = txtName4.Text;
                    queueOnline.Queue       = Convert.ToInt32(txtQueue4.Text);
                    queueOnline.PCC         = ((ListItem)cmbPCC4.SelectedItem).Value;
                    queueOnline.PicCode     = Convert.ToInt32(((ListItem)cmbPicCode4.SelectedItem).Value);
                }
                else if (txtName5.Text != string.Empty)
                {
                    queueOnline.Descripcion = txtName5.Text;
                    queueOnline.Queue       = Convert.ToInt32(txtQueue5.Text);
                    queueOnline.PCC         = ((ListItem)cmbPCC5.SelectedItem).Value;
                    queueOnline.PicCode     = Convert.ToInt32(((ListItem)cmbPicCode5.SelectedItem).Value);
                }
                try
                {
                    if (!string.IsNullOrEmpty(queueOnline.Descripcion) && !string.IsNullOrEmpty(queueOnline.PCC) &&
                        !string.IsNullOrEmpty(queueOnline.PicCode.ToString()) && !string.IsNullOrEmpty(queueOnline.Queue.ToString()))
                    {
                        AddToolsOnlineQueuesBL.AddToolsOnlineQueues(queueOnline);
                        MessageBox.Show(Resources.Constants.ALTA_QUEUE_ADMIN, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            else
            {
                DeleteToolOnlineQueues delete = new DeleteToolOnlineQueues();
                if (chkDelete1.Checked)
                {
                    delete.Description = lblName1.Text;
                }
                else if (chkDelete2.Checked)
                {
                    delete.Description = lblName2.Text;
                }
                else if (chkDelete3.Checked)
                {
                    delete.Description = lblName3.Text;
                }
                else if (chkDelete4.Checked)
                {
                    delete.Description = lblName4.Text;
                }
                else if (chkDelete5.Checked)
                {
                    delete.Description = lblName5.Text;
                }
                DeleteToolOnlineQueuesBL.DeleteToolOnlineQueues(delete.Description);
                MessageBox.Show(Resources.Constants.ELIMINACION_SOLICITADA_SATISFACTORIA, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
            }
        }