Example #1
0
 private void fillIDS()
 {
     if (cmbWizardType.SelectedValue.ToString() == addNewAccount)
     {
         using (SqlConnection sqlConnection = new SqlConnection(FrmWizard.GetFromWizardSettings("OLTP.Connection.string")))
         {
             sqlConnection.Open();
             using (SqlCommand sqlCommand = new SqlCommand("SELECT (MAX(Account_ID)+1) FROM User_GUI_Account", sqlConnection))
             {
                 txtAccountID.Text = sqlCommand.ExecuteScalar().ToString();
             }
         }
         FillClientID(int.Parse(txtAccountID.Text));
         FillScopeID(int.Parse(txtAccountID.Text));
     }
 }
        private void FillCPAReplaceComboBox()
        {
            cmbCpaReplaceTo.DataSource = null;
            List <string> comboValues = new List <string>();


            //Load default values from app.config
            string[] googleDefaultValues = FrmWizard.GetFromWizardSettings("EdgeBI.Wizards.GoogleConversions").Split(',');

            foreach (string str in googleDefaultValues)
            {
                string itemReplaced = str;
                foreach (ListViewItem item in listViewBeData.Items)
                {
                    if (item.Text == str)
                    {
                        itemReplaced = item.SubItems[1].Text;
                        break;
                    }
                }
                comboValues.Add(itemReplaced);
            }

            foreach (ListViewItem item in listViewBeData.Items)
            {
                if (item.SubItems[0].Text.StartsWith("BO Client Specific"))
                {
                    comboValues.Add(item.SubItems[1].Text.Trim());
                }
            }



            cmbCpaReplaceTo.DataSource = comboValues;
            //cmbBeData.ValueMember = "Key";
            //cmbBeData.DisplayMember = "Value";

            //cmbCPA.DataSource = _CPAData.ToList();
            //cmbCPA.ValueMember = "Key";
            //cmbCPA.DisplayMember = "Value";
        }
        private void InitLaizeComboBoxs()
        {
            //Clean the combo boxs

            cmbBeData.DataSource = null;

            _BEDataValues.Clear();
            //Load default values from app.config
            string[] googleDefaultValues = FrmWizard.GetFromWizardSettings("EdgeBI.Wizards.GoogleConversions").Split(',');

            foreach (string str in googleDefaultValues)
            {
                if (!_BEDataValues.ContainsKey("AccountSettings." + str))
                {
                    _BEDataValues.Add("AccountSettings." + str, str);
                }
            }

            _BEDataValues.Add("BEData", "BEData");
            int numOfCpa = FrmWizard.GetCountLikeSettings("AccountSettings.ACQ");

            for (int i = 1; i <= numOfCpa; i++)
            {
                string value = "AccountSettings.ACQ" + i.ToString();
                if (!_CPAData.ContainsKey("AccountSettings." + value))
                {
                    _CPAData.Add("AccountSettings." + value, "Acquisition" + i.ToString());
                }
            }



            cmbBeData.DataSource    = _BEDataValues.ToList();
            cmbBeData.ValueMember   = "Key";
            cmbBeData.DisplayMember = "Value";

            cmbCPA.DataSource    = _CPAData.ToList();
            cmbCPA.ValueMember   = "Key";
            cmbCPA.DisplayMember = "Value";
        }
Example #4
0
 private void txtBIScopeID_Validated(object sender, EventArgs e)
 {
     try
     {
         int scopeId;
         if (int.TryParse(txtBIScopeID.Text.Trim(), out scopeId))
         {
             if (cmbWizardType.SelectedValue.ToString() == addNewBI || cmbWizardType.SelectedValue.ToString() == NewBIForActiveAccount)
             {
                 using (SqlConnection sqlConnection = new SqlConnection(FrmWizard.GetFromWizardSettings("OLTP.Connection.string")))
                 {
                     sqlConnection.Open();
                     using (SqlCommand sqlCommand = new SqlCommand(@"Select Account_Name 
                                                             From User_GUI_Account
                                                             Where Scope_ID=@Scope_ID", sqlConnection))
                     {
                         sqlCommand.Parameters.AddWithValue("@Scope_ID", int.Parse(txtBIScopeID.Text.Trim()));
                         using (SqlDataReader reader = sqlCommand.ExecuteReader())
                         {
                             if (reader.Read())
                             {
                                 txtBIScopName.Text = reader[0].ToString();
                             }
                         }
                         if (cmbWizardType.SelectedValue.ToString() == NewBIForActiveAccount && !string.IsNullOrEmpty(txtBIScopeID.Text))
                         {
                             txtRole.Text = string.Format("Role {0}", txtBIScopeID.Text.Trim());
                         }
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }