Example #1
0
        private void SetSlotPortStatus()
        {
            try
            {
                LogManager.WriteLog("Inside SetSlotPortStatus method", LogManager.enumLogLevel.Info);

                CMachineMaintenance objMachineMaintenance = new CMachineMaintenance();

                CSlotPortStatus cSlotPortStatus = objMachineMaintenance.GetSlotPortStatusForInstallation(installationNo).SingleOrDefault();

                rbAuxSerialPortEnabled.IsChecked  = cSlotPortStatus.AuxSerialPortEnabled == true ? true : false;
                rbAuxSerialPortDisabled.IsChecked = cSlotPortStatus.AuxSerialPortEnabled == true ? false : true;

                rbGatSerialPortEnabled.IsChecked  = cSlotPortStatus.GatSerialPortEnabled == true ? true : false;
                rbGatSerialPortDisabled.IsChecked = cSlotPortStatus.GatSerialPortEnabled == true ? false : true;

                rbSlotLinePortEnabled.IsChecked  = cSlotPortStatus.SlotLinePortEnabled == true ? true : false;
                rbSlotLinePortDisabled.IsChecked = cSlotPortStatus.SlotLinePortEnabled == true ? false : true;

                LogManager.WriteLog("Slot Port Status set successfully", LogManager.enumLogLevel.Info);
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
            }
        }
 private void btnBlockPort_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var port1 = (bool)chkPort1.IsChecked;
         var port2 = (bool)chkPort2.IsChecked;
         var port3 = (bool)chkPort3.IsChecked;
         if (port1 || port2 || port3)
         {
             CMachineMaintenance objMachineMaintenance = new CMachineMaintenance();
             var AuxPort      = Convert.ToByte(port1);
             var SlotLinePort = Convert.ToByte(port2);
             var GATPort      = Convert.ToByte(port3);
             //objMachineMaintenance.BlockPort(installationNo, AuxPort, SlotLinePort, GATPort);
             AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History
             {
                 AuditModuleName    = ModuleName.MachineMaintenance,
                 Audit_Screen_Name  = "Machine Maintenance View",
                 Audit_Desc         = "Port Blocking - Installation No: " + installationNo.ToString(),
                 AuditOperationType = OperationType.MODIFY,
             });
             MessageBox.ShowBox("MessageID323", BMC_Icon.Information, BMC_Button.OK);
             Close();
         }
         else
         {
             MessageBox.ShowBox("MessageID324", BMC_Icon.Information, BMC_Button.OK);
         }
     }
     catch (Exception ex)
     {
         ExceptionManager.Publish(ex);
     }
 }
Example #3
0
        private void PopulateEvents(int SessionID)
        {
            CMachineMaintenance objMachineMaintenance = new CMachineMaintenance();
            List <GetEventsForMaintainSessionResult> objlstMaintenanceHistory = objMachineMaintenance.GetEventsForMaintainSession(SessionID, installationNo);

            lstSessionEvents.ItemsSource = objlstMaintenanceHistory;
        }
Example #4
0
        private void PopulateSession()
        {
            int iOpenSessionIndex = 0;
            CMachineMaintenance        objMachineMaintenance = new CMachineMaintenance();
            CMaintenanceSession        objCurrentSession     = new CMaintenanceSession();
            List <CMaintenanceSession> objlstSession         = objMachineMaintenance.GetMaintainSessionForInstallation(installationNo);

            iOpenSessionIndex = GetOpenSessionIndex(objlstSession);

            if (iOpenSessionIndex == -1)
            {
                btnMainain.Content  = FindResource("CMachineMaintenanceView_xaml_btnMainain");
                txtOpenSession.Text = "";
                txtOpenSession.Tag  = null;
                SetScreenStatus("HISTORY");
            }
            else
            {
                btnMainain.Content = FindResource("CMachineMaintenanceView_xaml_btnMainain_Close");
                objCurrentSession  = objlstSession.ElementAtOrDefault(iOpenSessionIndex);
                objlstSession.RemoveAt(iOpenSessionIndex);
                txtOpenSession.Text = objCurrentSession.SessionName;
                txtOpenSession.Tag  = objCurrentSession.ID;
                SetScreenStatus("CURRENT");
            }
            cmbSessions.ItemsSource   = objlstSession;
            cmbSessions.SelectedIndex = 0;
        }
Example #5
0
        private void UpdateSlotPortStatus()
        {
            LogManager.WriteLog("Inside UpdateSlotPortStatus method", LogManager.enumLogLevel.Info);

            CMachineMaintenance cMachineMaintenance = new CMachineMaintenance();

            bool auxSerialPort = rbAuxSerialPortEnabled.IsChecked == true ? true : false;
            bool gatSerialPort = rbGatSerialPortEnabled.IsChecked == true ? true: false;
            bool slotLinePort  = rbSlotLinePortEnabled.IsChecked == true ? true : false;

            LogManager.WriteLog("Updating database with the Current Slot Port(s) status...", LogManager.enumLogLevel.Info);

            int result = cMachineMaintenance.UpdateSlotPortStatus(installationNo, auxSerialPort, gatSerialPort, slotLinePort);

            LogManager.WriteLog("Database updated successfully with the Current Slot Port(s) status", LogManager.enumLogLevel.Info);
        }
