Sunday, 13 January 2013

LOgic Page



ImportsMicrosoft.VisualBasic
ImportsSystem.Data
ImportsSystem.Data.SqlClient
Imports System.IO
ImportsSystem.Configuration
Imports System


PublicClassruntimetable
DimoblGFAsNewGlovalFunction
PublicdtUserDetailAsNewDataTable
Public dtUserDetail1 AsNewDataTable


PublicSubInitAdresstable()
Try
Withdtaddress.Columns
                .Add("RecId") '0
                .Add("CustId") '1
                .Add("Address1") '2
                .Add("Address2") '3
EndWith
dtaddress.Rows.Add(dtaddress.NewRow)
Catch ex AsException

EndTry
EndSub


***************************************************************************

PublicFunctionSaveCustVendMaster(ByValRecIdAsInteger) AsLong
Try
DimdsCustVendAsNewDataSet

dsCustVend.Tables.Add(dtcust.Copy)  ''1th Table
dsCustVend.Tables.Add(dtaddress.Copy)  ''2th Table
dsCustVend.Tables.Add(dtcontact.Copy)  ''3th Table

IfRecid = 0 Then
RecId = oblGF.AddcustVend(dsCustVend)
IfRecid> 0 Then

Return 1
Else
Recid = 0
Return 0
EndIf
Else
DimReturnValueAsLong
'ReturnValue = oblGF.UpDateCust(RecId, dsCustVend)
IfReturnValue = 1 Then
Return 1
ElseIfReturnValue = 2 Then
Return 2
Else
Return 0
EndIf
EndIf
ReturnFalse
Catch ex AsException

EndTry

EndFunction


#EndRegion


*************************************************************************** 
PublicFunctionupdategrid() AsLong
Try

Dim i AsInteger
            i = oblGF.updateGridinfo(dtUserDetail)


Return i
Catch ex AsException

EndTry
EndFunction


*************************************************************************** 
PublicFunctionsaveUser() AsLong
Try

Dim i AsInteger
            i = oblGF.AddNewEmployee(dtUserDetail)
'     i = oblGF.AddNewEmployee1(dtUserDetail)

Return i
Catch ex AsException

EndTry
EndFunction

No comments:

Post a Comment