For Each dRow As DataRow In dsetSegmentSelect.Tables("ConsumerBranches").Rows intRecCnt = 0 'Uncomment For Previous strBrCode = dRow.Item("BranchCode") If dsetSegmentSelect.Tables.Contains("ConsumerBorrowerSegment") Then For Each dCBSBrRow As DataRow In dsetSegmentSelect.Tables("ConsumerBorrowerSegment").Select("BranchCode='" & strBrCode & "'") strBrCode = dCBSBrRow.Item("BranchCode") intCustomerID = dCBSBrRow.Item("CustomerID") intcustData = 0 intRecCnt = intRecCnt + 1 If dsetSegmentSelect.Tables.Contains("ConsumerAccountSegment") Then For Each dCBABrRow As DataRow In dsetSegmentSelect.Tables("ConsumerAccountSegment").Select("BranchCode='" & strBrCode & "' AND CustomerID='" & intCustomerID & "'") intAcID = dCBABrRow.Item("Acid") intcustData = intcustData + 1 blnJoint = False For Each dBPNBrRow As DataRow In dsetSegmentSelect.Tables("BPNBranches").Select("BranchCode='" & strBrCode & "' AND CustomerID='" & intCustomerID & "'") dsetSegmentSelect.Tables("BPNBranches").DefaultView.RowFilter = "BranchCode='" & strBrCode & "' AND CustomerID='" & intCustomerID & "'" intCIBILPGID = dBPNBrRow.Item("CIBILPGID") If dsetSegmentSelect.Tables("BPNBranches").DefaultView.ToTable().Rows.Count > 1 Then blnJoint = True Else blnJoint = False End If If dsetSegmentSelect.Tables.Contains("BorrowerNameSegment") Then For Each dBNSRow As DataRow In dsetSegmentSelect.Tables("BorrowerNameSegment").Select("BranchCode='" & strBrCode & "' AND CustomerID='" & intCustomerID & "' AND CIBILPGID='" & intCIBILPGID & "'") If blnDSFromNEXP = True Then 'cnnVision.Execute(" Update CustomerID Set CustomerMark ='Y' Where Branchcode='" & rstCustomer!BranchCode & "' and CustomerId = " & rstCustomer!CustomerID) End If Call ConsumerTableToString(dBNSRow, FileFullPathName) Next End If If dsetSegmentSelect.Tables.Contains("BorrowerIDSegment") Then For Each dBASRow As DataRow In dsetSegmentSelect.Tables("BorrowerIDSegment").Select("BranchCode='" & strBrCode & "' AND CustomerID='" & intCustomerID & "' AND CIBILPGID='" & intCIBILPGID & "'", "IDSegmentTag Asc") Call ConsumerTableToString(dBASRow, FileFullPathName) Next End If If NEXT
Private Sub ConsumerTableToString(ByRef DR As DataRow, ByVal FileFullPathName As String, Optional ByVal NoOfRows As Integer = 1) Dim strTables As New StringBuilder Dim intlen As Integer Dim I As Integer = 0 If DR.Table.TableName.ToString = "HeaderSegment" Then intlen = 0 Else intlen = 4 End If Try For I = 4 To DR.ItemArray.Length - 1 If Len(DR.Item(I).ToString) > intlen Then If DR.Table.TableName.ToString = "AccountSegment" Then If blnJoint = True Then If DR.Table.Columns(I).ColumnName.ToString = "OwnerShip" Then strField = "05014" Else strField = DR.Item(I).ToString End If End If If blnGuarantor = True Then If DR.Table.Columns(I).ColumnName.ToString = "OwnerShip" Then strField = "05013" Else strField = DR.Item(I).ToString End If End If If blnJoint = False And blnGuarantor = False Then strField = DR.Item(I).ToString Else strField = DR.Item(I).ToString End If Else strField = "" End If strRowConsumer.Append(strField) Next Catch ex As Exception MessageBox.Show(ex.Message, objCommonPar.strpackagename) End Try End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)