Beispiel #1
0
        private void frmErrorMessages_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (frmErrorMessages.RowCount > 0)
            {
                int value = Int32.Parse(frmErrorMessages.Rows[e.RowIndex].Cells[0].Value.ToString());
                //if (value != null)
                //{
                //lblAuditMessages.Text = "";

                lblAuditMessages.Text = "Audit messages for Request: " + value.ToString();
                WeiMonitoringClient client = new WeiMonitoringClient();
                if (client != null)
                {
                    Telavance.AdvantageSuite.Wei.WeiService.AuditMessages[] values = client.getAuditMessages(value);

                    if (values != null)
                    {
                        if (frmAuditMessages.Rows.Count > 0)
                        {
                            frmAuditMessages.DataSource = null;
                        }



                        frmAuditMessages.AutoGenerateColumns = false;

                        BindingSource bindingSource = new BindingSource();
                        bindingSource.DataSource    = values;
                        frmAuditMessages.DataSource = bindingSource;
                    }
                }
                //}
            }
        }
Beispiel #2
0
        private void btnProcess_Click(object sender, EventArgs e)
        {
            try
            {
                int requestID;
                if (frmErrorMessages.RowCount > 0)
                {
                    WeiMonitoringClient client = new WeiMonitoringClient();
                    if (client != null)
                    {
                        for (int iRow = 0; iRow < frmErrorMessages.Rows.Count; iRow++)
                        {
                            requestID = Convert.ToInt32(frmErrorMessages.Rows[iRow].Cells[0].Value.ToString());
                            client.reprocess(requestID);
                        }
                        //Refresh the grid after the messages were reprocessed. Only the messages that failed the reprocessing
                        // will be populated.

                        PopulateGridWithErrorMessages();
                    }
                }
            }
            catch (FaultException ex)
            {
                throw (ex);
            }
        }
Beispiel #3
0
        void PopulateGridWithErrorMessages()
        {
            try
            {
                WeiMonitoringClient client = new WeiMonitoringClient();
                if (client != null)
                {
                    Telavance.AdvantageSuite.Wei.WeiService.Request[] values = client.getAllErrors(_intefaceID);



                    if (values != null)
                    {
                        if (frmErrorMessages.Rows.Count > 0)
                        {
                            frmErrorMessages.DataSource = null;
                        }

                        BindingSource bindingSource = new BindingSource();
                        bindingSource.DataSource             = values;
                        frmErrorMessages.AutoGenerateColumns = false;
                        frmErrorMessages.DataSource          = bindingSource;
                        frmErrorMessages.AutoSize            = true;
                    }
                }
            }
            catch (FaultException e)
            {
                MessageBox.Show(e.ToString());
            }
        }
        protected void btnProcessError_Click(object sender, EventArgs e)
        {
            string requestID;

            try
            {
                if (grdShowMessages.Rows.Count > 0)
                {
                    WeiMonitoringClient client = new WeiMonitoringClient();
                    if (client != null)
                    {
                        for (int iRow = 0; iRow < grdShowMessages.Rows.Count; iRow++)
                        {
                            GridViewRow row       = grdShowMessages.Rows[iRow];
                            bool        isChecked = ((CheckBox)row.FindControl("chkSelectRecord")).Checked;
                            if (isChecked)
                            {
                                requestID = row.Cells[1].Text;
                                if (_dbUtils.AddAuditForErrorProcess(Int32.Parse(requestID), "Test"))
                                {
                                    client.reprocess(Int32.Parse(requestID));
                                }
                                ViewState["ProcessError"] = "false";
                            }
                        }
                    }
                }

                populateGridView();
            }
            catch (Exception ex)
            {
                throw(ex);
            }
        }
Beispiel #5
0
        private void refresh()
        {
            frmInterfaceGrid.Rows.Clear();
            WeiMonitoringClient client = new WeiMonitoringClient();

            try
            {
                if (client != null)
                {
                    InterfaceStatus[] interfaceStatus = client.getInterfaces();

                    for (int i = 0; i < interfaceStatus.Length; i++)
                    {
                        string[] row = new string[] { "" + interfaceStatus[i].InterfaceId, interfaceStatus[i].InterfaceName, interfaceStatus[i].Status.ToString() };
                        frmInterfaceGrid.Rows.Add(row);
                    }
                }
            }
            catch (Exception ex)
            {
                frmInterfaceGrid.Rows.Clear();
                StatusLabel.Text = "WEI Service is not currently running";
                //LogUtil.log("", ex.InnerException);
            }
            finally
            {
            }
        }
        private void btnGracefulShutdown_Click(object sender, EventArgs e)
        {
            try
            {
                WeiMonitoringClient client = new WeiMonitoringClient();
                client.ShutdownGracefully();

                // Use the 'client' variable to call operations on the service.

                // Always close the client.
                client.Close();
            }
            catch (CommunicationException ex)
            {
                frmInterfaceGrid.Rows.Clear();
                //MessageBox.Show("Service is not running now!");
                StatusLabel.Text = "Service is not running.";
            }
        }
