Ejemplo n.º 1
0
        public ServerSettingsForm()
        {
            InitializeComponent();
            InitializingProviderTypes();
            LoadConnectionStrings();

            if (Server.ConnectionString.Length > 0)
            {
                uiConnectionStringComboList.SelectedIndex = uiConnectionStringComboList.FindString(Server.ConnectionString.Trim());
                uiProviderTypeSelection.SelectedIndex     = (int)Server.ProviderType;
            }
        }
Ejemplo n.º 2
0
 void UpdateComboBox(KryptonComboBox box, string findText)
 {
     // FIXME: При установке текста в комбо он выделяется, а не должен (причем в стандартном ComboBox такого нет)
     if (string.IsNullOrEmpty(findText))
     {
         box.Text = string.Empty;
     }
     else
     {
         int c = box.FindString(findText);
         if (c != -1)
         {
             box.SelectedIndex   = c;
             box.SelectionStart  = findText.Length;
             box.SelectionLength = box.Text.Length - box.SelectionStart;
         }
         else
         {
             box.Text = findText;
         }
     }
 }
Ejemplo n.º 3
0
    public string fill_combo_withauthority(string dept_or_table, KryptonComboBox cmb, DataTable dt)
    {
        string str = "";

        if (MODULE.glb["GROUPID"] == "1")
        {
            str = "HOD";
            if (dept_or_table.ToUpper() == "DEPT")
            {
                fillcombo(cmb, dt);
                cmb.SelectedIndex = cmb.FindString(MODULE.glb["DEPTNAME"].ToString());
                cmb.Enabled       = false;
            }
            else if (dept_or_table.ToUpper() == "TABLE")
            {
                fillcombo_withall(cmb, dt);
            }
        }
        if (MODULE.glb["GROUPID"] == "2")
        {
            str = "TABLE";
            if (dept_or_table.ToUpper() == "DEPT")
            {
                fillcombo(cmb, dt);
                cmb.SelectedIndex = cmb.FindString(MODULE.glb["DEPTNAME"].ToString());
                cmb.Enabled       = false;
            }
            else if (dept_or_table.ToUpper() == "TABLE")
            {
                fillcombo(cmb, dt);
                cmb.SelectedIndex = cmb.FindString(MODULE.glb["TABLENAME"].ToString());
                cmb.Enabled       = false;
            }
        }

        if (MODULE.glb["GROUPID"] == "3")
        {
            str = "HIGHERLEVELADMIN";
            fillcombo_withall(cmb, dt);
        }

        if (MODULE.glb["GROUPID"] == "4")
        {
            str = "HIGHERLEVEL";
            fillcombo_withall(cmb, dt);
        }
        if (MODULE.glb["GROUPID"] == "5")
        {
            str = "INWARDOPERATOR";
            fillcombo_withall(cmb, dt);
        }
        if (MODULE.glb["GROUPID"] == "6")
        {
            str = "SOFTWAREADMIN";
            fillcombo_withall(cmb, dt);
        }
        if (MODULE.glb["GROUPID"] == "7")
        {
            str = "DEVELOPER";
        }
        return(str);
    }
 /// <summary>
 /// Finds the first item in the combo box that starts with the specified string.
 /// </summary>
 /// <param name="str">The String to search for.</param>
 /// <returns>The zero-based index of the first item found; returns -1 if no match is found.</returns>
 public int FindString(string str)
 {
     return(_comboBox.FindString(str));
 }