// sachintha udara // edited new function private void supCodeValidate() { string locSupCode = PaddSuppliyerCode(txtSupplierCode.Text); String locSupName = mySupplier.getSupplierName(locSupCode); if (mySupplier.getSupplierName(locSupCode) == "NA") { MessageBox.Show("Supplier Not Found !"); txtSupplierCode.Text = String.Empty; txtSupplierCode.Focus(); } else { txtSupplierCode.Text = locSupCode; lblSupplierName.Text = locSupName; lblRoute.Text = mySupplier.getRoute(locSupCode); cmbTrncode.Text = mySupplier.getSupplierTranCode(locSupCode); if (mySupplier.getSupplierTransportType(locSupCode) == "NA") { MessageBox.Show("Transport Type Not Available In Master File"); cmbTransportType.SelectedIndex = -1; } else { cmbTransportType.SelectedValue = mySupplier.getSupplierTransportType(locSupCode); } cmbTrncode.Focus(); } }
private void gvList_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { objGLCollection.txtSupplierCode.Text = gvList.Rows[e.RowIndex].Cells[0].Value.ToString(); objGLCollection.lblSupplierName.Text = gvList.Rows[e.RowIndex].Cells[1].Value.ToString(); objGLCollection.lblRoute.Text = mySupplier.getRoute(objGLCollection.txtSupplierCode.Text.PadLeft(5, '0')); objGLCollection.cmbTrncode.Text = mySupplier.getSupplierTranCode(objGLCollection.txtSupplierCode.Text.PadLeft(5, '0')); this.Close(); }