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.ucEnrollmentWnd = ((BMC.Presentation.POS.EnrollmentWnd)(target));
     
     #line 17 "..\..\EnrollmentWnd.xaml"
     this.ucEnrollmentWnd.Loaded += new System.Windows.RoutedEventHandler(this.ucEnrollmentWnd_Loaded);
     
     #line default
     #line hidden
     return;
     case 2:
     this.btnExit = ((System.Windows.Controls.Button)(target));
     
     #line 65 "..\..\EnrollmentWnd.xaml"
     this.btnExit.Click += new System.Windows.RoutedEventHandler(this.btnExit_Click_1);
     
     #line default
     #line hidden
     return;
     case 3:
     this.lblStatus = ((System.Windows.Controls.Label)(target));
     return;
     case 4:
     this.progressBar1 = ((System.Windows.Controls.ProgressBar)(target));
     return;
     case 5:
     this.txtGMUNo = ((System.Windows.Controls.TextBox)(target));
     return;
     case 6:
     this.textBox1 = ((System.Windows.Controls.TextBox)(target));
     return;
     case 7:
     this.txtAsset = ((System.Windows.Controls.TextBox)(target));
     
     #line 91 "..\..\EnrollmentWnd.xaml"
     this.txtAsset.PreviewMouseUp += new System.Windows.Input.MouseButtonEventHandler(this.txtAsset_PreviewMouseUp);
     
     #line default
     #line hidden
     return;
     case 8:
     this.chkInTransitAsset = ((System.Windows.Controls.CheckBox)(target));
     
     #line 92 "..\..\EnrollmentWnd.xaml"
     this.chkInTransitAsset.Checked += new System.Windows.RoutedEventHandler(this.chkInTransitAsset_Checked);
     
     #line default
     #line hidden
     return;
     case 9:
     this.GetAccDetails = ((System.Windows.Controls.Button)(target));
     
     #line 93 "..\..\EnrollmentWnd.xaml"
     this.GetAccDetails.Click += new System.Windows.RoutedEventHandler(this.GetAccDetails_Click);
     
     #line default
     #line hidden
     return;
     case 10:
     this.tb_AssetNo = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 11:
     this.lblSerialNo = ((System.Windows.Controls.Label)(target));
     return;
     case 12:
     this.lblAltSrialNo = ((System.Windows.Controls.Label)(target));
     return;
     case 13:
     this.lblGMUNo = ((System.Windows.Controls.Label)(target));
     return;
     case 14:
     this.tbMachineType = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 15:
     this.lblGameTitle = ((System.Windows.Controls.Label)(target));
     return;
     case 16:
     this.lblPosition = ((System.Windows.Controls.Label)(target));
     return;
     case 17:
     this.rectangle1 = ((System.Windows.Shapes.Rectangle)(target));
     return;
     case 18:
     this.txtBaseDenom = ((System.Windows.Controls.TextBox)(target));
     
     #line 110 "..\..\EnrollmentWnd.xaml"
     this.txtBaseDenom.PreviewMouseUp += new System.Windows.Input.MouseButtonEventHandler(this.txtBaseDenom_PreviewMouseUp);
     
     #line default
     #line hidden
     return;
     case 19:
     this.lblCoinType = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 20:
     this.txtCreditValue = ((System.Windows.Controls.TextBox)(target));
     
     #line 112 "..\..\EnrollmentWnd.xaml"
     this.txtCreditValue.PreviewMouseUp += new System.Windows.Input.MouseButtonEventHandler(this.txtCreditValue_PreviewMouseUp);
     
     #line default
     #line hidden
     return;
     case 21:
     this.cmbCoinType = ((System.Windows.Controls.ComboBox)(target));
     return;
     case 22:
     this.txtPercentagePayout = ((System.Windows.Controls.TextBox)(target));
     return;
     case 23:
     this.txtJackpot = ((System.Windows.Controls.TextBox)(target));
     
     #line 117 "..\..\EnrollmentWnd.xaml"
     this.txtJackpot.PreviewMouseUp += new System.Windows.Input.MouseButtonEventHandler(this.txtJackpot_PreviewMouseUp);
     
     #line default
     #line hidden
     return;
     case 24:
     this.txtMaxBet = ((System.Windows.Controls.TextBox)(target));
     return;
     case 25:
     this.Enroll = ((System.Windows.Controls.Button)(target));
     
     #line 119 "..\..\EnrollmentWnd.xaml"
     this.Enroll.Click += new System.Windows.RoutedEventHandler(this.Enroll_Click);
     
     #line default
     #line hidden
     return;
     }
     this._contentLoaded = true;
 }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ucEnrollmentWnd = ((BMC.Presentation.POS.EnrollmentWnd)(target));

            #line 17 "..\..\EnrollmentWnd.xaml"
                this.ucEnrollmentWnd.Loaded += new System.Windows.RoutedEventHandler(this.ucEnrollmentWnd_Loaded);

            #line default
            #line hidden
                return;

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

            #line 65 "..\..\EnrollmentWnd.xaml"
                this.btnExit.Click += new System.Windows.RoutedEventHandler(this.btnExit_Click_1);

            #line default
            #line hidden
                return;

            case 3:
                this.lblStatus = ((System.Windows.Controls.Label)(target));
                return;

            case 4:
                this.progressBar1 = ((System.Windows.Controls.ProgressBar)(target));
                return;

            case 5:
                this.txtGMUNo = ((System.Windows.Controls.TextBox)(target));
                return;

            case 6:
                this.textBox1 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 7:
                this.txtAsset = ((System.Windows.Controls.TextBox)(target));

            #line 91 "..\..\EnrollmentWnd.xaml"
                this.txtAsset.PreviewMouseUp += new System.Windows.Input.MouseButtonEventHandler(this.txtAsset_PreviewMouseUp);

            #line default
            #line hidden
                return;

            case 8:
                this.chkInTransitAsset = ((System.Windows.Controls.CheckBox)(target));

            #line 92 "..\..\EnrollmentWnd.xaml"
                this.chkInTransitAsset.Checked += new System.Windows.RoutedEventHandler(this.chkInTransitAsset_Checked);

            #line default
            #line hidden
                return;

            case 9:
                this.GetAccDetails = ((System.Windows.Controls.Button)(target));

            #line 93 "..\..\EnrollmentWnd.xaml"
                this.GetAccDetails.Click += new System.Windows.RoutedEventHandler(this.GetAccDetails_Click);

            #line default
            #line hidden
                return;

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

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

            case 12:
                this.lblAltSrialNo = ((System.Windows.Controls.Label)(target));
                return;

            case 13:
                this.lblGMUNo = ((System.Windows.Controls.Label)(target));
                return;

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

            case 15:
                this.lblGameTitle = ((System.Windows.Controls.Label)(target));
                return;

            case 16:
                this.lblPosition = ((System.Windows.Controls.Label)(target));
                return;

            case 17:
                this.rectangle1 = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 18:
                this.txtBaseDenom = ((System.Windows.Controls.TextBox)(target));

            #line 110 "..\..\EnrollmentWnd.xaml"
                this.txtBaseDenom.PreviewMouseUp += new System.Windows.Input.MouseButtonEventHandler(this.txtBaseDenom_PreviewMouseUp);

            #line default
            #line hidden
                return;

            case 19:
                this.lblCoinType = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 20:
                this.txtCreditValue = ((System.Windows.Controls.TextBox)(target));

            #line 112 "..\..\EnrollmentWnd.xaml"
                this.txtCreditValue.PreviewMouseUp += new System.Windows.Input.MouseButtonEventHandler(this.txtCreditValue_PreviewMouseUp);

            #line default
            #line hidden
                return;

            case 21:
                this.cmbCoinType = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 22:
                this.txtPercentagePayout = ((System.Windows.Controls.TextBox)(target));
                return;

            case 23:
                this.txtJackpot = ((System.Windows.Controls.TextBox)(target));

            #line 117 "..\..\EnrollmentWnd.xaml"
                this.txtJackpot.PreviewMouseUp += new System.Windows.Input.MouseButtonEventHandler(this.txtJackpot_PreviewMouseUp);

            #line default
            #line hidden
                return;

            case 24:
                this.txtMaxBet = ((System.Windows.Controls.TextBox)(target));
                return;

            case 25:
                this.Enroll = ((System.Windows.Controls.Button)(target));

            #line 119 "..\..\EnrollmentWnd.xaml"
                this.Enroll.Click += new System.Windows.RoutedEventHandler(this.Enroll_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }