예제 #1
0
        // '''''''''''''''''''''''''''''''''
        // '' Combobox related functions '''
        // '''''''''''''''''''''''''''''''''

        internal static void LoadCombo(string Table, Mobilize.Web.ComboBox combo, string field, string valueField = "")
        {
            modConnection.ExecuteSql("Select * From " + Table);
            combo.Items.Clear();
            // UPGRADE_WARNING: (2080) IsEmpty was upgraded to a comparison and has a new behavior. More Information: https://www.mobilize.net/vbtonet/ewis/ewi2080
            if (!string.IsNullOrEmpty(valueField))
            {
                while (!modConnection.rs.EOF)
                {
                    combo.AddItem(Convert.ToString(modConnection.rs[field]));
                    combo.SetItemData(combo.GetNewIndex(), Convert.ToInt32(modConnection.rs[valueField]));
                    modConnection.rs.MoveNext();
                }
            }
            else
            {
                while (!modConnection.rs.EOF)
                {
                    combo.AddItem(Convert.ToString(modConnection.rs[field]));
                    modConnection.rs.MoveNext();
                }
            }

            // If strDefault <> Empty Then
            // combo = strDefault
            // End If
        }
예제 #2
0
        internal static bool ComboEmpty(Mobilize.Web.ComboBox combo, object strip = null, int Index = 0)
        {
            bool result = false;

            if (combo.SelectedIndex == -1)
            {
                result = true;
                Mobilize.Web.MessageBox.Show("Please select an option from the list", System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).ProductName, Mobilize.Web.MessageBoxButtons.OK, Mobilize.Web.MessageBoxIcon.Exclamation);
                //UPGRADE_WARNING: (2080) IsEmpty was upgraded to a comparison and has a new behavior. More Information: https://www.mobilize.net/vbtonet/ewis/ewi2080
                if (!Index.Equals(0))
                {
                    //strip.SelectedItem = strip.Tabs(Index)
                }
                combo.Focus();
            }
            else
            {
                result = false;
            }
            return(result);
        }