mirror of
https://github.com/stokebob/BealeEngineering.git
synced 2026-03-19 06:37:15 +00:00
Improvement, auto fill first line of client purchase order
This commit is contained in:
@@ -35,7 +35,7 @@
|
|||||||
System.Windows.Forms.Label purchaseOrderDateLabel;
|
System.Windows.Forms.Label purchaseOrderDateLabel;
|
||||||
System.Windows.Forms.Label contactNameLabel;
|
System.Windows.Forms.Label contactNameLabel;
|
||||||
System.Windows.Forms.Label label1;
|
System.Windows.Forms.Label label1;
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
||||||
this.clientPurchaseOrderLineIDDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
this.clientPurchaseOrderLineIDDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
this.lineNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
this.lineNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
@@ -168,8 +168,8 @@
|
|||||||
//
|
//
|
||||||
this.description.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
this.description.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||||
this.description.DataPropertyName = "Description";
|
this.description.DataPropertyName = "Description";
|
||||||
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||||
this.description.DefaultCellStyle = dataGridViewCellStyle1;
|
this.description.DefaultCellStyle = dataGridViewCellStyle6;
|
||||||
this.description.HeaderText = "Description";
|
this.description.HeaderText = "Description";
|
||||||
this.description.Name = "description";
|
this.description.Name = "description";
|
||||||
//
|
//
|
||||||
@@ -327,7 +327,8 @@
|
|||||||
this.txtOrderTotal.Name = "txtOrderTotal";
|
this.txtOrderTotal.Name = "txtOrderTotal";
|
||||||
this.txtOrderTotal.Size = new System.Drawing.Size(134, 20);
|
this.txtOrderTotal.Size = new System.Drawing.Size(134, 20);
|
||||||
this.txtOrderTotal.TabIndex = 15;
|
this.txtOrderTotal.TabIndex = 15;
|
||||||
this.txtOrderTotal.TextChanged += new System.EventHandler(this.orderTotalTextBox_TextChanged);
|
this.txtOrderTotal.Enter += new System.EventHandler(this.txtOrderTotal_Enter);
|
||||||
|
this.txtOrderTotal.Leave += new System.EventHandler(this.txtOrderTotal_Leave);
|
||||||
//
|
//
|
||||||
// txtClientReference
|
// txtClientReference
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ namespace BealeEngineering.Accounts
|
|||||||
bool newForm = false;
|
bool newForm = false;
|
||||||
bool editForm = false;
|
bool editForm = false;
|
||||||
Core.Data.Database.Client.ReadPurchaseOrderLineFacility lineFacility;
|
Core.Data.Database.Client.ReadPurchaseOrderLineFacility lineFacility;
|
||||||
|
string totalAmount;
|
||||||
|
|
||||||
public frmClientPurchaseOrder(string sqlConnectionString, Core.Model.Client.PurchaseOrder purchaseOrder)
|
public frmClientPurchaseOrder(string sqlConnectionString, Core.Model.Client.PurchaseOrder purchaseOrder)
|
||||||
{
|
{
|
||||||
@@ -128,11 +129,6 @@ namespace BealeEngineering.Accounts
|
|||||||
// if (isNew == false) { btnDelete.Visible = true; }
|
// if (isNew == false) { btnDelete.Visible = true; }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
private void orderTotalTextBox_TextChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnEdit_Click(object sender, EventArgs e)
|
private void btnEdit_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (editForm || newForm)
|
if (editForm || newForm)
|
||||||
@@ -262,5 +258,36 @@ namespace BealeEngineering.Accounts
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void txtOrderTotal_Enter(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (txtOrderTotal != null)
|
||||||
|
{
|
||||||
|
totalAmount = txtOrderTotal.Text;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
totalAmount = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void txtOrderTotal_Leave(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (totalAmount != txtOrderTotal.Text)
|
||||||
|
{
|
||||||
|
if (dataGridView1.Rows.Count == 1 && dataGridView1.NewRowIndex == 0)
|
||||||
|
{
|
||||||
|
decimal amount = 0;
|
||||||
|
if (decimal.TryParse(txtOrderTotal.Text, out amount) && amount !=0)
|
||||||
|
{
|
||||||
|
var line = new Core.Model.Client.PurchaseOrder.PurchaseOrderLine();
|
||||||
|
line.LineNumber = 1;
|
||||||
|
line.LineNetAmount = amount;
|
||||||
|
|
||||||
|
orderLineListBindingSource.Add(line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,6 +144,18 @@
|
|||||||
<metadata name="orderLineListBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="orderLineListBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>253, 29</value>
|
<value>253, 29</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<metadata name="facility.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="ProjectWorkNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="orderLineListBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>253, 29</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="purchaseOrderBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>37, 27</value>
|
||||||
|
</metadata>
|
||||||
<metadata name="purchaseOrderBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="purchaseOrderBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>37, 27</value>
|
<value>37, 27</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
|||||||
Reference in New Issue
Block a user