コード例 #1
0
        private void EditBug_Load(object sender, EventArgs e)
        {
            try
            {
                if (!this.DesignMode)
                {
                    _appSettings = MyZillaSettingsDataSet.GetInstance();

                    _asyncOpManager = AsyncOperationManagerList.GetInstance();

                    // disable the control until de bug details are loaded and
                    // all the controls are populated accordingly.

                    ShowConnectionInfo();

                    this.Enabled = false;

                    _catalogues = CatalogueManager.Instance();

                    //if (_catalogues.DependentCataloguesLoadedCompleted!=null)
                    _catalogues.DependentCataloguesLoadedCompleted += new EventHandler(this._catalogues_DependentCataloguesLoadedCompleted);

                    cataloguesPerUser = _catalogues.GetCataloguesForConnection(this.connectionId);

                    if (cataloguesPerUser.catalogueComponent == null || cataloguesPerUser.catalogueVersion == null || cataloguesPerUser.catalogueTargetMilestone == null)
                    {
                        cmbComponent.Enabled = false;

                        cmbVersion.Enabled = false;

                        cmbMilestone.Enabled = false;

                        _catalogues.CompAndVersionCataloguesLoadedCompleted += new EventHandler(_catalogues_CompAndVersionCataloguesLoadedCompleted);

                        _catalogues.LoadCompAndVersionCatalogues(cataloguesPerUser);
                    }
                    else
                    {
                        PopulateControls();

                        // asyn op
                        GetBugDetailsAndSetControls(this.bugId, true);
                    }

                    if (_appSettings.GetConnectionById(connectionId).Version.StartsWith("2.18"))
                    {
                        GetLastUpdated();
                    }
                }
            }
            catch (Exception ex)
            {
                MyLogger.Write(ex, "EditBug_Load", LoggingCategory.Exception);

                MessageBox.Show(this, ex.Message, Messages.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #2
0
        private void InsertBug_Load(object sender, EventArgs e)
        {
            try
            {
                if (!this.DesignMode)
                {
                    MyZillaSettingsDataSet _appSettings = MyZillaSettingsDataSet.GetInstance();

                    _catalogues = CatalogueManager.Instance();

                    this.txtReporter.Text = _appSettings.GetConnectionById(this.connectionId).UserName;

                    asyncOpManager = AsyncOperationManagerList.GetInstance();

                    cmbConnections.SelectedValueChanged -= new EventHandler(cmbConnections_SelectedValueChanged);

                    LoadConnectionInfo();

                    cmbConnections.Text = _appSettings.GetConnectionInfo(this.connectionId);

                    cmbConnections.SelectedValueChanged += new EventHandler(cmbConnections_SelectedValueChanged);


                    // verify if all catalogues have been added and populate the controls properly

                    cataloguesPerUser = _catalogues.GetCataloguesForConnection(this.connectionId);

                    if (cataloguesPerUser.catalogueComponent == null || cataloguesPerUser.catalogueVersion == null || cataloguesPerUser.catalogueTargetMilestone == null)
                    {
                        cmbComponent.Enabled = false;

                        cmbVersion.Enabled = false;

                        cmbMilestone.Enabled = false;

                        btnInsertBug.Enabled = false;

                        _catalogues.CompAndVersionCataloguesLoadedCompleted += new EventHandler(_catalogues_CompAndVersionCataloguesLoadedCompleted);

                        _catalogues.LoadCompAndVersionCatalogues(cataloguesPerUser);
                    }
                    else
                    {
                        _catalogues.DependentCataloguesLoadedCompleted += new EventHandler(this._catalogues_DependentCataloguesLoadedCompletedInsertBug);

                        PopulateControls();
                    }
                }
            }
            catch (Exception ex)
            {
                MyLogger.Write(ex, "InsertBug_Load", LoggingCategory.Exception);

                MessageBox.Show(this, ex.Message, Messages.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #3
0
        private bool CheckConditionsForLoading()
        {
            bool isValid = true;

            CatalogueManager _catalogues = CatalogueManager.Instance();

            Catalogues cataloguesPerUser = _catalogues.GetCataloguesForConnection(_connectionId);

            if (cataloguesPerUser == null)
            {
                return(false);
            }

            return(isValid);
        }