Example #6
0
        private void ManageSlotPorts()
        {
            LogManager.WriteLog("Inside ManageSlotPorts method", LogManager.enumLogLevel.Info);

            string message = string.Empty;

            string auxSerialPort = rbAuxSerialPortEnabled.IsChecked == true ? "0" : "1";
            string gatSerialPort = rbGatSerialPortEnabled.IsChecked == true ? "0" : "1";
            string slotLinePort  = rbSlotLinePortEnabled.IsChecked == true ? "0" : "1";

            message = string.Format("{0},{1},{2}", auxSerialPort, gatSerialPort, slotLinePort);

            LogManager.WriteLog(string.Format("{0} - {1}, {2} - {3}, {4} - {5}", "Aux Serial Port Flag", auxSerialPort,
                                              "GAT Serial Port Flag", gatSerialPort, "Slot Line Port Flag", slotLinePort), LogManager.enumLogLevel.Info);

            CMachineMaintenance cMachineMaintenance = new CMachineMaintenance();

            LogManager.WriteLog("Sending Sector 203 Command to GMU to Enable/Disable Slot Port(s)...", LogManager.enumLogLevel.Info);

            cMachineMaintenance.ManageSlotPorts(installationNo, message);

            LogManager.WriteLog("Sector 203 Command to Enable/Disable Slot Port(s) sent successfully to GMU.", LogManager.enumLogLevel.Info);
        }
Example #7
0
        private void btnMainain_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                CMachineMaintenance objMachineMaintenance = new CMachineMaintenance();

                //Start
                if (btnMainain.Content == FindResource("CMachineMaintenanceView_xaml_btnMainain"))
                {
                    if (MessageBox.ShowBox("MessageID256", BMC_Icon.Question, BMC_Button.YesNo) == System.Windows.Forms.DialogResult.No)
                    {
                        return;
                    }

                    if (objMachineMaintenance.ManageMaintenance(installationNo, 0, Security.SecurityHelper.CurrentUser.SecurityUserID) > 0)
                    {
                        MessageBox.ShowBox("MessageID339", BMC_Icon.Information, BMC_Button.OK);

                        PopulateSession();
                        if (txtOpenSession.Tag != null)
                        {
                            PopulateEvents((int)txtOpenSession.Tag);
                        }
                        return;
                    }

                    //LogManager.WriteLog("Executing Path : " + BMCRegistryHelper.GetRegKeyValue(string.Empty,"InstallationPath").ToString().Trim()  + Common.ConfigurationManagement.ConfigManager.Read(
                    //                "HandpayCommandLinePrompt") + " DisableMachine " + installationNo, LogManager.enumLogLevel.Info);



                    //System.Diagnostics.Process.Start(BMCRegistryHelper.GetRegKeyValue(string.Empty, "InstallationPath").ToString().Trim().ToString().Trim() + Common.ConfigurationManagement.ConfigManager.Read(
                    //            "HandpayCommandLinePrompt"), " DisableMachine " + installationNo);

                    LogManager.WriteLog("Executing Path : " + Path.Combine(Extensions.GetStartupDirectory(), Common.ConfigurationManagement.ConfigManager.Read(
                                                                               "HandpayCommandLinePrompt")) + " DisableMachine " + installationNo, LogManager.enumLogLevel.Info);

                    System.Diagnostics.Process.Start(Path.Combine(Extensions.GetStartupDirectory(), Common.ConfigurationManagement.ConfigManager.Read(
                                                                      "HandpayCommandLinePrompt")), " DisableMachine " + installationNo);


                    AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History
                    {
                        AuditModuleName    = ModuleName.MachineMaintenance,
                        Audit_Screen_Name  = "Machine Maintenance View",
                        Audit_Desc         = "Start Maintenance - Installation No: " + installationNo.ToString(),
                        AuditOperationType = OperationType.MODIFY,
                    });

                    MessageBox.ShowBox("MessageID309", BMC_Icon.Information, BMC_Button.OK);
                }
                else//Close
                {
                    int iMachineEventStatus = objMachineMaintenance.CheckMachineMaintenance(installationNo);
                    if (iMachineEventStatus < 0)
                    {
                        if (MessageBox.ShowBox("MessageID304", BMC_Icon.Question, BMC_Button.YesNo) == System.Windows.Forms.DialogResult.No)
                        {
                            return;
                        }
                        CAuthorize objAuthorize = new CAuthorize("CashdeskOperator.Authorize.cs.OverrideEvents");
                        objAuthorize.User = Security.SecurityHelper.CurrentUser;
                        if (!Security.SecurityHelper.HasAccess("CashdeskOperator.Authorize.cs.OverrideEvents"))
                        {
                            objAuthorize.ShowDialog();
                            if (!objAuthorize.IsAuthorized)
                            {
                                return;
                            }
                        }
                        else
                        {
                            objAuthorize.IsAuthorized = true;
                        }
                    }

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

                    var objReasonCategory = new CReasonCategory();
                    objReasonCategory.ShowDialog();

                    if (objReasonCategory.MaintenanceReasonCategory != null && objReasonCategory.MaintenanceReasonCategory.Length > 0)
                    {
                        objMachineMaintenance.CloseMaintenance(installationNo, Security.SecurityHelper.CurrentUser.SecurityUserID,
                                                               objReasonCategory.MaintenanceReasonCategory);



                        AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History
                        {
                            AuditModuleName    = ModuleName.MachineMaintenance,
                            Audit_Screen_Name  = "Machine Maintenance View",
                            Audit_Desc         = "Close Maintenance - Installation No: " + installationNo.ToString(),
                            AuditOperationType = OperationType.MODIFY,
                        });

                        MessageBox.ShowBox("MessageID310", BMC_Icon.Information, BMC_Button.OK);
                    }
                    else
                    {
                        return;
                    }
                }
                PopulateSession();
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
            }
        }