Private Sub GetPoDetails()
objDS.Tables.Clear()
objDS = objUser.Search_tblUser(" SELECT p.* , s.Supplier_ID, s.Supplier_Name FROM tbl_SUPPLIER s, tbl_PURCHASE p where (p.PO_ID = '" & txtPOID.Text & "') and (p.Supplier_ID = s.Supplier_ID ) ")
Try
If objDS.Tables(0).Rows.Count <= 0 Then
MsgBox("Record Not Found")
End If
If objDS.Tables(0).Rows.Count > 0 Then
ts1.MappingName = objDS.Tables(0).ToString
With tc1
.HeaderText = "Item No."
.MappingName = "Item_No"
.Width = 60
End With
With tc2
.HeaderText = "Item Price"
.MappingName = "Item_Price"
.Width = 60
End With
With tc3
.HeaderText = "Item Quantity"
.MappingName = "Item_Quantity"
.Width = 80
End With
ts1.GridColumnStyles.Add(tc1)
ts1.GridColumnStyles.Add(tc2)
ts1.GridColumnStyles.Add(tc3)
dgPOrderItems.TableStyles.Add(ts1)
dgPOrderItems.DataSource = objDS.Tables(0).DefaultView
With objDS.Tables(0)
txtPOBranchID.Text = objFormat.FormatString(.Rows(0).Item("Branch_ID"))
txtPOID.Text = objFormat.FormatString(.Rows(0).Item("PO_ID"))
txtPOItemNo.Text = objFormat.FormatString(.Rows(0).Item("Item_No"))
txtPOItemQua.Text = objFormat.FormatString(.Rows(0).Item("Item_Quantity"))
txtPOItemPrice.Text = objFormat.FormatString(.Rows(0).Item("Item_Price"))
txtPODay.Text = objFormat.FormatString(.Rows(0).Item("Order_Date").Day.ToString)
txtPOMonth.Text = objFormat.FormatString(.Rows(0).Item("Order_Date").Month.ToString)
txtPOYear.Text = objFormat.FormatString(.Rows(0).Item("Order_Date").Year.ToString)
txtPOModifitedDate.Text = objFormat.FormatString(.Rows(0).Item("Modified_Date"))
txtPOModifitedBy.Text = objFormat.FormatString(.Rows(0).Item("Modified_By"))
txtPOSupplierID.Text = objFormat.FormatString(.Rows(0).Item("s.Supplier_ID"))
txtPOsuppliername.Text = objFormat.FormatString(.Rows(0).Item("Supplier_Name"))
End With
End If
Catch ex As Exception
End Try
End Sub