Пример #1
0
        /// <summary>
        /// Bouton Shutdown
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnResetSelected_Click(object sender, EventArgs e)
        {
            EntityFactory ef = new EntityFactory();

            //TODO Mettre une confirmation JS
            //if (MessageBox.Show("Confirmer le SHUTDOWN sur ces applications?", "Confirmation", MessageBoxButtons.YesNo) == DialogResult.Yes)
            //{
                List<string> applicationsName = new List<string>();

                //== Crée la liste des applications à arrêter
                for (int i = 0; i < gvComApp.Rows.Count; i++)
                {
                    CheckBox chbTemp = (CheckBox)gvComApp.Rows[i].FindControl("chkSelect");

                    if (chbTemp.Checked)
                    {
                        applicationsName.Add(gvComApp.Rows[i].Cells[1].Text);
                    }

                }

                //=== Arret des applications sélectionnées
                bool shutdowmCompleted = ef.ShutDownCOMApplication(applicationsName);

                //=== Si réussi on affiche un msg d'erreur
                if (shutdowmCompleted)
                {
                    StringBuilder cs = new StringBuilder();
                    cs.Append("alert('Les applications ont été arrêté.');");
                    ClientScript.RegisterStartupScript(GetType(),"msgConfirmation", cs.ToString(), true);
                }

            RefreshLstComApp();
        }
Пример #2
0
        /// <summary>
        /// ShutDown des Com
        /// </summary>
        /// <param name="applicationsName">Si Null on Kill tous les COM</param>
        private bool ShutDownCOMApplication(IList applicationsName)
        {
            bool shutdowmCompleted = false;

            //TODO === Affiche un msg durant l'éxecution

            EntityFactory ef = new EntityFactory();
            try
            {
                //=== Shutdown de tous
                if (applicationsName == null)
                {
                    shutdowmCompleted = ef.ShutDownAllCOMApplication();
                }
                else
                {
                    shutdowmCompleted = ef.ShutDownCOMApplication(applicationsName);
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            return shutdowmCompleted;
        }
Пример #3
0
 /// <summary>
 /// Rafraichissement de la liste
 /// </summary>
 private void RefreshLstComApp()
 {
     //Si la valeur du refresh n'est pas null, pour blinder
     if (!String.IsNullOrEmpty(txtMinHangTime.Text))
     {
         EntityFactory comH = new EntityFactory();
         gvComApp.DataSource = comH.GetCOMs(long.Parse(txtMinHangTime.Text));
         gvComApp.DataBind();
     }
 }
Пример #4
0
        /// <summary>
        /// Rafraichissement de la liste
        /// </summary>
        private void RefreshLstComApp()
        {
            //Si la valeur du refresh n'est pas null, pour blinder
            if (!String.IsNullOrEmpty(txtMinHangTime.Text))
            {

                //lstComApp.Clear();
                lstComApp.Items.Clear();

                EntityFactory comH = new EntityFactory();

                //=== Peuple la liste
                int i = 0;
                foreach (ComApp com in comH.GetCOMs(long.Parse(txtMinHangTime.Text)))
                {
                    ListViewItem itm = new ListViewItem(new string[] { com.ApplicationName, com.NbClass.ToString(), com.TotalResponseTime.ToString(), com.TotalInCall.ToString() });
                    lstComApp.Items.Add(itm);

                    //com.MinHangTime = long.Parse(txtMinHangTime.Text);

                    //=== Si l'application est considérer gelé on affiche la ligne en rouge
                    if (com.isHang) lstComApp.Items[i].BackColor = Color.Red;
                    i++;
                }
            }
        }