// Search departmental heads
        public void searchDepartmentalHeads()
        {
            searchDepartmentalHeadStaffIdTextBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            searchDepartmentalHeadStaffIdTextBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
            AutoCompleteStringCollection collection = new AutoCompleteStringCollection();

            sqlConnection = new MySqlConnection(databaseConnection);

            try
            {
                sqlConnection.Open();

                MySqlCommand sqlCommand = new MySqlCommand("SELECT * FROM departmental_heads", sqlConnection);
                MySqlDataReader reader = sqlCommand.ExecuteReader();
                while (reader.Read())
                {
                    String name = reader.GetInt64("pfno").ToString();
                    collection.Add(name);
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show("Error has occured while seraching departmental head, : " + exception.Message);
            }

            searchDepartmentalHeadStaffIdTextBox.AutoCompleteCustomSource = collection;
        }
        private void AutoCompleteAnimalSerial()
        {
            //auto completes Employee name in check out page.
            textBoxTreatmentSerial.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            textBoxTreatmentSerial.AutoCompleteSource = AutoCompleteSource.CustomSource;
            AutoCompleteStringCollection collection1 = new AutoCompleteStringCollection();

            textBoxFoodAnimalSerial.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            textBoxFoodAnimalSerial.AutoCompleteSource = AutoCompleteSource.CustomSource;
            AutoCompleteStringCollection collection2 = new AutoCompleteStringCollection();

            SqlConnection connection = new SqlConnection(connectionString);
            string commandString = "SELECT aserial FROM animal";
            SqlCommand command = new SqlCommand(commandString, connection);
            SqlDataReader myReader;
            try
            {
                connection.Open();
                myReader = command.ExecuteReader();
                while (myReader.Read())
                {
                    string value = myReader["aserial"].ToString();
                    collection1.Add(value);
                    collection2.Add(value);
                }
                connection.Close();
            }
            catch (SqlException ex)
            {
                MessageBox.Show(ex.Message);
            }
            textBoxTreatmentSerial.AutoCompleteCustomSource = collection1;
            textBoxFoodAnimalSerial.AutoCompleteCustomSource = collection2;
            NameShadeShow();
        }
        /// <summary>The find object form_ shown.</summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The e.</param>
        private void FindObjectForm_Shown(object sender, EventArgs e)
        {
            var collection = new AutoCompleteStringCollection();

            try
            {
                UseWaitCursor = true;

                if (_databaseInspector.DbSchema == null)
                {
                    _databaseInspector.LoadDatabaseDetails();
                }

                foreach (DbModelTable table in _databaseInspector.DbSchema.Tables)
                {
                    collection.Add(table.FullName);
                }

                foreach (DbModelView view in _databaseInspector.DbSchema.Views)
                {
                    collection.Add(view.FullName);
                }
            }
            finally
            {
                UseWaitCursor = false;
            }

            cboObjects.AutoCompleteCustomSource = collection;
        }
Exemple #4
0
 public void Initialize()
 {
     SetFormHeader();
     AutoCompleteStringCollection cmbstrName = new AutoCompleteStringCollection();
     AutoCompleteStringCollection cmbstrJer = new AutoCompleteStringCollection();
     DataRow drTeam = ObjUdtprovider.CurrentDataSet.Tables[2].Select("Name = '" + Team+"'").FirstOrDefault();
     if (drTeam != null)
     {
         DataRow[] drPlayers = ObjUdtprovider.CurrentDataSet.Tables[3].Select("T24_ID = '" + drTeam["T24_ID"] + "' AND Playing=true");
         cmbPlayerJer.Items.Clear();
         cmbPlayerName.Items.Clear();
         foreach (DataRow item in drPlayers)
         {
             cmbPlayerName.Items.Add(item["First Name"]);
             cmbstrName.Add(item["First Name"].ToString());
             cmbPlayerJer.Items.Add(item["Jersey No"]);
             cmbstrJer.Add(item["Jersey No"].ToString());
         }
         cmbPlayerName.SelectedIndex = 1;
         cmbPlayerJer.SelectedIndex = 1;
         cmbPlayerName.AutoCompleteMode = AutoCompleteMode.Suggest;
         cmbPlayerName.AutoCompleteSource = AutoCompleteSource.CustomSource;
         cmbPlayerName.AutoCompleteCustomSource = cmbstrName;
         cmbPlayerJer.AutoCompleteMode = AutoCompleteMode.Suggest;
         cmbPlayerJer.AutoCompleteSource = AutoCompleteSource.CustomSource;
         cmbPlayerJer.AutoCompleteCustomSource = cmbstrJer;
     }
 }
		private void SetupElements(NationSelectForm nationSelectForm, Nation selectedNation, int numberOfCrewSlots)
		{
			_nationSelectForm = nationSelectForm;
			_selectedNation = selectedNation;
			_numberOfCrewSlots = numberOfCrewSlots;
			_vehicleType = new VehicleType();	// Crappy default value
			_crewSlotData = Helpers.LoadCrewSlotDataFromFile(CrewSlotDataFileName) ?? new List<CrewSlotData>();	// Load from file, if null is returned, creates a new (empty) list

			if (_crewSlotData.Count < 1) // Happens only when nothing comes from reading the file with data.
			{
				_crewSlotData.Add(new CrewSlotData(_selectedNation));
			}

			#region Setup fields for form controls
			List<string> vehicleNames = Helpers.LoadVehicleDataFromJson(Helpers.GetVehicleJsonDataForNation(_selectedNation)).OrderBy(v => v.VehicleName).Select(v => v.VehicleName).ToList();
			_faytVehicleSource = new AutoCompleteStringCollection();
			_faytVehicleSource.AddRange(vehicleNames.ToArray());

			List<string> vehicleTypes = Helpers.LoadVehicleTypesDataFromJson(Helpers.GetVehicleTypesJsonData()).OrderBy(t => t.VehicleTypeLongName).Select(t => t.VehicleTypeLongName).ToList();
			_faytVehicleTypeSource = new AutoCompleteStringCollection();
			_faytVehicleTypeSource.AddRange(vehicleTypes.ToArray());

			_crewSlotConfigurations = new List<CrewSlotConfiguration>();
			_crewSlotGroupBoxes = new Dictionary<int, GroupBox>();
			_crewNameComboBoxes = new Dictionary<int, ComboBox>();
			_crewTrainedMembersNumericScrollers = new Dictionary<int, NumericUpDown>();
			_crewVehicleTypeComboBoxes = new Dictionary<int, ComboBox>();
			#endregion

			SetFormHeight();
			Helpers.ChangeBackground(this, selectedNation);
			PopulateFormControls();
		}
        /// <summary>Reloads the repo's objects tree.</summary>
        public void Reload()
        {
            // todo: task exception handling
            Cancel();
            _cancelledTokenSource = new CancellationTokenSource();
            var token = _cancelledTokenSource.Token;
            var tasks = rootNodes.Select(r => r.ReloadTask(token)).ToArray();
            Task.Factory.ContinueWhenAll(tasks,
                (t) =>
                {
                    if (!t.All(r => r.Status == TaskStatus.RanToCompletion))
                    {
                        return;
                    }
                    if (token.IsCancellationRequested)
                    {
                        return;
                    }
                    BeginInvoke(new Action(() =>
                    {
                        var autoCompletionSrc = new AutoCompleteStringCollection();
                        autoCompletionSrc.AddRange(
                            _branchFilterAutoCompletionSrc.ToArray());

                        txtBranchFilter.AutoCompleteCustomSource = autoCompletionSrc;
                    }));
                }, _cancelledTokenSource.Token);
            tasks.ToList().ForEach(t => t.Start());
        }
Exemple #7
0
 private void addCarnets(AutoCompleteStringCollection DataCollection)
 {
     foreach (Alumnos Alumno in Alumnos)
     {
         DataCollection.Add(Alumno.carnet + " - " + Alumno.nombres );
     }
 }
        private void frmDodjelaPrava_Load(object sender, EventArgs e)
        {
            // key/value for combobox source
            List<KeyValuePair<string, string>> data = new List<KeyValuePair<string, string>>();
            // autocomplete for user's combobox
            AutoCompleteStringCollection autocomplete = new AutoCompleteStringCollection();

            // text inside combobox: Name Surname (username)
            // value: username
            foreach (iUser korisnik in piLogin.GetUser())
            {
                data.Add(new KeyValuePair<string, string> (korisnik.UserName, korisnik.Name + " " + korisnik.Surname + " (" + korisnik.UserName + ")"));
                autocomplete.Add(korisnik.Name + " " + korisnik.Surname + " (" + korisnik.UserName + ")");
            }

            // set datasource for user's combobox
            cmbKorisnik.DataSource = new BindingSource(data, null);
            cmbKorisnik.DisplayMember = "Value";
            cmbKorisnik.ValueMember = "Key";

            // set autocomplete source and mode
            cmbKorisnik.AutoCompleteSource = AutoCompleteSource.CustomSource;
            cmbKorisnik.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            cmbKorisnik.AutoCompleteCustomSource = autocomplete;

            // set role items
            cmbUloga.Items.Add("Odobravanje");
            cmbUloga.Items.Add("Likvidatura");

            // if user is set, select it from combobox
            if (this.korisnik != null)
            {
                cmbKorisnik.SelectedValue = this.korisnik.UserName;
            }
        }
        static void Main()
        {
            if (Directory.Exists(GetCheetahFolder()) == false)
                Directory.CreateDirectory(GetCheetahFolder());
            WebConfig conf = WebConfig.Default;
#if DEBUG
            conf.LogFile = Application.StartupPath + @"\log.txt";
            conf.LogSeverity = ChromiumEngine.Enum.LogSeverity.Verbose;
#endif
            if (Directory.Exists(GetCheetahFolder() + @"\Cache\") == false)
                Directory.CreateDirectory(GetCheetahFolder() + @"\Cache\");
            conf.CachePath = GetCheetahFolder() + @"\Cache\";
            WebCore.Initialize(conf);
            History.initialize();
            Bookmarking.initialize();
            autocompletedata = new AutoCompleteStringCollection();
            for (int i = 0; i < History.GetItemsCount() - 1; i++)
                autocompletedata.Add(History.Url(i));
            for (int i = 0; i < Bookmarking.GetItemsCount() - 1; i++)
                autocompletedata.Add(Bookmarking.Url(i));
            AuthenticationPasswords.Initialize();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(true);
            Application.Run(new Form1());
            WebCore.ShutDown();
        }
Exemple #10
0
        private void textBox1_TextChanged_1(object sender, EventArgs e)
        {
            AutoCompleteStringCollection names = new AutoCompleteStringCollection();
            textBox1.AutoCompleteMode = AutoCompleteMode.Suggest;
            textBox1.AutoCompleteSource = AutoCompleteSource.CustomSource;
            string server = "MYSQL5009.HostBuddy.com";
            string database = "db_9cf135_hawk";
            string uid = "9cf135_hawk";
            string password = "******";
            string connectionString;
            connectionString = "SERVER=" + server + ";" + "DATABASE=" +
            database + ";" + "UID=" + uid + ";" + "PASSWORD="******";";
            MySqlConnection con = new MySqlConnection(connectionString);
            con.Open();
            MySqlCommand cms = new MySqlCommand("select * from user", con);
            MySqlDataReader dr = cms.ExecuteReader();
            while (dr.Read())
            {
                names.Add(dr[1].ToString());
            }

            dr.Close();
            con.Close();
            textBox1.AutoCompleteCustomSource = names;
        }
        private void AddRestrictForm_Load(object sender, EventArgs e)
        {
            AutoCompleteStringCollection c = new AutoCompleteStringCollection();
            c.AddRange(this.SuggestProperties);
            txtPropertyName.AutoCompleteCustomSource = c;

            AutoCompleteStringCollection c1 = new AutoCompleteStringCollection();
            c1.AddRange(this.SuggestRoles);
            txtRole.AutoCompleteCustomSource = c1;

            if (Xml != null)
            {
                string type = Xml.GetAttribute("Type");
                if (type.Equals("PropertyEquals",StringComparison.CurrentCulture))
                {
                    rbPropertyEquals.Checked = true;
                    txtPropertyName.Text = Xml.GetAttribute("Property");
                    txtPropertyValue.Text = Xml.GetAttribute("Value");
                }
                else if (type.Equals("RoleContain", StringComparison.CurrentCulture))
                {
                    rbRoleContain.Checked = true;
                    txtRole.Text = Xml.GetAttribute("Role");
                }
                else
                {
                    rbDB.Checked = true;
                    txtSQL.Text = Xml.InnerText.Trim();
                }
            }
        }
 public frmArticulosBorradoMasivo()
 {
     InitializeComponent();
     System.Drawing.Icon ico = Properties.Resources.icono_app;
     this.Icon = ico;
     this.Text = "  Borrado de artículos sin stock";
     this.ControlBox = true;
     this.MaximizeBox = false;
     FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
     cmbGenero.Validating += new System.ComponentModel.CancelEventHandler(BL.Utilitarios.ValidarComboBox);
     cmbGenero.KeyDown += new System.Windows.Forms.KeyEventHandler(BL.Utilitarios.EnterTab);
     DataTable tblGeneros = BL.GetDataBLL.Generos();
     cmbGenero.ValueMember = "IdGeneroGEN";
     cmbGenero.DisplayMember = "DescripcionGEN";
     cmbGenero.DropDownStyle = ComboBoxStyle.DropDown;
     cmbGenero.DataSource = tblGeneros;
     cmbGenero.SelectedValue = -1;
     AutoCompleteStringCollection generosColection = new AutoCompleteStringCollection();
     foreach (DataRow row in tblGeneros.Rows)
     {
         generosColection.Add(Convert.ToString(row["DescripcionGEN"]));
     }
     cmbGenero.AutoCompleteCustomSource = generosColection;
     cmbGenero.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
     cmbGenero.AutoCompleteSource = AutoCompleteSource.CustomSource;
 }
Exemple #13
0
        public MainWindow()
        {
            InitializeComponent();

            using (var db = new MySqlContext())
            {
                var permissions = from a in db.Permissions
                                  select a.Name;
                this.checkedListBox_permissions.Items.AddRange(permissions.ToArray());
                this.checkedListBox_modificar_permissions.Items.AddRange(permissions.ToArray());

                var users = from b in db.LoginModels
                            select b.User;
                this.checkedListBox_users.Items.AddRange(users.ToArray());
                this.checkedListBox_modificar_users.Items.AddRange(users.ToArray());

                var roles = from r in db.Roles
                            select r.Name;
                AutoCompleteStringCollection accl = new AutoCompleteStringCollection();
                accl.AddRange(roles.ToArray());

                txt_rol_nombre.AutoCompleteMode = AutoCompleteMode.Suggest;
                txt_rol_nombre.AutoCompleteCustomSource = accl;
                txt_rol_nombre.AutoCompleteSource = AutoCompleteSource.CustomSource;

                txt_modificar_nombre.AutoCompleteMode = AutoCompleteMode.Suggest;
                txt_modificar_nombre.AutoCompleteCustomSource = accl;
                txt_modificar_nombre.AutoCompleteSource = AutoCompleteSource.CustomSource;

            }
        }
Exemple #14
0
        private void Autocomplete()
        {
            try
            {
                con = new OleDbConnection(cs);
                con.Open();
                OleDbCommand cmd = new OleDbCommand("SELECT distinct ProductName FROM product", con);
                DataSet ds = new DataSet();
                OleDbDataAdapter da = new OleDbDataAdapter(cmd);
                da.Fill(ds, "Product");
                AutoCompleteStringCollection col = new AutoCompleteStringCollection();
                int i = 0;
                for (i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
                {
                    col.Add(ds.Tables[0].Rows[i]["productname"].ToString());

                }
                txtProductName.AutoCompleteSource = AutoCompleteSource.CustomSource;
                txtProductName.AutoCompleteCustomSource = col;
                txtProductName.AutoCompleteMode = AutoCompleteMode.Suggest;

                con.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        // Search department
        public void searchJobCategory()
        {
            searchJobCategoryName.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            searchJobCategoryName.AutoCompleteSource = AutoCompleteSource.CustomSource;
            AutoCompleteStringCollection collection = new AutoCompleteStringCollection();

            sqlConnection = new MySqlConnection(databaseConnection);

            try
            {
                sqlConnection.Open();

                MySqlCommand sqlCommand = new MySqlCommand("SELECT * FROM job_category", sqlConnection);
                MySqlDataReader reader = sqlCommand.ExecuteReader();
                while (reader.Read())
                {
                    String name = reader.GetString("name");
                    collection.Add(name);
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show("Error has occured while seraching department, : " + exception.Message);
            }

            searchJobCategoryName.AutoCompleteCustomSource = collection;
        }
Exemple #16
0
        private void CargarComboClientesTodos(long IdUsuario, string Busqueda)
        {
            var timer = System.Diagnostics.Stopwatch.StartNew();
            //Llena el combo con la lista de Targets
            CboCliente.ResetText();
            IList<clsClienteMaster> ListaClienteMaster = LogicaNegocios.Clientes.clsClientesMaster.ListarClienteMaster(Busqueda, Enums.TipoPersona.Comercial, Enums.Estado.Todos, true);

            ComboBoxItemCollection coll = CboCliente.Properties.Items;
            coll.Add(Utils.Utils.ObtenerPrimerItem());
            foreach (var list in ListaClienteMaster) {
                coll.Add(list);
            }

            CboCliente.SelectedIndex = 0;

            AutoCompleteStringCollection textoAutocompletar = new AutoCompleteStringCollection();
            textoAutocompletar = new AutoCompleteStringCollection();

            CboCliente.MaskBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            CboCliente.MaskBox.AutoCompleteSource = AutoCompleteSource.CustomSource;

            foreach (var list in ListaClienteMaster) {
                textoAutocompletar.Add(list.NombreCliente);
            }
            CboCliente.MaskBox.AutoCompleteCustomSource = textoAutocompletar;
            ClsLogPerformance.Save(new LogPerformance(Base.Usuario.UsuarioConectado.Usuario, timer.Elapsed.TotalSeconds));
        }
Exemple #17
0
        private void BuildSearchSuggestions()
        {
            var artistStrings = new List<string>();
            var titleStrings = new List<string>();

            foreach (var item in _libraryManager.GetTablatureItems())
            {
                if (artistStrings.Find(x => x.Equals(item.File.Artist, StringComparison.OrdinalIgnoreCase)) == null)
                    artistStrings.Add(item.File.Artist);

                var title = TablatureUtilities.RemoveVersionConventionFromTitle(item.File.Title);
                if (titleStrings.Find(x => x.Equals(title, StringComparison.OrdinalIgnoreCase)) == null)
                    titleStrings.Add(title);
            }

            var artistSuggestions = new AutoCompleteStringCollection();
            var titleSuggestions = new AutoCompleteStringCollection();

            foreach (var str in artistStrings)
                artistSuggestions.Add(str);

            foreach (var str in titleStrings)
                titleSuggestions.Add(str);

            txtSearchArtist.AutoCompleteCustomSource = artistSuggestions;
            txtSearchTitle.AutoCompleteCustomSource = titleSuggestions;
        }
Exemple #18
0
        public EDDiscoveryForm()
        {
            InitializeComponent();

            EDDConfig = new EDDConfig();

            //_fileTgcSystems = Path.Combine(Tools.GetAppDataDirectory(), "tgcsystems.json");
            _fileEDSMDistances = Path.Combine(Tools.GetAppDataDirectory(), "EDSMDistances.json");

            string logpath="";
            try
            {
                logpath = Path.Combine(Tools.GetAppDataDirectory(), "Log");
                if (!Directory.Exists(logpath))
                {
                    Directory.CreateDirectory(logpath);
                }

            }
            catch (Exception ex)
            {
                Trace.WriteLine($"Unable to create the folder '{logpath}'");
                Trace.WriteLine($"Exception: {ex.Message}");
            }
            _edsmSync = new EDSMSync(this);

            trilaterationControl.InitControl(this);
            travelHistoryControl1.InitControl(this);
            imageHandler1.InitControl(this);

            SystemNames = new AutoCompleteStringCollection();
            Map = new EDDiscovery2._3DMap.MapManager();
        }
 public UC_mailSearchWeb()
 {
     InitializeComponent();
     m_identifier = Page.MailSearchWeb;
     m_next = Page.Gesture;
     m_previous = Page.Action;
     lbl_icon.Text = Translation.GetText("C_SearchOpenWeb_lbl_icon");
     m_timer = new Timer();
     m_timer.Interval = 2000;
     m_timer.Tick += new EventHandler(m_timer_Tick);
     m_webIconExtractor = new Favicon();
     m_webIconExtractor.IconObatined += new Favicon.DlgIconObtained(IconObtained);
     m_autoCompleteSearchItems = new AutoCompleteStringCollection();
     m_autoCompleteSearchItems.AddRange(new string[] {
         "http://www.google.com/search?&q=(*)",
         "http://en.wikipedia.org/w/index.php?&search=(*)",
         "http://maps.google.com/maps?q=(*)",
         "http://translate.google.com/#auto|en|(*)",
         "http://www.last.fm/search?q=(*)",
         "http://www.imdb.com/find?s=all&q=(*)",                
         "http://search.yahoo.com/search?p=(*)",
         "http://www.bing.com/search?q=(*)",                
         "http://search.seznam.cz/?q=(*)",
         "http://www.slovnik.seznam.cz/?q=(*)&lang=en_cz",                
         "http://www.mapy.cz/?query=(*)",
         "http://www.csfd.cz/hledani-filmu-hercu-reziseru-ve-filmove-databazi/?search=(*)"
     });
 }
Exemple #20
0
        public void initGui()
        {
            clg = new dataHandler.catalog(timeout: gpExtension.timeout);
            keyWords = new AutoCompleteStringCollection();
            keyWords.AddRange(  clg.getKeyWords().ToArray() );
            keywordTxt.AutoCompleteSource = AutoCompleteSource.CustomSource;
            keywordTxt.AutoCompleteCustomSource = keyWords;
            gdiThemes = clg.getGDIthemes();
            gdiThemes.Insert(0, "");
            GDIthemeCbx.DataSource = gdiThemes;

            orgNames = clg.getOrganisations();
            orgNames.Insert(0, "");
            orgNameCbx.DataSource = orgNames;

            dataBronnen = clg.getSources();
            List<string> bronnen = dataBronnen.Select(c => c.Key).ToList();
            bronnen.Insert(0, "");
            bronCatCbx.DataSource = bronnen;

            dataTypes = clg.dataTypes;
            List<string> dtypes = dataTypes.Select(c => c.Key).ToList();
            dtypes.Insert(0, "");
            typeCbx.DataSource = dtypes;

            inspKeyw = clg.inspireKeywords();
            inspKeyw.Insert(0, "");
            INSPIREthemeCbx.DataSource = inspKeyw;

            INSPIREannexCbx.DataSource = clg.inpireAnnex;

            INSPIREserviceCbx.DataSource = clg.inspireServiceTypes;

            filterResultsCbx.SelectedIndex = 0;
        }
		public static void EnableFaytAndDropDownList(ComboBox comboBox, AutoCompleteStringCollection dataSource)
		{
			comboBox.AutoCompleteCustomSource = dataSource;
			comboBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
			comboBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
			comboBox.DataSource = new BindingSource(dataSource, null);	//HACK: Stop combo boxes from staying in sync with one another
		}
Exemple #22
0
        public frmContacts()
        {
            InitializeComponent();

            Icon = Properties.Resources.logo;

            DataSet ds = Program.DB.SelectAll("SELECT ID,Name FROM Companies;");
            if (ds.Tables.Count > 0)
            {
                AutoCompleteStringCollection asCompanies = new AutoCompleteStringCollection();
                foreach (DataRow r in ds.Tables[0].Rows)
                {
                    string sName = r["Name"].ToString();
                    asCompanies.Add(sName);
                }
                txtCompanies.AutoCompleteCustomSource = asCompanies;
            }

            ds = Program.DB.SelectAll("SELECT ID,NameFirst,NameLast FROM Contacts;");
            if (ds.Tables.Count > 0)
            {
                foreach (DataRow r in ds.Tables[0].Rows)
                {
                    DevComponents.Editors.ComboItem i = new DevComponents.Editors.ComboItem();
                    i.Tag = r["ID"];
                    i.Text = r["NameFirst"].ToString() + " " + r["NameLast"].ToString();
                    cbxContact.Items.Add(i);
                }
            }
        }
Exemple #23
0
        void AutoComplte()
        {
            searchTextBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            searchTextBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
            AutoCompleteStringCollection coll=new AutoCompleteStringCollection();

              string  url = @"server=faruk\SQLEXPRESS; database=library; integrated security=true";
              SqlConnection  connection = new SqlConnection(url);

            connection.Open();

            string query = "select * from book_table";
            SqlCommand command = new SqlCommand(query, connection);
            SqlDataReader aReader = command.ExecuteReader();

            if (aReader.HasRows)
            {
                while (aReader.Read())
                {
                    string sname = aReader[1].ToString();
                    coll.Add(sname);
                }

            }

            searchTextBox.AutoCompleteCustomSource= coll;
            connection.Close();
        }
Exemple #24
0
        public void FillTheCustomerInfo(custVendor.CustVendorManager.custvendorinfo custInfo)
        {
            AutoCompleteStringCollection contactSource = new AutoCompleteStringCollection();
            if (custInfo.contact1.Length!=0)
            {
                tbContact.Text = custInfo.contact1;
                contactSource.Add(custInfo.contact1);
            }
            if (custInfo.contact2.Length!=0)
            {
                contactSource.Add(custInfo.contact2);
            }
            tbContact.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            tbContact.AutoCompleteSource = AutoCompleteSource.CustomSource;
            tbContact.AutoCompleteCustomSource = contactSource;

            tbCustomerAccount.Text = custInfo.cvnumber;
            tbFreightTerm.Text = custInfo.shippingTerm;
            tbPaymentTerm.Text = custInfo.paymentTerm;
            tbBillto.Text = custInfo.billTo;

            List<custVendor.CustVendorManager.custvendorinfoshipto> shipToList = custVendor.CustVendorManager.CustVenInfoManager.GetShipTo(custInfo.cvId);
            List<string> shipToListString = new List<string>();
            foreach (custVendor.CustVendorManager.custvendorinfoshipto shipto in shipToList)
            {
                shipToListString.Add(shipto.shipTo);
            }
               SetShipToList(shipToListString);
        }
Exemple #25
0
 public DGV_TextBoxCell()
     : base()
 {
     pAC = null;
       pACMode = AutoCompleteMode.None;
       pACSource = AutoCompleteSource.None;
 }
 public AutoCompleteStringCollection autoComplete()
 {
     AutoCompleteStringCollection collection = new AutoCompleteStringCollection();
     try
     {
         SqlConnectionObj.Open();
         string query = "select * from tbl_room";
         SqlCommandObj.CommandText = query;
         SqlDataReader reader = SqlCommandObj.ExecuteReader();
         while (reader.Read())
         {
             string roomNo = reader["roomNo"].ToString();
             collection.Add(roomNo);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     finally
     {
         if (SqlConnectionObj != null && SqlConnectionObj.State == ConnectionState.Open)
         {
             SqlConnectionObj.Close();
         }
     }
     return collection;
 }
Exemple #27
0
        //オートコンプリートの初期化
        public void AutoComplete_Init(TextBox tbx, string filename)
        {
            //オートコンプリート用インスタンス生成
            AutoCompleteStringCollection auto_scs = new AutoCompleteStringCollection();
            tbx.AutoCompleteCustomSource = auto_scs;

            string directory = Environment.GetEnvironmentVariable("LOCALAPPDATA") + "\\SCV";

            //iniファイル用ディレクトリの確認
            if (Directory.Exists(directory) == false)
            {
                DirectoryInfo di = Directory.CreateDirectory(directory);
            }

            //保存用 ini ファイルの読込/作成
            if (File.Exists(filename) == false)
            {
                FileStream fs = File.Create(filename);
                fs.Close();
            }

            //読み込んだファイル内容の反映
            foreach (string row in File.ReadLines(filename, SJIS))
            {
                auto_scs.Add(row);
            }
        }
        void AutocompleteText()
        {
            textBox5.AutoCompleteMode = AutoCompleteMode.Suggest;
            textBox5.AutoCompleteSource = AutoCompleteSource.CustomSource;
            AutoCompleteStringCollection coll = new AutoCompleteStringCollection();

            try
            {
                if (conn.State != ConnectionState.Open)
                {
                    conn.Open();
                }

                string sqluery = "SELECT * FROM MED_INFO WHERE MED_MGF='" + comboBox1.Text + "' ORDER BY MED_NAME";
                OracleCommand cd = new OracleCommand(sqluery, conn);
                OracleDataReader r;
                r = cd.ExecuteReader();
                while(r.Read())
                {
                    string sn = r.GetString(1);
                    coll.Add(sn);
                }

                r.Dispose();
                cd.Dispose();
                conn.Close();
            }
            catch (Exception exe)
            {
                MessageBox.Show(exe.Message);
            }

            textBox5.AutoCompleteCustomSource = coll;
        }
        //オートコンプリートの初期化
        public void AutoComplete_Init(TextBox tbx, string filename)
        {
            //オートコンプリート用インスタンス生成
            AutoCompleteStringCollection auto_scs = new AutoCompleteStringCollection();
            tbx.AutoCompleteCustomSource = auto_scs;

            string directory = Environment.GetEnvironmentVariable("LOCALAPPDATA") + "\\SCV";

            //保存用 ini ファイルの読込/作成
            if (File.Exists(filename) == false)
            {
                FileStream fs = File.Create(filename);
                fs.Close();
            }

            //読み込んだファイル内容をパスワードを復号化し反映
            foreach (string row in File.ReadLines(filename, SJIS))
            {
                auto_scs.Add(Decrypt(row));
            }


            //ファイルのサイズを取得
            System.IO.FileInfo fi = new System.IO.FileInfo(filename);
            long filesize = fi.Length;
            //ファイルの中身が空ではない場合、テキストボックスに初期値を追記
            if (filesize != 0)
            {
                //テキストファイルからすべての行を読み込む
                string[] lines = System.IO.File.ReadAllLines(filename);
                //最終行の値を追記                
                tbx.Text = (Decrypt(lines[lines.Length - 1]));
            }

        }
        //Initialization for AutoComplete
        public void AutoComplete_Init(TextBox tbx, string filename)
        {
            filename = path + filename;

            //Instantiation for AutoComplete
            AutoCompleteStringCollection auto_scs = new AutoCompleteStringCollection();
            tbx.AutoCompleteCustomSource = auto_scs;

            string directory = Environment.GetEnvironmentVariable("LOCALAPPDATA") + "\\SCV";

            //Checking of LOCALAPPDATA <C:\Users\AppData\Local> directory and file
            if (Directory.Exists(directory) == false)
            {
                DirectoryInfo di = Directory.CreateDirectory(directory);
            }

            if (File.Exists(filename) == false)
            {
                FileStream fs = File.Create(filename);
                fs.Close();
                this.file_flg = true;
            }

            //Reading file for AutoComplete
            foreach (string row in File.ReadLines(filename, SJIS))
            {
                if(row.Contains(","))
                {
                    string[] data = row.Split(',');
                    auto_scs.Add(data[0]);
                }
                else
                {
                    auto_scs.Add(row);
                }
            }

            //Auto Input from last history
            //Getting file size
            System.IO.FileInfo fi = new System.IO.FileInfo(filename);
            long filesize = fi.Length;
            //File is not null(or brank)
            if (filesize != 0)
            {
                //Reading all row from file
                string[] lines = System.IO.File.ReadAllLines(filename);
                //Input for history from last data   
                if (tbx.Name == "tbxUser")
                {
                    string[] data = (lines[lines.Length - 1]).Split(',');
                    tbx.Text = data[0];
                }
                else
                {
                    string data = lines[lines.Length - 1];
                    tbx.Text = data;
                }
            }
        }
Exemple #31
0
        private void FindSceneTable()
        {
            Scenes = new List <ISceneTableEntry>();

            if (IsMajora || !HasZ64TablesHack)
            {
                int increment = (IsMajora ? 16 : 20);

                DMATableEntry dma = Files.OrderBy(x => x.VStart).FirstOrDefault(x => x.FileType == DMATableEntry.FileTypes.Scene);

                for (int i = CodeData.Length - (increment * 2); i > 0; i -= 4)
                {
                    ISceneTableEntry entry = (!IsMajora ? (ISceneTableEntry) new SceneTableEntryOcarina(this, i, true) : (ISceneTableEntry) new SceneTableEntryMajora(this, i, true));
                    if (entry.GetSceneStartAddress() == dma.VStart && entry.GetSceneEndAddress() == dma.VEnd)
                    {
                        SceneTableAddress = i;
                        break;
                    }
                }

                if (SceneTableAddress != -1)
                {
                    for (int i = SceneTableAddress, j = 0; i < CodeData.Length - (16 * 16); i += increment)
                    {
                        ISceneTableEntry scn1 = (!IsMajora ? (ISceneTableEntry) new SceneTableEntryOcarina(this, i, true) : (ISceneTableEntry) new SceneTableEntryMajora(this, i, true));

                        if (!scn1.IsValid() && !scn1.IsAllZero())
                        {
                            break;
                        }

                        scn1.SetNumber((ushort)j);
                        if (!scn1.IsAllZero())
                        {
                            Scenes.Add(scn1);
                        }
                        j++;
                    }
                }
            }
            else
            {
                SceneTableAddress = Endian.SwapInt32(BitConverter.ToInt32(Data, Z64TablesAdrOffset));
                int cnt = Endian.SwapInt32(BitConverter.ToInt32(Data, Z64TablesAdrOffset + 4));
                for (int i = 0; i < cnt; i++)
                {
                    Scenes.Add(new SceneTableEntryOcarina(this, SceneTableAddress + (i * 20), false));
                }
            }

            SceneNameACStrings = new System.Windows.Forms.AutoCompleteStringCollection();
            foreach (ISceneTableEntry ste in Scenes)
            {
                ste.ReadScene();
                SceneNameACStrings.Add(ste.GetName());
            }
        }
Exemple #32
0
        public static AutoCompleteStringCollection AutoCompletarBuscarMunicipio()
        {
            DataTable dt = DatosAutoCompleteMunicipios();

            AutoCompleteStringCollection sc = new System.Windows.Forms.AutoCompleteStringCollection();

            foreach (DataRow row in dt.Rows)
            {
                sc.Add(Convert.ToString(row["Descripcion"]));
            }
            return(sc);
        }
Exemple #33
0
        public void MakeComboBox(System.Windows.Forms.ComboBox MSComBoBox, List <string> DanhSach)
        {
            System.Windows.Forms.AutoCompleteStringCollection str = new System.Windows.Forms.AutoCompleteStringCollection();

            foreach (string mem in DanhSach)
            {
                MSComBoBox.Items.Add(mem.Trim());
                str.Add(mem.Trim());
            }

            MSComBoBox.AutoCompleteCustomSource = str;
            MSComBoBox.AutoCompleteMode         = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
            MSComBoBox.AutoCompleteSource       = System.Windows.Forms.AutoCompleteSource.CustomSource;
        }
Exemple #34
0
        public frmLogin()
        {
            CheckForIllegalCrossThreadCalls = false;

            this.Text       = "";
            this.ControlBox = false;

            InitializeComponent();

            var pos = this.PointToScreen(lblMensagem.Location);

            pos = pictureBox1.PointToClient(pos);

            lblMensagem.Parent    = pictureBox1;
            lblMensagem.BackColor = Color.Transparent;

            chkManterAutenticacao.Parent    = pictureBox1;
            chkManterAutenticacao.BackColor = Color.Transparent;

            picLoader.Parent    = pictureBox1;
            picLoader.BackColor = Color.Transparent;

            _usuarios = Classes.Aplicacao.ListaUsuarios;
            txtUsuario.AutoCompleteCustomSource = _usuarios;


            if (!Classes.Aplicacao.UsuarioPadrao.Usuario.ToString().Equals(String.Empty) && !Classes.Aplicacao.UsuarioPadrao.Senha.ToString().Equals(String.Empty))
            {
                txtUsuario.Text = Classes.Aplicacao.UsuarioPadrao.Usuario.ToString();
                txtSenha.Text   = Classes.Aplicacao.UsuarioPadrao.Senha.ToString();

                txtSenha.UseSystemPasswordChar = true;
                chkManterAutenticacao.Checked  = true;

                btnEntrar.Focus();
            }

            txtUsuario.Focus();
        }
        private void FillFormFromRegistry()
        {
            if (!stateLoaded)
            {
                if (AppCuKey != null)
                {
                    // fill the various textboxes
                    SlurpFileHistory();

                    var s = (string)AppCuKey.GetValue(_rvn_XPathExpression);
                    if (s != null)
                    {
                        this.tbXpath.Text = s;
                    }

                    s = (string)AppCuKey.GetValue(_rvn_Prefix);
                    if (s != null)
                    {
                        this.tbPrefix.Text = s;
                    }

                    s = (string)AppCuKey.GetValue(_rvn_Xmlns);
                    if (s != null)
                    {
                        this.tbXmlns.Text = s;
                    }


                    // get the MRU list of XPath expressions
                    _xpathExpressionMruList = new System.Windows.Forms.AutoCompleteStringCollection();
                    string historyString = (string)AppCuKey.GetValue(_rvn_History, "");
                    if (!String.IsNullOrEmpty(historyString))
                    {
                        string[] items = historyString.Split('¡');
                        if (items != null && items.Length > 0)
                        {
                            //_xpathExpressionMruList.AddRange(items);
                            foreach (string item in items)
                            {
                                _xpathExpressionMruList.Add(item.XmlUnescapeIexcl());
                            }

                            // insert the most recent expression into the box?
                            this.tbXpath.Text = _xpathExpressionMruList[_xpathExpressionMruList.Count - 1];
                        }
                    }


                    // set the geometry of the form
                    s = (string)AppCuKey.GetValue(_rvn_Geometry);
                    if (!String.IsNullOrEmpty(s))
                    {
                        int[] p = Array.ConvertAll <string, int>(s.Split(','),
                                                                 new Converter <string, int>((t) => { return(Int32.Parse(t)); }));
                        if (p != null && p.Length == 5)
                        {
                            this.Bounds = ConstrainToScreen(new System.Drawing.Rectangle(p[0], p[1], p[2], p[3]));
                        }
                    }


                    // workitem 3392 - don't need this
                    // set the splitter
                    // s = (string)AppCuKey.GetValue(_rvn_Splitter);
                    // if (!String.IsNullOrEmpty(s))
                    //   {
                    //     try
                    //     {
                    //         int x = Int32.Parse(s);
                    //         this.splitContainer3.SplitterDistance = x;
                    //     }
                    //     catch { }
                    // }

                    stateLoaded = true;
                }
            }
        }
Exemple #36
0
        /// This app uses the windows registry to store config data for itself.
        ///     - creates a key for this DotNetZip Winforms app, if one does not exist
        ///     - stores and retrieves the most recent settings.
        ///     - this is done on a per user basis. (HKEY_CURRENT_USER)
        private void FillFormFromRegistry()
        {
            if (!stateLoaded)
            {
                if (AppCuKey != null)
                {
                    var s = (string)AppCuKey.GetValue(_rvn_DirectoryToZip);
                    if (s != null)
                    {
                        this.tbDirectoryToZip.Text     = s;
                        this.tbDirectoryInArchive.Text = System.IO.Path.GetFileName(this.tbDirectoryToZip.Text);
                    }

                    s = (string)AppCuKey.GetValue(_rvn_SelectionToZip);
                    if (s != null)
                    {
                        this.tbSelectionToZip.Text = s;
                    }

                    s = (string)AppCuKey.GetValue(_rvn_SelectionToExtract);
                    if (s != null)
                    {
                        this.tbSelectionToExtract.Text = s;
                    }

                    s = (string)AppCuKey.GetValue(_rvn_ZipTarget);
                    if (s != null)
                    {
                        this.tbZipToCreate.Text = s;
                    }

                    s = (string)AppCuKey.GetValue(_rvn_ZipToOpen);
                    if (s != null)
                    {
                        this.tbZipToOpen.Text = s;
                    }

                    s = (string)AppCuKey.GetValue(_rvn_ExtractLoc);
                    if (s != null)
                    {
                        this.tbExtractDir.Text = s;
                    }
                    else
                    {
                        this.tbExtractDir.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                    }

                    s = (string)AppCuKey.GetValue(_rvn_Encoding);
                    if (s != null)
                    {
                        SelectNamedEncoding(s);
                    }

                    s = (string)AppCuKey.GetValue(_rvn_Compression);
                    if (s != null)
                    {
                        SelectNamedCompressionLevel(s);
                    }
                    else
                    {
                        SelectNamedCompressionLevel("Default");
                    }

                    s = (string)AppCuKey.GetValue(_rvn_Encryption);
                    if (s != null)
                    {
                        SelectNamedEncryption(s);
                        this.tbPassword.Text = "";
                    }

                    int x = (Int32)AppCuKey.GetValue(_rvn_ZipFlavor, 0);
                    if (x >= 0 && x <= 2)
                    {
                        this.comboFlavor.SelectedIndex = x;
                    }

                    x = (Int32)AppCuKey.GetValue(_rvn_Zip64Option, 0);
                    if (x >= 0 && x <= 2)
                    {
                        this.comboZip64.SelectedIndex = x;
                    }

                    x = (Int32)AppCuKey.GetValue(_rvn_ExtractExistingFileAction, 0);
                    if (x >= 0 && x <= comboExistingFileAction.Items.Count)
                    {
                        this.comboExistingFileAction.SelectedIndex = x;
                    }

                    x = (Int32)AppCuKey.GetValue(_rvn_FormTab, 1);
                    if (x == 0 || x == 1)
                    {
                        this.tabControl1.SelectedIndex = x;
                    }

                    x = (Int32)AppCuKey.GetValue(_rvn_HidePassword, 1);
                    this.chkHidePassword.Checked = (x != 0);

                    x = (Int32)AppCuKey.GetValue(_rvn_OpenExplorer, 1);
                    this.chkOpenExplorer.Checked = (x != 0);

                    x = (Int32)AppCuKey.GetValue(_rvn_TraverseJunctions, 1);
                    this.chkTraverseJunctions.Checked = (x != 0);

                    x = (Int32)AppCuKey.GetValue(_rvn_RecurseDirs, 1);
                    this.chkRecurse.Checked = (x != 0);

                    x = (Int32)AppCuKey.GetValue(_rvn_RemoveFiles, 1);
                    this.chkRemoveFiles.Checked = (x != 0);


                    // get the MRU list of selection expressions
                    _selectionCompletions = new System.Windows.Forms.AutoCompleteStringCollection();
                    string history = (string)AppCuKey.GetValue(_rvn_SelectionCompletions, "");
                    if (!String.IsNullOrEmpty(history))
                    {
                        string[] items = history.Split('¡');
                        if (items != null && items.Length > 0)
                        {
                            foreach (string item in items)
                            {
                                _selectionCompletions.Add(item.XmlUnescapeIexcl());
                            }
                        }
                    }



                    // set the geometry of the form
                    s = (string)AppCuKey.GetValue(_rvn_Geometry);
                    if (!String.IsNullOrEmpty(s))
                    {
                        int[] p = Array.ConvertAll <string, int>(s.Split(','),
                                                                 new Converter <string, int>((t) => { return(Int32.Parse(t)); }));
                        if (p != null && p.Length == 5)
                        {
                            this.Bounds = ConstrainToScreen(new System.Drawing.Rectangle(p[0], p[1], p[2], p[3]));

                            // Starting a window minimized is confusing...
                            //this.WindowState = (FormWindowState)p[4];
                        }
                    }

                    AppCuKey.Close();
                    AppCuKey = null;

                    tbPassword_TextChanged(null, null);

                    stateLoaded = true;
                }
            }
        }
Exemple #37
0
        private void FindObjectTable()
        {
            Objects            = new List <ObjectTableEntry>();
            ObjectTableAddress = 0;
            ObjectCount        = 0;

            EntranceTableAddress = 0;

            if (!HasZ64TablesHack)
            {
                int inc = 8;
                for (int i = (int)ActorTableAddress; i < CodeData.Length - (8 * 8); i += inc)
                {
                    ObjectCount = Endian.SwapUInt16(BitConverter.ToUInt16(CodeData, i - 2));
                    if (ObjectCount < 0x100 || ObjectCount > 0x300)
                    {
                        continue;
                    }

                    ObjectTableEntry obj1 = new ObjectTableEntry(this, i, true);
                    ObjectTableEntry obj2 = new ObjectTableEntry(this, i + 8, true);
                    ObjectTableEntry obj3 = new ObjectTableEntry(this, i + 16, true);

                    if (obj1.IsEmpty == true && obj2.IsValid == true && obj3.IsValid == true && Objects.Count == 0)
                    {
                        ObjectTableAddress = i;
                        break;
                    }
                }

                if (ObjectTableAddress != 0 && ObjectCount != 0)
                {
                    int i, j = 0;
                    for (i = ObjectTableAddress; i < (ObjectTableAddress + (ObjectCount * 8)); i += 8)
                    {
                        Objects.Add(new ObjectTableEntry(this, i, true, (ushort)j));
                        j++;
                    }

                    if (!IsMajora)
                    {
                        EntranceTableAddress = i + (i % 16);
                    }
                }
            }
            else
            {
                ObjectTableAddress = Endian.SwapInt32(BitConverter.ToInt32(Data, Z64TablesAdrOffset + 8));
                ObjectCount        = (ushort)Endian.SwapInt32(BitConverter.ToInt32(Data, Z64TablesAdrOffset + 12));
                for (int i = 0; i < ObjectCount; i++)
                {
                    Objects.Add(new ObjectTableEntry(this, ObjectTableAddress + i * 8, false, (ushort)i));
                }
            }

            ObjectNameACStrings = new System.Windows.Forms.AutoCompleteStringCollection();
            foreach (ObjectTableEntry obj in Objects)
            {
                ObjectNameACStrings.Add(obj.Name);
            }
        }
Exemple #38
0
 /// <summary>
 /// Returns an observable sequence wrapping the CollectionChanged event on the AutoCompleteStringCollection instance.
 /// </summary>
 /// <param name="instance">The AutoCompleteStringCollection instance to observe.</param>
 /// <returns>An observable sequence wrapping the CollectionChanged event on the AutoCompleteStringCollection instance.</returns>
 public static IObservable <EventPattern <CollectionChangeEventArgs> > CollectionChangedObservable(this AutoCompleteStringCollection instance)
 {
     return(Observable.FromEventPattern <CollectionChangeEventHandler, CollectionChangeEventArgs>(
                handler => instance.CollectionChanged += handler,
                handler => instance.CollectionChanged -= handler));
 }