private void AutoSuggestPartCode() { DataTable dt = new DataTable(); _dbpo = new BusPOMonitoring(); dt = _dbpo.GetPartsByCustomerDT(Convert.ToInt32(cboCustomer.SelectedValue.ToString())); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { coll.Add(dt.Rows[i]["Part_ID"].ToString()); } } else { } tbPartCode.AutoCompleteMode = AutoCompleteMode.Suggest; tbPartCode.AutoCompleteSource = AutoCompleteSource.CustomSource; tbPartCode.AutoCompleteCustomSource = coll; }
private void LoadCustomers() { _dbpo = new BusPOMonitoring(); cboCustomer.DisplayMember = "ModifiedCustomer"; cboCustomer.ValueMember = "Cust_ID"; cboCustomer.DataSource = _dbpo.GetAllCustomersDT(); }
private void GetPartName() { _dbpo = new BusPOMonitoring(); if (_dbpo.GetPartNameByPartIDDT(Convert.ToInt32(cboCustomer.SelectedValue.ToString()), tbPartCode.Text).Rows.Count == 0) { MessageBox.Show("No Part Name Found"); } else { foreach (DataRow dr in _dbpo.GetPartNameByPartIDDT(Convert.ToInt32(cboCustomer.SelectedValue.ToString()), tbPartCode.Text).Rows) { tbPartName.Text = dr["Part_Description"].ToString(); } } }