private void btnSearchBuyByMaterialName_Click(object sender, EventArgs e) { MaterialSelectedForm frmMaterialSelected = new MaterialSelectedForm(); if (frmMaterialSelected.ShowDialog() != DialogResult.OK) return; this.materialsBuyTableAdapter.FillByMaterialID(this.financeManageDataSet.MaterialsBuy, frmMaterialSelected.MaterialId); txtShowBuyRange.Text = frmMaterialSelected.MaterialName; }
private void btnSearchBuyByMaterialNameWithDate_Click(object sender, EventArgs e) { MaterialSelectedForm frmMaterialSelected = new MaterialSelectedForm(); if (frmMaterialSelected.ShowDialog() != DialogResult.OK) return; DateTime beginDate = dtBuyBeginDate.Value; beginDate = new DateTime(beginDate.Year, beginDate.Month, beginDate.Day, 0, 0, 0); DateTime endDate = dtBuyEndDate.Value; endDate = new DateTime(endDate.Year, endDate.Month, endDate.Day, 0, 0, 0); this.materialsBuyTableAdapter.FillByMaterialIDWithDate(this.financeManageDataSet.MaterialsBuy, frmMaterialSelected.MaterialId, beginDate, endDate); txtShowBuyRange.Text = frmMaterialSelected.MaterialName + " " + beginDate.ToShortDateString() + " - " + endDate.ToShortDateString(); }