コード例 #1
0
ファイル: MainForm.cs プロジェクト: combit/RedmineReports
        private void Form1_Load(object sender, EventArgs e)
        {
            this.BackColor = System.Drawing.Color.FromArgb(245, 246, 247);
            this.GetMainWindowsPos();
            try
            {
                if (RedmineReportsConfigDataHelper.ConnectionStringEncrypted(connString))
                {
                    _dataAccess = new RedmineMySqlDataAccess();
                }
                else
                {
                    if (RedmineReportsConfigDataHelper.ConnectionStringIsPlain(connString))
                    {
                        _dataAccess = new RedmineMySqlDataAccess(null, RedmineReportsConfigDataHelper.ConnectionStringIsPlain(connString));
                    }
                    else
                    {
                        //open config form for sql data
                        ConfigureMySqlDataBaseConnection();
                    }
                }

                _lL = new ListLabel();
                // Add your License Key
                _lL.LicensingInfo = "Insert license key here";

                // fill project listbox
                if (_dataAccess != null)
                {
                    lstbProjects.DataSource = _dataAccess.GetRedmineProjects(Convert.ToBoolean(ConfigurationManager.AppSettings["UseAllProjects"]));
                }
                lstbProjects.DisplayMember = "display_name";
                lstbProjects.ValueMember   = "id";

                // check or uncheck checkbox for subprojects
                cbAllProjects.Checked = Convert.ToBoolean(ConfigurationManager.AppSettings["UseAllProjects"]);

                DesignerFunction fct = new DesignerFunction();
                fct.FunctionName      = "GetStatusNameFromId";
                fct.GroupName         = "RedmineFunctions";
                fct.ResultType        = LlParamType.String;
                fct.MinimalParameters = 1;
                fct.MaximumParameters = 1;
                fct.Parameter1.Type   = LlParamType.Double;
                fct.EvaluateFunction += new EvaluateFunctionHandler(fct_EvaluateFunction);
                _lL.DesignerFunctions.Add(fct);

                lstbTrackers.Enabled        = !AllLstBoxItemsSelected(lstbTrackers);
                chkBox_All_Trackers.Checked = AllLstBoxItemsSelected(lstbTrackers);
            }
            catch (NullReferenceException ex)
            {
                MessageBox.Show(ex.Message);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: combit/RedmineReports
        public void reloadCmb(string ConnectionString)
        {
            //InitializeComponent();
            _dataAccess = null;
            _dataAccess = new RedmineMySqlDataAccess(ConnectionString);

            lstbProjects.DataSource    = null;
            lstbProjects.DataSource    = _dataAccess.GetRedmineProjects(Convert.ToBoolean(ConfigurationManager.AppSettings["UseAllProjects"]));
            lstbProjects.DisplayMember = "display_name";
            lstbProjects.ValueMember   = "id";
        }