コード例 #1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     frmAdd = new FrmAdd(tbCode.Text, tbNames.Text);
     if (frmAdd.ShowDialog() == DialogResult.OK)
     {
         dgvMain.DataSource = SkladBase.SearchProdByCode("");
     }
 }
コード例 #2
0
        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("");
        }