private void btnAdd_Click(object sender, EventArgs e) { frmAdd = new FrmAdd(tbCode.Text, tbNames.Text); if (frmAdd.ShowDialog() == DialogResult.OK) { dgvMain.DataSource = SkladBase.SearchProdByCode(""); } }
private void btnSearch_Click(object sender, EventArgs e) { if (tbCode.Text.Length < 4 & btnSearch.Visible) { searchResult = new FrmSearchResult(tbNames.Text, SearchBy.Name); } else { searchResult = new FrmSearchResult(tbCode.Text, SearchBy.Code); } if (searchResult.ShowDialog() == DialogResult.Yes) { frmAdd = new FrmAdd(searchResult.SelectedCode, searchResult.SelectedName, searchResult.SelectedPriceDC, searchResult.SelectedPricePC, searchResult.SelectedDiscont, searchResult.SelectedPeriodText, searchResult.selectedPeriod, searchResult.selectedYear); frmAdd.ShowDialog(); } dgvMain.DataSource = SkladBase.SearchProdByName(""); }