private void phraseLoadData() { dgvPhrase.Rows.Clear(); DataGridViewRowCollection rows = dgvPhrase.Rows; PhraseInfo view = new PhraseInfo(APConfig.Conn); view.Conditions = " 1=1 "; view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.category.ToString(), ddlPhraseCategory.SelectedItem.ToString()); if (!string.IsNullOrEmpty(txtPhraseName.Text)) { view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.name.ToString(), txtPhraseName.Text); } if (!string.IsNullOrEmpty(txtPhraseType.Text)) { view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.type.ToString(), txtPhraseType.Text); } if (view.load()) { while (!view.IsEof) { rows.Add(new Object[] { view.PHS_SERNO, view.PHS_NAME, view.PHS_TYPE, view.PHS_INDEX }); view.next(); } } lblPhraseTotal.Text = view.calculateCount().ToString(); }
private void ItemSearch() { lbxItem.Items.Clear(); PhraseInfo view = new PhraseInfo(APConfig.Conn); view.Conditions = " 1=1 "; view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.category.ToString(), PhraseCategory.銷售商品資訊.ToString()); if (!string.IsNullOrEmpty(txtName.Text)) { view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.name.ToString(), txtName.Text); } view.load(); while (!view.IsEof) { lbxItem.Items.Add(view.PHS_TYPE + view.PHS_NAME); view.next(); } }
public static ComboBox loadPhrase(ComboBox c, string category, bool isALL = false) { c.Items.Clear(); if (isALL) { c.Items.Add("全部"); } PhraseInfo view = new PhraseInfo(APConfig.Conn); view.Conditions = " 1=1 "; view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.category.ToString(), category); view.load(); while (!view.IsEof) { c.Items.Add(view.PHS_NAME); view.next(); } return(c); }
private void ItemSearch() { dgvItem.Rows.Clear(); DataGridViewRowCollection rows = dgvItem.Rows; PhraseInfo view = new PhraseInfo(APConfig.Conn); view.Conditions = " 1=1 "; view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.category.ToString(), PhraseCategory.商品資訊.ToString()); if (!string.IsNullOrEmpty(txtName.Text)) { view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.name.ToString(), txtName.Text); } view.load(); while (!view.IsEof) { rows.Add(new Object[] { view.PHS_NAME, view.PHS_TYPE, view.PHS_COLOR, view.PHS_SIZE }); view.next(); } }