Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        private void CompleteBoxes()
        {
            ConfigurationManager.RefreshSection("combit.RedmineReports.Properties.Settings.RedmineConnectionString");
            string convertString = ConfigurationManager.ConnectionStrings["combit.RedmineReports.Properties.Settings.RedmineConnectionString"].ConnectionString;

            if (RedmineReportsConfigDataHelper.ConnectionStringEncrypted(convertString))
            {
                //decrypt connectionstring
                convertString = RedmineReportsConfigDataHelper.DecryptData(convertString);
            }

            Match m = Regex.Match(convertString, "server=([^;]*);uid=([^;]*);pwd=([^;]*);database=([^;]*);port=([^;]*);");

            ipAddressTextBox.Text  = m.Groups[1].Value;
            mySQLLogTextBox.Text   = m.Groups[2].Value;
            mySQLPasssTextBox.Text = m.Groups[3].Value;
            dbNameTextBox.Text     = m.Groups[4].Value;
            mySqlPortTextBox.Text  = m.Groups[5].Value;
        }