Beispiel #1
0
        bool ClearEvents(string clearType, string eventType, int eventNo)
        {
            try
            {
                LogManager.WriteLog("Inside Method", LogManager.enumLogLevel.Info);

                IEventDetails objCDO = EventsBusinessObject.CreateInstance();

                if (objCDO.UpdateEventDetails(clearType, eventType, eventNo, installationNo))
                {
                    LogManager.WriteLog("Event(s) cleared successfully", LogManager.enumLogLevel.Info);
                    return(true);
                }
                else
                {
                    LogManager.WriteLog("Unable to clear event(s)", LogManager.enumLogLevel.Error);
                    return(false);
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
                return(false);
            }
        }
Beispiel #2
0
        void FillEventsDataForPosition()
        {
            IEventDetails objCDO = EventsBusinessObject.CreateInstance();

            lstPositionDetailsEvents.DataContext = null;

            txtPageNo.Text = "";

            dtEventDetails = objCDO.GetEventDetails(dtStartDate, dtEndDate, BarPosName, Convert.ToInt32(chkShowClearedEvents.IsChecked == true ? 1 : 0), cmbEventType.SelectedItem.ToString(), iPageSize, cmbLegalEvent.SelectedIndex);

            if (dtEventDetails.Rows.Count > 0)
            {
                iLastPage = Convert.ToInt32(dtEventDetails.Rows[dtEventDetails.Rows.Count - 1]["Page"]);
                if (iPageNum > iLastPage)
                {
                    iPageNum = iLastPage;
                }
                PopulateEventsListView();
            }
            else
            {
                if (bRefresh)
                {
                    MessageBox.ShowBox("MessageID37", BMC_Icon.Information);
                    bRefresh = false;
                }
            }
        }
Beispiel #3
0
        void FillEventTypeComboList()
        {
            IEventDetails objCDO        = EventsBusinessObject.CreateInstance();
            string        strEventTypes = string.Empty;

            string[] strList;

            strEventTypes = objCDO.FillEventType();
            strEventTypes = "All," + strEventTypes;
            strList       = strEventTypes.Split(',');
            Array.Sort(strList);
            cmbEventType.DataContext   = strList;
            cmbEventType.ItemsSource   = strList;
            cmbEventType.DataContext   = strList;
            cmbEventType.SelectedIndex = 0;

            string[] _lstLegalTypes = { "All", "Legal", "Illegal" };

            cmbLegalEvent.ItemsSource = _lstLegalTypes;
            cmbLegalEvent.DataContext = _lstLegalTypes;

            cmbLegalEvent.SelectedIndex = 0;
        }
Beispiel #4
0
        private void btnClearSite_Click(object sender, RoutedEventArgs e)
        {
            IEventDetails objCDO = EventsBusinessObject.CreateInstance();

            try
            {
                btnClearSite.IsEnabled = false;
                LogManager.WriteLog("Inside Method", LogManager.enumLogLevel.Info);


                bool unclearedEvents = objCDO.CheckForUnclearedEvents();
                if (unclearedEvents)
                {
                    MessageBox.ShowBox("MessageID896", BMC_Icon.Information);
                    return;
                }

                if (MessageBox.ShowBox("MessageID232", BMC_Icon.Question, BMC_Button.YesNo) == System.Windows.Forms.DialogResult.No)
                {
                    return;
                }

                if (ClearEvents("SITE", string.Empty, 0))
                {
                    MessageBox.ShowBox("MessageID227", BMC_Icon.Information);

                    AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History
                    {
                        AuditModuleName    = ModuleName.Events,
                        Audit_Screen_Name  = "Events|ClearSite",
                        Audit_Desc         = "Clear Site",
                        AuditOperationType = OperationType.MODIFY,
                        Audit_Field        = "Event Number(s)",
                        Audit_Old_Vl       = "Open Events",
                        Audit_New_Vl       = "Closed"
                    });
                }
                else
                {
                    MessageBox.ShowBox("MessageID228", BMC_Icon.Error);

                    AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History
                    {
                        AuditModuleName    = ModuleName.Events,
                        Audit_Screen_Name  = "Events|ClearSite",
                        Audit_Desc         = "Unable to Clear Site",
                        AuditOperationType = OperationType.MODIFY,
                        Audit_Field        = "Event Number(s)",
                        Audit_Old_Vl       = "Open Events",
                        Audit_New_Vl       = ""
                    });
                }

                iPageNum = iLastPage = 1;
                FillEventsDataForPosition();
            }
            finally
            {
                btnClearSite.IsEnabled = true;
            }
        }
        private void btnReinstate_Click(object sender, RoutedEventArgs e)
        {
            int nResult;

            try
            {
                btnReinstate.IsEnabled = false;
                if (string.IsNullOrEmpty(txtFloatValue.Text) || Regex.IsMatch(txtFloatValue.Text, "[^0-9.,]+"))
                {
                    //"Please enter a valid refloat value"
                    MessageBox.ShowBox("MessageID318", BMC_Icon.Warning, BMC_Button.OK);
                    return;
                }


                int nReturn = CollectionHelper.GetHandPayPlayCreditStatus(_PositionDetail.InstallationNo);
                switch (nReturn)
                {
                case 1:

                    MessageBox.ShowBox("MessageID313", BMC_Icon.Warning);
                    return;

                case 2:

                    MessageBox.ShowBox("MessageID316", BMC_Icon.Warning);
                    return;

                case 3:

                    MessageBox.ShowBox("MessageID317", BMC_Icon.Warning);
                    return;
                }



                if (CollectionHelper.IsEventsUnCleared(_PositionDetail.InstallationNo))
                {
                    if (MessageBox.ShowBox("MessageID315", BMC_Icon.Question, BMC_Button.YesNo) == System.Windows.Forms.DialogResult.Yes)
                    {
                        IEventDetails objCDO = EventsBusinessObject.CreateInstance();

                        objCDO.UpdateEventDetails("MACHINE", string.Empty, 0, _PositionDetail.InstallationNo);
                        return;
                    }
                }
                else
                {
                    var oDataContext =
                        new InstallationDataContext(oCommonUtilities.CreateInstance().GetConnectionString());

                    nResult = oDataContext.InsertReinstateMachine
                                  (_PositionDetail.InstallationNo,
                                  SecurityHelper.CurrentUser.SecurityUserID,
                                  Convert.ToDouble(txtFloatValue.Text),
                                  "Float Issued",
                                  "FLOAT",
                                  0,
                                  0,
                                  "SITE",
                                  Settings.CD_Not_Use_Hoppers);

                    if (nResult == 0)
                    {
                        MessageBox.ShowBox("MessageID319", BMC_Icon.Information, BMC_Button.OK);
                        this.DialogResult = true;
                        this.Close();
                    }
                    else
                    {
                        MessageBox.ShowBox("MessageID320", BMC_Icon.Information, BMC_Button.OK);
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
            }
            finally
            {
                btnReinstate.IsEnabled = true;
            }
        }