public frmSubOrderDetails(DataTable dtSubOrder, IPosTransaction posTransaction, IApplication Application, frmOrderDetails fOrderDetails, string UniqueID) { InitializeComponent(); pos = posTransaction; application = Application; frmOrderDetails = fOrderDetails; sUnique = UniqueID; BindRateTypeCombo(); btnPOSItemSearch.Focus(); dtItemInfo = dtSubOrder; dtTemp = dtSubOrder.Clone(); DataRow[] drTemp = dtSubOrder.Select("UNIQUEID='" + UniqueID + "'"); foreach (DataRow dr in drTemp) { dtTemp.ImportRow(dr); } grItems.DataSource = dtTemp; if (dtTemp != null && dtTemp.Rows.Count > 0) { Decimal dTotalAmount = 0m; foreach (DataRow drTotal in dtTemp.Rows) { dTotalAmount += Convert.ToDecimal(drTotal["AMOUNT"]); } txtTotalAmount.Text = Convert.ToString(dTotalAmount); } }
public frmSubOrderDetails(IPosTransaction posTransaction, IApplication Application, frmOrderDetails fOrderDetails, string UniqueID) { InitializeComponent(); pos = posTransaction; application = Application; frmOrderDetails = fOrderDetails; sUnique = UniqueID; BindRateTypeCombo(); btnPOSItemSearch.Focus(); }
// Int16 iISStnRet = 0 added on 16/09/2014 by Palas public frmCustOrderSampleReturn(IPosTransaction posTransaction, IApplication Application, DataTable dt, frmOrderDetails frmOrdDtl, Int16 iISStnRet = 0) { InitializeComponent(); pos = posTransaction; application = Application; frmOrderDtls = frmOrdDtl; //modified on 16/09/2014 by Palas iIsStoneRet = iISStnRet; if (iIsStoneRet == 1) { dtStone = dt; dtNotReturn = null; dtNotReturn = dtStone.Clone(); dtNotReturn.Columns["ISRETURNED"].DataType = typeof(bool);// change the datatype of the column ISRETURNED(int) to bool on 24/09/2014 dtStone.Select("ISRETURNED=false").CopyToDataTable(dtNotReturn, LoadOption.PreserveChanges); sfrmTitle = "Customer Order Stone Return"; colGrWt.Visible = false; colNtWt.Visible = false; colTotalAmt.Visible = false; colSize.Visible = true; colColor.Visible = true; colItemId.VisibleIndex = 1; colColor.VisibleIndex = 2; colColor.Caption = "Code"; colSize.VisibleIndex = 3; colPCS.VisibleIndex = 4; colDiaWt.VisibleIndex = 5; colDiaAmt.VisibleIndex = 6; colStnWt.VisibleIndex = 7; colStnAmt.VisibleIndex = 8; colRemarks.VisibleIndex = 9; grItems.DataSource = dtNotReturn.DefaultView; } else { dtSample = dt; dtNotReturn = null; dtNotReturn = dtSample.Clone(); dtNotReturn.Columns["ISRETURNED"].DataType = typeof(bool);// change the datatype of the column ISRETURNED(int) to bool on 24/09/2014 dtSample.Select("ISRETURNED=False").CopyToDataTable(dtNotReturn, LoadOption.PreserveChanges); sfrmTitle = "Customer Order Sample Return"; grItems.DataSource = dtNotReturn.DefaultView; } label1.Text = sfrmTitle; this.Text = sfrmTitle; //grItems.DataSource = dtNotReturn.DefaultView; }
private void BtnOrderDetails_Click(object sender, EventArgs e) { if (_selectedOrderId != 0) { frmOrderDetails frmOrderDetails = new frmOrderDetails(_selectedOrderId); frmOrderDetails.Show(); } else { MessageBox.Show("No order selected!"); } }
public frmSubOrderDetails(DataSet dsSearchedDetails, IPosTransaction posTransaction, IApplication Application, frmOrderDetails fOrderDetails, string UniqueID) { InitializeComponent(); pos = posTransaction; application = Application; frmOrderDetails = fOrderDetails; sUnique = UniqueID; BindRateTypeCombo(); btnPOSItemSearch.Focus(); DataTable dtSearchedOrdersTemp = new DataTable(); dtSearchedOrdersTemp = dsSearchedDetails.Tables[2].Clone(); DataRow[] drTemp = dsSearchedDetails.Tables[2].Select("ORDERDETAILNUM='" + UniqueID + "'"); foreach (DataRow dr in drTemp) { dtSearchedOrdersTemp.ImportRow(dr); } grItems.DataSource = dtSearchedOrdersTemp; if (dtSearchedOrdersTemp != null && dtSearchedOrdersTemp.Rows.Count > 0) { Decimal dTotalAmount = 0m; foreach (DataRow drTotal in dtSearchedOrdersTemp.Rows) { dTotalAmount += Convert.ToDecimal(drTotal["AMOUNT"]); } txtTotalAmount.Text = Convert.ToString(dTotalAmount); frmOrderDetails.sExtendedDetailsAmount = Convert.ToDecimal(txtTotalAmount.Text); } btnPOSItemSearch.Enabled = false; btnAddItem.Enabled = false; btnSubmit.Enabled = false; btnEdit.Enabled = false; btnDelete.Enabled = false; btnClear.Enabled = false; }