private void SlotMouseUpEvent(object sender, MouseButtonEventArgs e)
        {
            int machineStatusFlag = 0;
            string siteCode = string.Empty;
            bool needRefresh = false;

            try
            {
                SlotMachine _slotMachine = (SlotMachine)sender;

                try
                {
                    LogManager.WriteLog("Inside SlotMouseUpEvent for : " + _slotMachine.SlotNumberString, LogManager.enumLogLevel.Info);
                }
                catch { }

                if (pnlFloor.IsElementBeingDragged)
                {
                    bool isSaved = false;
                    chkSortPos.IsChecked = false;
                    chkSortAsset.IsChecked = false;
                    SaveFloorPosition(_slotMachine, false, ref isSaved);
                    if (isSaved) CDOSettings.Current.Save();
                    return;
                }

                if (!SecurityHelper.HasAccess("BMC.Presentation.PosDetails"))
                {
                    MessageBox.ShowBox("MessageID324", BMC_Icon.Warning, BMC_Button.OK);
                    return;
                }

                if (_slotMachine.Status == SlotMachineStatus.InstallationCompletedNonMetered
                        || _slotMachine.Status == SlotMachineStatus.GameInstallationAAMSPending
                        || _slotMachine.Status == SlotMachineStatus.ForceFinalCollection)
                {
                    if (!Security.SecurityHelper.HasAccess("CashdeskOperator.FloorView.cs.RemoveMachine"))
                    {
                        MessageBox.ShowBox("MessageID328", BMC_Icon.Information, BMC_Button.OK);
                        return;
                    }

                    if (_slotMachine.Status == SlotMachineStatus.ForceFinalCollection)
                    {
                        if (MessageBox.ShowBox("MessageID379", BMC_Icon.Information, BMC_Button.OKCancel)
                            == System.Windows.Forms.DialogResult.OK)
                        {
                            HandpayBusinessObject.CreateInstance().ProcessHandPayOnDenomChange(_slotMachine.SlotNumberString,
                                Security.SecurityHelper.CurrentUser.User_No);
                            Exit.Invoke(this, new CancelEventArgs());
                        }
                        return;
                    }

                    if (_slotMachine.Status == SlotMachineStatus.InstallationCompletedNonMetered)
                    {
                        if (MessageBox.ShowBox("MessageID323", BMC_Icon.Information, BMC_Button.OKCancel)
                            == System.Windows.Forms.DialogResult.Cancel)
                            return;
                    }

                    Cursor = System.Windows.Input.Cursors.Wait;

                    InstallationDataContext objRemoveContext =
                                            new InstallationDataContext(oCommonUtilities.CreateInstance().GetConnectionString());
                    int nDisMachine = 0;

                    foreach (var IP in objRemoveContext.GetDisableMachine(_slotMachine.InstallationNo))
                    {
                        nDisMachine = IP.DisMachine;
                    }

                    EnrollmentErrorCodes ErrorCode = EnrollmentBusinessObject.CreateInstance().RemoveMachine(
                                            _slotMachine.InstallationNo, machineStatusFlag, siteCode, nDisMachine);
                    needRefresh = true;
                    Cursor = System.Windows.Input.Cursors.Arrow;

                    switch (ErrorCode)
                    {
                        case EnrollmentErrorCodes.DatabaseError:
                            {
                                MessageBox.ShowBox("MessageID206");
                                Audit_Error("Database Error", _slotMachine.AssetNumber);
                                break;
                            }
                        case EnrollmentErrorCodes.EnterpriseWebServiceCommunicationFailure:
                            {
                                MessageBox.ShowBox("MessageID207");
                                Audit_Error("Enterprise WebService Communication Failure", _slotMachine.AssetNumber);
                                break;
                            }
                        case EnrollmentErrorCodes.RemoveFromPollingListFailure:
                            {
                                MessageBox.ShowBox("MessageID208");
                                Audit_Error("Unable to remove from Polling list", _slotMachine.AssetNumber);
                                break;
                            }
                        case EnrollmentErrorCodes.ExchangeHostServiceNotRunning:
                            {
                                Audit_Error("Unable to remove from Polling list: Timeout occured", _slotMachine.AssetNumber);
                                if (MessageBox.ShowBox("MessageID359", BMC_Icon.Question, BMC_Button.YesNo)
                                    == System.Windows.Forms.DialogResult.No)
                                    return;
                                //Calling Remove Machine with Disable Machine command as false, Since first attempt to Disable Failed.
                                ErrorCode = EnrollmentBusinessObject.CreateInstance().RemoveMachine(
                                    _slotMachine.InstallationNo, machineStatusFlag, siteCode, 0);

                                switch (ErrorCode)
                                {
                                    case EnrollmentErrorCodes.DatabaseError:
                                        {
                                            MessageBox.ShowBox("MessageID206");
                                            Audit_Error("Database Error", _slotMachine.AssetNumber);
                                            break;
                                        }
                                    case EnrollmentErrorCodes.EnterpriseWebServiceCommunicationFailure:
                                        {
                                            MessageBox.ShowBox("MessageID207");
                                            Audit_Error("Enterprise WebService Communication Failure", _slotMachine.AssetNumber);
                                            break;
                                        }
                                    case EnrollmentErrorCodes.RemoveFromPollingListFailure:
                                        {
                                            MessageBox.ShowBox("MessageID208");
                                            Audit_Error("Unable to remove from Polling list", _slotMachine.AssetNumber);
                                            break;
                                        }
                                    case EnrollmentErrorCodes.ExchangeHostServiceNotRunning:
                                        {
                                            Audit_Error("Unable to remove from Polling list: Timeout occured", _slotMachine.AssetNumber);
                                            MessageBox.ShowBox("MessageID360", BMC_Icon.Error);
                                            break;
                                        }
                                    case EnrollmentErrorCodes.Success:
                                        MessageBox.ShowBox("MessageID209");

                                        AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History
                                        {

                                            AuditModuleName = ModuleName.RemoveMachine,
                                            Audit_Screen_Name = "Position Details|Remove Machine",
                                            Audit_Desc = "Machine Removed from Position: "
                                                         + Convert.ToInt32(_slotMachine.SlotNumber).ToString(),
                                            AuditOperationType = OperationType.MODIFY,
                                            Audit_Slot = ((SlotMachine)sender).AssetNumber,
                                            Audit_Field = "Position",
                                            Audit_Old_Vl = Convert.ToInt32(_slotMachine.SlotNumber).ToString()
                                        });
                                        break;


                                }
                                return;

                                break;
                            }
                        case EnrollmentErrorCodes.Success:
                            MessageBox.ShowBox("MessageID209");

                            AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History
                            {

                                AuditModuleName = ModuleName.RemoveMachine,
                                Audit_Screen_Name = "Position Details|Remove Machine",
                                Audit_Desc = "Machine Removed from Position: "
                                             + Convert.ToInt32(_slotMachine.SlotNumber).ToString(),
                                AuditOperationType = OperationType.MODIFY,
                                Audit_Slot = ((SlotMachine)sender).AssetNumber,
                                Audit_Field = "Position",
                                Audit_Old_Vl = Convert.ToInt32(_slotMachine.SlotNumber).ToString()
                            });
                            break;


                    }
                    return;
                }
                if (_slotMachine.InstallationNo > 0)
                {
                    this.CloseLegendPanel();
                    var pos = new PosDetails(_slotMachine);
                    pos.Exit += ObjPosDetailsExitClicked;
                    this.ChildWindow = pos;
                    pos.Margin = new Thickness(0);
                    LayoutRoot.Children.Add(pos);
                }
                else if (string.IsNullOrWhiteSpace(_slotMachine.AssetNumber) &&
                         SecurityHelper.HasAccess("CashdeskOperator.FloorView.cs.InstallMachine"))
                {
                    this.CloseLegendPanel();
                    var enrollment = new EnrollmentWnd(_slotMachine.SlotNumberString);
                    enrollment.Exit += ObjPosDetailsExitClicked;
                    this.ChildWindow = enrollment;
                    enrollment.Margin = new Thickness(0);
                    LayoutRoot.Children.Add(enrollment);
                }
                else
                {
                    MessageBox.ShowBox("MessageID437");
                }
                return;

            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
            }
            finally
            {
                if (needRefresh)
                {
                    SlotMachineCollectionFactory.ClearMachines(this);
                    clientObj_FloorClientReceived(null);
                }
            }
        }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.ucPosDetails = ((BMC.Presentation.PosDetails)(target));
     return;
     case 2:
     this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
     return;
     case 3:
     this.pnlHeader = ((System.Windows.Controls.Grid)(target));
     return;
     case 4:
     this.lblPercentagePayout = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 5:
     this.lblAsset = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 6:
     this.lblBaseDenom = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 7:
     this.lblMaxBet = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 8:
     this.lblCreditValue = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 9:
     this.lblRoute = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 10:
     this.txtRoute = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 11:
     this.lblSerialNo = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 12:
     this.lblManufacturer = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 13:
     this.lblActAsset = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 14:
     this.lblGMU = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 15:
     this.btnExit = ((System.Windows.Controls.Button)(target));
     
     #line 53 "..\..\..\UserControls\PosDetails.xaml"
     this.btnExit.Click += new System.Windows.RoutedEventHandler(this.btn_Exit);
     
     #line default
     #line hidden
     return;
     case 16:
     this.ucSlotMachine = ((BMC.Presentation.SlotMachine)(target));
     return;
     case 17:
     this.lblZoneName = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 18:
     this.rbHandpay = ((System.Windows.Controls.RadioButton)(target));
     
     #line 68 "..\..\..\UserControls\PosDetails.xaml"
     this.rbHandpay.Click += new System.Windows.RoutedEventHandler(this.Handpay_Click);
     
     #line default
     #line hidden
     return;
     case 19:
     this.rbPlayerClub = ((System.Windows.Controls.RadioButton)(target));
     
     #line 69 "..\..\..\UserControls\PosDetails.xaml"
     this.rbPlayerClub.Click += new System.Windows.RoutedEventHandler(this.PlayerClub_Click);
     
     #line default
     #line hidden
     return;
     case 20:
     this.rbFieldService = ((System.Windows.Controls.RadioButton)(target));
     
     #line 70 "..\..\..\UserControls\PosDetails.xaml"
     this.rbFieldService.Click += new System.Windows.RoutedEventHandler(this.FldService_Click);
     
     #line default
     #line hidden
     return;
     case 21:
     this.rbEvents = ((System.Windows.Controls.RadioButton)(target));
     
     #line 71 "..\..\..\UserControls\PosDetails.xaml"
     this.rbEvents.Click += new System.Windows.RoutedEventHandler(this.Events_Click);
     
     #line default
     #line hidden
     return;
     case 22:
     this.rbMachineMeters = ((System.Windows.Controls.RadioButton)(target));
     
     #line 73 "..\..\..\UserControls\PosDetails.xaml"
     this.rbMachineMeters.Click += new System.Windows.RoutedEventHandler(this.MCMeters_Click);
     
     #line default
     #line hidden
     return;
     case 23:
     this.rbCurrentMeters = ((System.Windows.Controls.RadioButton)(target));
     
     #line 74 "..\..\..\UserControls\PosDetails.xaml"
     this.rbCurrentMeters.Click += new System.Windows.RoutedEventHandler(this.MCCurrentMeters_Click);
     
     #line default
     #line hidden
     return;
     case 24:
     this.rbRemoveMachine = ((System.Windows.Controls.RadioButton)(target));
     
     #line 75 "..\..\..\UserControls\PosDetails.xaml"
     this.rbRemoveMachine.Click += new System.Windows.RoutedEventHandler(this.RemoveMachine_Click);
     
     #line default
     #line hidden
     return;
     case 25:
     this.rbMachineMaintenance = ((System.Windows.Controls.RadioButton)(target));
     
     #line 76 "..\..\..\UserControls\PosDetails.xaml"
     this.rbMachineMaintenance.Click += new System.Windows.RoutedEventHandler(this.rbMachineMaintenance_Click);
     
     #line default
     #line hidden
     return;
     case 26:
     this.rbReInstateMachine = ((System.Windows.Controls.RadioButton)(target));
     
     #line 77 "..\..\..\UserControls\PosDetails.xaml"
     this.rbReInstateMachine.Click += new System.Windows.RoutedEventHandler(this.rbReInstateMachine_Click);
     
     #line default
     #line hidden
     return;
     case 27:
     this.rbSyncTicketExpire = ((System.Windows.Controls.RadioButton)(target));
     
     #line 78 "..\..\..\UserControls\PosDetails.xaml"
     this.rbSyncTicketExpire.Click += new System.Windows.RoutedEventHandler(this.SyncTicketExpire_Click);
     
     #line default
     #line hidden
     return;
     case 28:
     this.pnlContent = ((System.Windows.Controls.Grid)(target));
     
     #line 83 "..\..\..\UserControls\PosDetails.xaml"
     this.pnlContent.Loaded += new System.Windows.RoutedEventHandler(this.pnlContent_Loaded);
     
     #line default
     #line hidden
     return;
     case 29:
     this.lblGame = ((System.Windows.Controls.TextBlock)(target));
     return;
     }
     this._contentLoaded = true;
 }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ucPosDetails = ((BMC.Presentation.PosDetails)(target));
                return;

            case 2:
                this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.pnlHeader = ((System.Windows.Controls.Grid)(target));
                return;

            case 4:
                this.lblPercentagePayout = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 5:
                this.lblAsset = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 6:
                this.lblBaseDenom = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 7:
                this.lblMaxBet = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 8:
                this.lblCreditValue = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 9:
                this.lblRoute = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 10:
                this.txtRoute = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 11:
                this.lblSerialNo = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 12:
                this.lblManufacturer = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 13:
                this.lblActAsset = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 14:
                this.lblGMU = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 15:
                this.btnExit = ((System.Windows.Controls.Button)(target));

            #line 53 "..\..\..\UserControls\PosDetails.xaml"
                this.btnExit.Click += new System.Windows.RoutedEventHandler(this.btn_Exit);

            #line default
            #line hidden
                return;

            case 16:
                this.ucSlotMachine = ((BMC.Presentation.SlotMachine)(target));
                return;

            case 17:
                this.lblZoneName = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 18:
                this.rbHandpay = ((System.Windows.Controls.RadioButton)(target));

            #line 68 "..\..\..\UserControls\PosDetails.xaml"
                this.rbHandpay.Click += new System.Windows.RoutedEventHandler(this.Handpay_Click);

            #line default
            #line hidden
                return;

            case 19:
                this.rbPlayerClub = ((System.Windows.Controls.RadioButton)(target));

            #line 69 "..\..\..\UserControls\PosDetails.xaml"
                this.rbPlayerClub.Click += new System.Windows.RoutedEventHandler(this.PlayerClub_Click);

            #line default
            #line hidden
                return;

            case 20:
                this.rbFieldService = ((System.Windows.Controls.RadioButton)(target));

            #line 70 "..\..\..\UserControls\PosDetails.xaml"
                this.rbFieldService.Click += new System.Windows.RoutedEventHandler(this.FldService_Click);

            #line default
            #line hidden
                return;

            case 21:
                this.rbEvents = ((System.Windows.Controls.RadioButton)(target));

            #line 71 "..\..\..\UserControls\PosDetails.xaml"
                this.rbEvents.Click += new System.Windows.RoutedEventHandler(this.Events_Click);

            #line default
            #line hidden
                return;

            case 22:
                this.rbMachineMeters = ((System.Windows.Controls.RadioButton)(target));

            #line 73 "..\..\..\UserControls\PosDetails.xaml"
                this.rbMachineMeters.Click += new System.Windows.RoutedEventHandler(this.MCMeters_Click);

            #line default
            #line hidden
                return;

            case 23:
                this.rbCurrentMeters = ((System.Windows.Controls.RadioButton)(target));

            #line 74 "..\..\..\UserControls\PosDetails.xaml"
                this.rbCurrentMeters.Click += new System.Windows.RoutedEventHandler(this.MCCurrentMeters_Click);

            #line default
            #line hidden
                return;

            case 24:
                this.rbRemoveMachine = ((System.Windows.Controls.RadioButton)(target));

            #line 75 "..\..\..\UserControls\PosDetails.xaml"
                this.rbRemoveMachine.Click += new System.Windows.RoutedEventHandler(this.RemoveMachine_Click);

            #line default
            #line hidden
                return;

            case 25:
                this.rbMachineMaintenance = ((System.Windows.Controls.RadioButton)(target));

            #line 76 "..\..\..\UserControls\PosDetails.xaml"
                this.rbMachineMaintenance.Click += new System.Windows.RoutedEventHandler(this.rbMachineMaintenance_Click);

            #line default
            #line hidden
                return;

            case 26:
                this.rbReInstateMachine = ((System.Windows.Controls.RadioButton)(target));

            #line 77 "..\..\..\UserControls\PosDetails.xaml"
                this.rbReInstateMachine.Click += new System.Windows.RoutedEventHandler(this.rbReInstateMachine_Click);

            #line default
            #line hidden
                return;

            case 27:
                this.rbSyncTicketExpire = ((System.Windows.Controls.RadioButton)(target));

            #line 78 "..\..\..\UserControls\PosDetails.xaml"
                this.rbSyncTicketExpire.Click += new System.Windows.RoutedEventHandler(this.SyncTicketExpire_Click);

            #line default
            #line hidden
                return;

            case 28:
                this.pnlContent = ((System.Windows.Controls.Grid)(target));

            #line 83 "..\..\..\UserControls\PosDetails.xaml"
                this.pnlContent.Loaded += new System.Windows.RoutedEventHandler(this.pnlContent_Loaded);

            #line default
            #line hidden
                return;

            case 29:
                this.lblGame = ((System.Windows.Controls.TextBlock)(target));
                return;
            }
            this._contentLoaded = true;
        }