Beispiel #7
0
        private void btnForceShutdown_Click(object sender, EventArgs e)
        {
            try
            {
                ServiceController service = new ServiceController(serviceName);
                switch (service.Status)
                {
                case ServiceControllerStatus.Running:
                    string       message = null;
                    DialogResult dresult;
                    message = "Do you want to forcefully shutdown the service?. Any messages in the queues that are currently being processed may be lost.";
                    dresult = MessageBox.Show(message, "Warning!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);

                    if (dresult == DialogResult.OK)
                    {
                        WeiMonitoringClient client = new WeiMonitoringClient();
                        if (client != null)
                        {
                            client.forceShutdown();

                            // Use the 'client' variable to call operations on the service.

                            // Always close the client.
                            client.Close();
                            StatusLabel.Text = "WEI Service was forecefully shutdown.";
                        }
                    }
                    break;

                default:
                    StatusLabel.Text = "WEI Service stopped.";
                    break;
                }
            }
            catch (Exception ex)
            {
                frmInterfaceGrid.Rows.Clear();
                //MessageBox.Show("Service is not running now!");
                StatusLabel.Text = "WEI Service is not currently running";
                //LogUtil.log("", ex.InnerException);
            }
        }
        private void refresh()
        {
            frmInterfaceGrid.Rows.Clear();
            try
            {
                WeiMonitoringClient client          = new WeiMonitoringClient();
                InterfaceStatus[]   interfaceStatus = client.getInterfaces();

                for (int i = 0; i < interfaceStatus.Length; i++)
                {
                    string[] row = new string[] { "" + interfaceStatus[i].InterfaceId, interfaceStatus[i].InterfaceName, interfaceStatus[i].Status.ToString() };
                    frmInterfaceGrid.Rows.Add(row);
                }
            }
            catch (CommunicationException ex)
            {
                frmInterfaceGrid.Rows.Clear();
                //MessageBox.Show("Service is not running now!");
                StatusLabel.Text = "Service is not currently running";
            }
        }
        private void frmInterfaceGrid_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (frmInterfaceGrid.RowCount > 0)
            {
                if (e.ColumnIndex == 3)
                {
                    string message = "Unable to get message statistics";
                    object value   = frmInterfaceGrid.Rows[e.RowIndex].Cells[0].Value;

                    WeiMonitoringClient client = new WeiMonitoringClient();
                    message = client.getStatistics(int.Parse(value.ToString()));

                    // Use the 'client' variable to call operations on the service.

                    // Always close the client.
                    client.Close();
                    MessageBox.Show(message);
                    //StatusLabel.Text = message;
                }
            }
        }
Beispiel #10
0
        private void frmInterfaceGrid_CellContentClick_1(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (frmInterfaceGrid.RowCount > 0)
                {
                    if (e.ColumnIndex == 3)
                    {
                        string message = "Unable to get message statistics";
                        object value   = frmInterfaceGrid.Rows[e.RowIndex].Cells[0].Value;

                        WeiMonitoringClient client = new WeiMonitoringClient();
                        if (client != null)
                        {
                            message = client.getStatistics(int.Parse(value.ToString()));
                            // Use the 'client' variable to call operations on the service.

                            // Always close the client.
                            client.Close();
                            MessageBox.Show(message);
                        }
                    }
                    if (e.ColumnIndex == 4)
                    {
                        //Application.Run(new ShowRequestsWithErrors());
                        //ShowRequestsWithErrors.ActiveForm.ShowDialog();
                        int _interfaceID;
                        _interfaceID = Int32.Parse(frmInterfaceGrid.Rows[e.RowIndex].Cells[0].Value.ToString());
                        ShowRequestsWithErrors newForm = new ShowRequestsWithErrors(_interfaceID);
                        newForm.ShowDialog();
                    }
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
            }
        }