private void txtPOItemQuantity_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { txtPOItemCode.Focus(); Logic.POItem poitm = new Logic.POItem(); poitm.strPOItemCode = txtPOItemCode.Text; poitm.strPOItemName = txtPOItemName.Text; poitm.dcmlPOQty = decimal.Parse(txtPOItemQuantity.Text); poitm.strPOItemUoM = txtPOUoM.Text; poitm.dcmlPOUnitPrice = decimal.Parse(txtPOItmUnitPrice.Text); poitm.dcmlPOItmSubTot = Convert.ToDecimal(txtPOSubTotal.Text); toTable(poitm); txtPOItemCode.Clear(); txtPOItemName.Clear(); txtPOItemQuantity.Text = "0.00"; txtPOUoM.Clear(); txtPOItmUnitPrice.Text = "0.00"; txtPOSubTotal.Text = "0.00"; //txtInvoiceTotal.Text = Convert.ToString(calculateTotal()); } }
internal void toTable(Logic.POItem poitm) { int c**t = dgdPO.RowCount - 1; dgdPO.Rows.Add(); dgdPO.Rows[c**t].Cells["colPOItemCode"].Value = Convert.ToString(poitm.strPOItemCode); dgdPO.Rows[c**t].Cells["colPOItemName"].Value = poitm.strPOItemName; dgdPO.Rows[c**t].Cells["colPOQuantity"].Value = poitm.dcmlPOQty; dgdPO.Rows[c**t].Cells["colPOItemUoM"].Value = poitm.strPOItemUoM; dgdPO.Rows[c**t].Cells["colPOUnitPrice"].Value = poitm.dcmlPOUnitPrice; dgdPO.Rows[c**t].Cells["colPOSubTotal"].Value = poitm.dcmlPOItmSubTot; }