Esempio n. 1
0
        private void sbSelectCard(Card p_card)
        {
            try
            {
                sbclearResultsGrid();

                if (p_card.Type == enmCardType.Query)
                {
                    if (p_card.ResultType == enmResultType.Text)
                    {
                        objCardText              = new uscTextResult(p_card);
                        objCardText.evRemove    += evRemoveTextCardFromResults;
                        objCardText.evBeginWait += evBeginWait;
                        objCardText.evEndWait   += evEndWait;
                        grdResults.Children.Add(objCardText);
                    }
                    else
                    {
                        objCardGrid              = new uscGridResult(p_card);
                        objCardGrid.evRemove    += evRemoveGridCardFromResults;
                        objCardGrid.evBeginWait += evBeginWait;
                        objCardGrid.evEndWait   += evEndWait;
                        grdResults.Children.Add(objCardGrid);
                    }
                }
                else
                {
                    objCardMigration              = new uscMigration(p_card);
                    objCardMigration.evRemove    += evRemoveTextCardFromResults;
                    objCardMigration.evBeginWait += evBeginWait;
                    objCardMigration.evEndWait   += evEndWait;
                    grdResults.Children.Add(objCardMigration);
                }


                SpinerBaseBO.Instance.ConfigBase.LastCard = p_card;
            }
            catch (Exception ex)
            {
                throw new Exception(Properties.Resources.ResourceManager.GetString("msgError").ToString(), ex);
            }
        }
Esempio n. 2
0
        private void sbclearResultsGrid()
        {
            try
            {
                grdResults.Children.Clear();

                if (objCardText is null == false)
                {
                    objCardText.DisposeEvents();
                    objCardText.evRemove    -= evRemoveTextCardFromResults;
                    objCardText.evBeginWait -= evBeginWait;
                    objCardText.evEndWait   -= evEndWait;
                    objCardText              = null;
                }

                if (objCardGrid is null == false)
                {
                    objCardGrid.DisposeEvents();
                    objCardGrid.evRemove    -= evRemoveGridCardFromResults;
                    objCardGrid.evBeginWait -= evBeginWait;
                    objCardGrid.evEndWait   -= evEndWait;
                    objCardGrid              = null;
                }

                if (objCardMigration is null == false)
                {
                    objCardMigration.DisposeEvents();
                    objCardMigration.evRemove    -= evRemoveGridCardFromResults;
                    objCardMigration.evBeginWait -= evBeginWait;
                    objCardMigration.evEndWait   -= evEndWait;
                    objCardMigration              = null;
                }

                if (objConnectionConfig is null == false)
                {
                    objConnectionConfig.evClose     -= evRemoveConfigFromResults;
                    objConnectionConfig.evBeginWait -= evBeginWait;
                    objConnectionConfig.evEndWait   -= evEndWait;
                    objConnectionConfig              = null;
                }

                if (objCardEditor is null == false)
                {
                    objCardEditor.evSaved -= evCardSaved;
                    objCardEditor          = null;
                }


                if (SpinerBaseBO.Instance.actualConnection is null == false)
                {
                    SpinerBaseBO.Instance.fnConnect(SpinerBaseBO.Instance.actualConnection);
                    lblConnection.Content = SpinerBaseBO.Instance.actualConnection.Name.Trim() + " - " + SpinerBaseBO.Instance.actualConnection.DataBaseType.ToString();
                }

                sbFilter();

                sbPleseWait(false);
            }
            catch (Exception ex)
            {
                throw new Exception(Properties.Resources.ResourceManager.GetString("msgError").ToString(), ex);
            }
        }