This commit is contained in:
chikyun.kim
2018-10-02 08:24:16 +09:00
parent 7b86ca98d9
commit 327adb3779
19 changed files with 973 additions and 491 deletions

View File

@@ -14,11 +14,27 @@ namespace FEQ0000
public fPurchase()
{
InitializeComponent();
this.dsPurchase.Purchase.TableNewRow += Purchase_TableNewRow;
}
void Purchase_TableNewRow(object sender, DataTableNewRowEventArgs e)
{
e.Row["pdate"] = DateTime.Now.ToShortDateString();
e.Row["wuid"] = FCOMMON.info.Login.no;
e.Row["wdate"] = DateTime.Now;
e.Row["pumunit"] = "EA";
e.Row["state"] = "01";
e.Row["pumqty"] = 0;
e.Row["pumprice"] = 0;
e.Row["pumamt"] = 0;
e.Row["request"] = FCOMMON.info.Login.nameK;
e.Row["receive"] = FCOMMON.info.Login.nameK;
}
private void __Load(object sender, EventArgs e)
{
this.dtSD.Text = DateTime.Now.AddMonths(-1).ToShortDateString();
this.tbRequest.Text = FCOMMON.info.Login.nameK;
this.dtSD.Text = DateTime.Now.AddDays(-30).ToShortDateString();
this.dtED.Text = DateTime.Now.AddDays(10).ToShortDateString();
refreshData();
}
@@ -26,8 +42,8 @@ namespace FEQ0000
private void purchaseBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.purchaseBindingSource.EndEdit();
this.tableAdapterManager.UpdateAll(this.dsPurchase);
this.bs.EndEdit();
this.tam.UpdateAll(this.dsPurchase);
}
@@ -37,7 +53,8 @@ namespace FEQ0000
{
string request = "%";
if (tbRequest.Text.Trim() != "") request = "%" + this.tbRequest.Text.Trim() + "%";
this.purchaseTableAdapter.Fill(this.dsPurchase.Purchase, dtSD.Text,dtED.Text,request);
this.ta.Fill(this.dsPurchase.Purchase, dtSD.Text,dtED.Text,request);
if (!tbRequest.Text.isEmpty()) this.dv1.AutoResizeColumns();
}
catch (System.Exception ex)
{
@@ -67,5 +84,24 @@ namespace FEQ0000
f.MdiParent = this.MdiParent;
f.Show();
}
private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
{
var newdr = this.dsPurchase.Purchase.NewPurchaseRow();
fPurchase_Add f = new fPurchase_Add(newdr);
if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
this.dsPurchase.Purchase.AddPurchaseRow(newdr);
this.ta.Update(newdr);
newdr.AcceptChanges();
}
else newdr.Delete();
}
private void tbRequest_KeyDown(object sender, KeyEventArgs e)
{
if(e.KeyCode == Keys.Enter)
btSearch.PerformClick();
}
}
}