二、DataAccess层代码
代码
Imports PMS.DataAccess.DBUtil
Imports System.Data
Imports System.Data.SqlClient
Imports HNA.Common.ServerData
Public Class BillAccess
#Region "Shared function"
Public Shared Function SaveBill(ByVal hotelId As Integer, ByVal vBill As BillBase, ByVal userId As Integer, ByVal computer As String) As Boolean
Dim parms(24) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = vBill.Id
parms(2) = New SqlParameter("@cTeamName", SqlDbType.NVarChar, 100)
parms(2).Value = vBill.TeamName
parms(3) = New SqlParameter("@nMemberId", SqlDbType.Int)
parms(3).Value = vBill.MemberId
parms(4) = New SqlParameter("@cMemberCardNo", SqlDbType.NVarChar, 100)
parms(4).Value = vBill.MemberCardNo
parms(5) = New SqlParameter("@cCompany", SqlDbType.NVarChar, 100)
parms(5).Value = vBill.Company
parms(6) = New SqlParameter("@cPactNo", SqlDbType.NVarChar, 100)
parms(6).Value = vBill.PactNo
parms(7) = New SqlParameter("@cPactCompany", SqlDbType.NVarChar, 100)
parms(7).Value = vBill.PactCompany
parms(8) = New SqlParameter("@cGuestName", SqlDbType.NVarChar, 100)
parms(8).Value = vBill.GuestName
parms(9) = New SqlParameter("@cMobileNo", SqlDbType.NVarChar, 100)
parms(9).Value = vBill.MobileNo
parms(10) = New SqlParameter("@cTelphoneHome", SqlDbType.NVarChar, 100)
parms(10).Value = vBill.TelphoneHome
parms(11) = New SqlParameter("@cAddressHome", SqlDbType.NVarChar, 100)
parms(11).Value = vBill.AddressHome
parms(12) = New SqlParameter("@cAddressCompany", SqlDbType.NVarChar, 100)
parms(12).Value = vBill.AddressCompany
parms(13) = New SqlParameter("@nAccountTypeId", SqlDbType.Int)
parms(13).Value = vBill.AccountTypeId
parms(14) = New SqlParameter("@cBalanceNo", SqlDbType.NVarChar, 100)
parms(14).Value = vBill.BalanceNo
parms(15) = New SqlParameter("@nRentKindId", SqlDbType.Int)
parms(15).Value = vBill.RentKindId
parms(16) = New SqlParameter("@nAuthorizerId", SqlDbType.Int)
parms(16).Value = vBill.AuthorizerId
parms(17) = New SqlParameter("@nSalesmanId", SqlDbType.Int)
parms(17).Value = vBill.SalesmanId
parms(18) = New SqlParameter("@dArrivedTime", SqlDbType.DateTime)
parms(18).Value = vBill.ArrivedTime
parms(19) = New SqlParameter("@dLeftTime", SqlDbType.DateTime)
parms(19).Value = vBill.LeftTime
parms(20) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(20).Value = userId
parms(21) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(21).Value = computer
parms(22) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(22).Value = vBill.Remark
parms(23) = New SqlParameter("@cTelphoneCompany", SqlDbType.NVarChar, 100)
parms(23).Value = vBill.TelphoneCompany
parms(24) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(24).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_UpdateBill", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
'Public Shared Function SaveBill(ByVal hotelId As Integer, ByVal Id As Integer, ByVal teamName As String, ByVal memberId As Integer, ByVal memberCardNo As String, _
' ByVal company As String, ByVal pactNo As String, ByVal pactCompany As String, ByVal guestName As String, ByVal mobileNo As String, _
' ByVal telphoneHome As String, ByVal telphoneCompany As String, ByVal addressHome As String, ByVal addressCompany As String, _
' ByVal accountTypeId As Integer, ByVal balanceNo As String, ByVal rentKindId As Integer, ByVal authorizerId As Integer, _
' ByVal salesmanId As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, _
' ByVal ArrivedTime As DateTime, ByVal LeftTime As DateTime) As Boolean
' Dim parms(24) As SqlParameter
' parms(0) = New SqlParameter("@ret", SqlDbType.Int)
' parms(0).Direction = ParameterDirection.Output
' parms(1) = New SqlParameter("@nId", SqlDbType.Int)
' parms(1).Value = Id
' parms(2) = New SqlParameter("@cTeamName", SqlDbType.NVarChar, 100)
' parms(2).Value = teamName
' parms(3) = New SqlParameter("@nMemberId", SqlDbType.Int)
' parms(3).Value = memberId
' parms(4) = New SqlParameter("@cMemberCardNo", SqlDbType.NVarChar, 100)
' parms(4).Value = memberCardNo
' parms(5) = New SqlParameter("@cCompany", SqlDbType.NVarChar, 100)
' parms(5).Value = company
' parms(6) = New SqlParameter("@cPactNo", SqlDbType.NVarChar, 100)
' parms(6).Value = pactNo
' parms(7) = New SqlParameter("@cPactCompany", SqlDbType.NVarChar, 100)
' parms(7).Value = pactCompany
' parms(8) = New SqlParameter("@cGuestName", SqlDbType.NVarChar, 100)
' parms(8).Value = guestName
' parms(9) = New SqlParameter("@cMobileNo", SqlDbType.NVarChar, 100)
' parms(9).Value = mobileNo
' parms(10) = New SqlParameter("@cTelphoneHome", SqlDbType.NVarChar, 100)
' parms(10).Value = telphoneHome
' parms(11) = New SqlParameter("@cAddressHome", SqlDbType.NVarChar, 100)
' parms(11).Value = addressHome
' parms(12) = New SqlParameter("@cAddressCompany", SqlDbType.NVarChar, 100)
' parms(12).Value = addressCompany
' parms(13) = New SqlParameter("@nAccountTypeId", SqlDbType.Int)
' parms(13).Value = accountTypeId
' parms(14) = New SqlParameter("@cBalanceNo", SqlDbType.NVarChar, 100)
' parms(14).Value = balanceNo
' parms(15) = New SqlParameter("@nRentKindId", SqlDbType.Int)
' parms(15).Value = rentKindId
' parms(16) = New SqlParameter("@nAuthorizerId", SqlDbType.Int)
' parms(16).Value = authorizerId
' parms(17) = New SqlParameter("@nSalesmanId", SqlDbType.Int)
' parms(17).Value = salesmanId
' parms(18) = New SqlParameter("@dArrivedTime", SqlDbType.DateTime)
' parms(18).Value = ArrivedTime
' parms(19) = New SqlParameter("@dLeftTime", SqlDbType.DateTime)
' parms(19).Value = LeftTime
' parms(20) = New SqlParameter("@nUserId", SqlDbType.Int)
' parms(20).Value = userId
' parms(21) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
' parms(21).Value = computer
' parms(22) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
' parms(22).Value = remark
' parms(23) = New SqlParameter("@cTelphoneCompany", SqlDbType.NVarChar, 100)
' parms(23).Value = telphoneCompany
' parms(24) = New SqlParameter("@nHotelId", SqlDbType.Int)
' parms(24).Value = hotelId
' Util.ExecProc("", CnnStr.MainCnnStr, "P_UpdateBill", Nothing, parms)
' If parms(0).Value = 1 Then
' Return True
' Else
' Return False
' End If
'End Function
'Public Shared Function CreateSingleBill(ByVal hotelId As Integer, ByVal teamName As String, ByVal memberId As Integer, ByVal memberCardNo As String, _
' ByVal company As String, ByVal pactNo As String, ByVal pactCompany As String, ByVal guestName As String, ByVal mobileNo As String, _
' ByVal telphoneHome As String, ByVal telphoneCompany As String, ByVal addressHome As String, ByVal addressCompany As String, _
' ByVal accountTypeId As Integer, ByVal balanceNo As String, ByVal rentKindId As Integer, ByVal authorizerId As Integer, _
' ByVal salesmanId As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String) As Boolean
Public Shared Function CreateSingleBill(ByVal hotelId As Integer, ByVal vBill As BillBase) As Boolean
Dim parms(21) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@cTeamName", SqlDbType.NVarChar, 100)
parms(1).Value = vBill.TeamName
parms(2) = New SqlParameter("@nMemberId", SqlDbType.Int)
parms(2).Value = vBill.MemberId
parms(3) = New SqlParameter("@cMemberCardNo", SqlDbType.NVarChar, 100)
parms(3).Value = vBill.MemberCardNo
parms(4) = New SqlParameter("@cCompany", SqlDbType.NVarChar, 100)
parms(4).Value = vBill.Company
parms(5) = New SqlParameter("@cPactNo", SqlDbType.NVarChar, 100)
parms(5).Value = vBill.PactNo
parms(6) = New SqlParameter("@cPactCompany", SqlDbType.NVarChar, 100)
parms(6).Value = vBill.PactCompany
parms(7) = New SqlParameter("@cGuestName", SqlDbType.NVarChar, 100)
parms(7).Value = vBill.GuestName
parms(8) = New SqlParameter("@cMobileNo", SqlDbType.NVarChar, 100)
parms(8).Value = vBill.MobileNo
parms(9) = New SqlParameter("@cTelphoneHome", SqlDbType.NVarChar, 100)
parms(9).Value = vBill.TelphoneHome
parms(10) = New SqlParameter("@cTelphoneCompany", SqlDbType.NVarChar, 100)
parms(10).Value = vBill.TelphoneCompany
parms(11) = New SqlParameter("@cAddressHome", SqlDbType.NVarChar, 100)
parms(11).Value = vBill.AddressHome
parms(12) = New SqlParameter("@cAddressCompany", SqlDbType.NVarChar, 100)
parms(12).Value = vBill.AddressCompany
parms(13) = New SqlParameter("@nAccountTypeId", SqlDbType.Int)
parms(13).Value = vBill.AccountTypeId
parms(14) = New SqlParameter("@cBalanceNo", SqlDbType.NVarChar, 100)
parms(14).Value = vBill.BalanceNo
parms(15) = New SqlParameter("@nRentKindId", SqlDbType.Int)
parms(15).Value = vBill.RentKindId
parms(16) = New SqlParameter("@nAuthorizerId", SqlDbType.Int)
parms(16).Value = vBill.AccountTypeId
parms(17) = New SqlParameter("@nSalesmanId", SqlDbType.Int)
parms(17).Value = vBill.SalesmanId
parms(18) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(18).Value = vBill.UserId
parms(19) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(19).Value = vBill.Computer
parms(20) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(20).Value = vBill.Remark
parms(21) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(21).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_CreateSingleBill", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function GetSingleBillList(ByVal hotelId As Integer, ByVal searchStr As String, ByVal tag As Integer) As DataTable
Dim data As DataSet
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@searchStr", SqlDbType.NVarChar, 4000)
parms(1).Value = IIf(searchStr = "", DBNull.Value, searchStr)
parms(2) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(2).Value = hotelId
parms(3) = New SqlParameter("@tag", SqlDbType.Int)
parms(3).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetSingleBillList", data, parms)
If parms(0).Value = 1 Then
If data.Tables.Count > 0 Then
Return data.Tables(0)
Else
Return Nothing
End If
Else
Return Nothing
End If
End Function
Public Shared Function GetSingleBillListPause(ByVal hotelId As Integer) As DataTable
Return Pub.GetDatatable(hotelId, CnnStr.MainCnnStr, "P_ZZ_GetSingleBillListPause")
End Function
Public Shared Function GetTeamBillList(ByVal hotelId As Integer, ByVal searchStr As String, ByVal tag As Integer) As DataTable()
Dim ds As DataSet
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(1).Value = hotelId
parms(2) = New SqlParameter("@searchStr", SqlDbType.NVarChar, 4000)
parms(2).Value = IIf(searchStr = "", DBNull.Value, searchStr)
parms(3) = New SqlParameter("@tag", SqlDbType.Int)
parms(3).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetTeamBillList", ds, parms)
If parms(0).Value = 1 Then
If ds Is Nothing Then Return Nothing
If ds.Tables.Count <> 2 Then Return Nothing
Return New DataTable(1) {ds.Tables(0), ds.Tables(1)}
Else
Return Nothing
End If
End Function
Public Shared Function GetTeamBillListPause(ByVal hotelId As Integer) As DataTable()
Dim ds As DataSet
Dim parms(0) As SqlParameter
parms(0) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(0).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_ZZ_GetTeamBillListPause", ds, parms)
If ds Is Nothing Then Return Nothing
If ds.Tables.Count <> 2 Then Return Nothing
Return New DataTable(1) {ds.Tables(0), ds.Tables(1)}
End Function
Private Shared Function GetCnmList(ByVal hotelId As Integer, ByVal BillId As Integer, ByVal procName As String) As DataTable
Dim data As DataSet
Dim parms(2) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nBillId", SqlDbType.Int)
parms(1).Value = BillId
parms(2) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(2).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, procName, data, parms)
If parms(0).Value = 1 Then
If data.Tables.Count > 0 Then
Return data.Tables(0)
Else
Return Nothing
End If
Else
Return Nothing
End If
End Function
Public Shared Function GetCnmListAll(ByVal hotelId As Integer, ByVal BillId As Integer) As DataTable
Return GetCnmList(hotelId, BillId, "P_GetBillCnmList_All")
End Function
Public Shared Function GetCnmListCancel(ByVal hotelId As Integer, ByVal BillId As Integer) As DataTable
Return GetCnmList(hotelId, BillId, "P_GetBillCnmList_Cancel")
End Function
Public Shared Function GetCnmListCashed(ByVal hotelId As Integer, ByVal BillId As Integer) As DataTable
Return GetCnmList(hotelId, BillId, "P_GetBillCnmList_Cashed")
End Function
Public Shared Function GetCnmListNoCash(ByVal hotelId As Integer, ByVal BillId As Integer) As DataTable
Return GetCnmList(hotelId, BillId, "P_GetBillCnmList_NoCashed")
End Function
Public Shared Function GetCnmListTurnIn(ByVal hotelId As Integer, ByVal BillId As Integer) As DataTable
Return GetCnmList(hotelId, BillId, "P_GetBillCnmList_TurnIn")
End Function
Public Shared Function GetCnmListTurnOut(ByVal hotelId As Integer, ByVal BillId As Integer) As DataTable
Return GetCnmList(hotelId, BillId, "P_GetBillCnmList_TurnOut")
End Function
Public Shared Function AddConsume(ByVal hotelId As Integer, ByVal billId As Integer, _
ByVal productId As Integer, ByVal productTypeId As Integer, ByVal count As Decimal, _
ByVal price As Decimal, ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal jobTimeListId As Integer, ByVal outBillCode As String, ByVal tag As Integer) As Boolean
Dim parms(12) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nbillId", SqlDbType.Int)
parms(1).Value = billId
parms(2) = New SqlParameter("@nProductId", SqlDbType.Int)
parms(2).Value = productId
parms(3) = New SqlParameter("@nProductTypeId", SqlDbType.Int)
parms(3).Value = productTypeId
parms(4) = New SqlParameter("@nCount", SqlDbType.Decimal)
parms(4).Value = count
parms(5) = New SqlParameter("@nPrice", SqlDbType.Decimal)
parms(5).Value = price
parms(6) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(6).Value = userId
parms(7) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(7).Value = computer
parms(8) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(8).Value = remark
parms(9) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(9).Value = jobTimeListId
parms(10) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(10).Value = hotelId
parms(11) = New SqlParameter("@cOutBillCode", SqlDbType.NVarChar, 50)
parms(11).Value = outBillCode
parms(12) = New SqlParameter("@tag", SqlDbType.Int)
parms(12).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_InsertBillCnmList", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function CancelConsume(ByVal hotelId As Integer, ByVal CnmListId As Integer, _
ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal jobTimeListId As Integer, ByVal remarkId As Integer) As Boolean
Dim parms(7) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nBillCnmListId", SqlDbType.Int)
parms(1).Value = CnmListId
parms(2) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(2).Value = userId
parms(3) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(3).Value = computer
parms(4) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(4).Value = remark
parms(5) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(5).Value = jobTimeListId
parms(6) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(6).Value = hotelId
parms(7) = New SqlParameter("@nRemarkId", SqlDbType.Int)
parms(7).Value = remarkId
Util.ExecProc("", CnnStr.MainCnnStr, "P_CancelBillCnmList", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function GetCheckedMProductList(ByVal hotelId As Integer, ByVal BillId As Integer) As DataTable
Return GetCnmList(hotelId, BillId, "P_GetBillMPrdtList")
End Function
Public Shared Function AddCheckedCnm(ByRef id As Integer, ByVal hotelId As Integer, ByVal billId As Integer, _
ByVal productId As Integer, ByVal productTypeId As Integer, ByVal count As Decimal, _
ByVal price As Decimal, ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal jobTimeListId As Integer, ByVal isNow As Boolean, ByVal tag As Integer) As Boolean
Dim parms(13) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nbillId", SqlDbType.Int)
parms(1).Value = billId
parms(2) = New SqlParameter("@nProductId", SqlDbType.Int)
parms(2).Value = productId
parms(3) = New SqlParameter("@nProductTypeId", SqlDbType.Int)
parms(3).Value = productTypeId
parms(4) = New SqlParameter("@nCount", SqlDbType.Decimal)
parms(4).Value = count
parms(5) = New SqlParameter("@nPrice", SqlDbType.Decimal)
parms(5).Value = price
parms(6) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(6).Value = userId
parms(7) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(7).Value = computer
parms(8) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(8).Value = remark
parms(9) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(9).Value = jobTimeListId
parms(10) = New SqlParameter("@bIsNow", SqlDbType.Bit)
parms(10).Value = isNow
parms(11) = New SqlParameter("@nId", SqlDbType.Int)
parms(11).Direction = ParameterDirection.Output
parms(12) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(12).Value = hotelId
parms(13) = New SqlParameter("@tag", SqlDbType.Int)
parms(13).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_InertBillMPrdtList", Nothing, parms)
If parms(0).Value = 1 Then
id = parms(11).Value
Return True
Else
Return False
End If
End Function
Public Shared Function CancelCheckedCnm(ByVal hotelId As Integer, ByVal CnmListId As Integer, _
ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal ProductTypeId As Integer, ByVal remarkId As Integer) As Boolean
Dim parms(7) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = CnmListId
parms(2) = New SqlParameter("@nProductTypeId", SqlDbType.Int)
parms(2).Value = ProductTypeId
parms(3) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(3).Value = userId
parms(4) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(4).Value = computer
parms(5) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(5).Value = remark
parms(6) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(6).Value = hotelId
parms(7) = New SqlParameter("@nRemarkId", SqlDbType.Int)
parms(7).Value = remarkId
Util.ExecProc("", CnnStr.MainCnnStr, "P_CancelBillMPrdtList", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function GetPayCashList(ByVal hotelId As Integer, ByVal parentId As Integer) As DataTable
Return GetCashList(hotelId, parentId, 1)
End Function
Public Shared Function GetPreCashList(ByVal hotelId As Integer, ByVal parentId As Integer) As DataTable
Return GetCashList(hotelId, parentId, 3)
End Function
Public Shared Function GetCashList(ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal tag As Integer) As DataTable
Dim data As DataSet
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(1).Value = ParentId
parms(2) = New SqlParameter("@tag", SqlDbType.Int)
parms(2).Value = tag
parms(3) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(3).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetCashList", data, parms)
If parms(0).Value = 1 Then
If data.Tables.Count > 0 Then
Return data.Tables(0)
Else
Return Nothing
End If
Else
Return Nothing
End If
End Function
Public Shared Function GetAccountCtrlList(ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal tag As Integer) As DataTable
Dim data As DataSet
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(1).Value = ParentId
parms(2) = New SqlParameter("@tag", SqlDbType.Int)
parms(2).Value = tag
parms(3) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(3).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetAccountCtrlList", data, parms)
If parms(0).Value = 1 Then
If data.Tables.Count > 0 Then
Return data.Tables(0)
Else
Return Nothing
End If
Else
Return Nothing
End If
End Function
'Public Shared Function InsertPayCashList(ByVal id As Integer, ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal payTypeId As Integer, ByVal payTypeName As String, _
' ByVal rate As Decimal, ByVal money As Decimal, ByVal jobTimeListId As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String) As Boolean
Public Shared Function InsertPayCashList(ByVal id As Integer, ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal item As CashItemBase) As Boolean
Return InsertCashList(id, hotelId, ParentId, item.PayTypeId, item.PayTypeName, item.Rate, item.Money, item.JobTimeListId, item.UserId, item.Computer, item.Remark, "", 1)
End Function
'Public Shared Function InsertPreCashList(ByVal id As Integer, ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal payTypeId As Integer, ByVal payTypeName As String, _
' ByVal rate As Decimal, ByVal money As Decimal, ByVal jobTimeListId As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, ByVal PreBillCode As String) As Boolean
Public Shared Function InsertPreCashList(ByVal id As Integer, ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal item As CashItemBase) As Boolean
Return InsertCashList(id, hotelId, ParentId, item.PayTypeId, item.PayTypeName, item.Rate, item.Money, item.JobTimeListId, item.UserId, item.Computer, item.Remark, item.PreBillCode, 3)
End Function
Public Shared Function InsertCashList(ByRef id As Integer, ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal payTypeId As Integer, ByVal payTypeName As String, _
ByVal rate As Decimal, ByVal money As Decimal, ByVal jobTimeListId As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, ByVal PreBillCode As String, ByVal tag As Integer) As Boolean
Dim parms(13) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(1).Value = ParentId
parms(2) = New SqlParameter("@nPayTypeId", SqlDbType.Int)
parms(2).Value = payTypeId
parms(3) = New SqlParameter("@cPayTypeName", SqlDbType.NVarChar, 50)
parms(3).Value = payTypeName
parms(4) = New SqlParameter("@nRate", SqlDbType.Decimal)
parms(4).Value = rate
parms(5) = New SqlParameter("@nMoney", SqlDbType.Decimal)
parms(5).Value = money
parms(6) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(6).Value = jobTimeListId
parms(7) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(7).Value = userId
parms(8) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(8).Value = computer
parms(9) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(9).Value = remark
parms(10) = New SqlParameter("@tag", SqlDbType.Int)
parms(10).Value = tag
parms(11) = New SqlParameter("@nId", SqlDbType.Int)
parms(11).Direction = ParameterDirection.Output
parms(12) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(12).Value = hotelId
parms(13) = New SqlParameter("@cPreBillCode", SqlDbType.NVarChar, 50)
parms(13).Value = PreBillCode
Util.ExecProc("", CnnStr.MainCnnStr, "P_InsertCashList", Nothing, parms)
If parms(0).Value = 1 Then
id = parms(11).Value
Return True
Else
id = -1
Return False
End If
End Function
Public Shared Function GetCheckPkgList(ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal tag As Integer) As DataTable
Dim data As DataSet
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(1).Value = ParentId
parms(2) = New SqlParameter("@tag", SqlDbType.Int)
parms(2).Value = tag
parms(3) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(3).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetCheckedPkgList", data, parms)
If parms(0).Value = 1 Then
If data.Tables.Count > 0 Then
Return data.Tables(0)
Else
Return Nothing
End If
Else
Return Nothing
End If
End Function
Public Shared Function AddConsumeByPkg(ByVal hotelId As Integer, ByVal ParentId As Integer, _
ByVal PackageId As Integer, ByVal count As Decimal, _
ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal jobTimeListId As Integer, ByVal tag As Integer) As Boolean
Dim parms(9) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(1).Value = ParentId
parms(2) = New SqlParameter("@nPackageId", SqlDbType.Int)
parms(2).Value = PackageId
parms(3) = New SqlParameter("@nCount", SqlDbType.Decimal)
parms(3).Value = count
parms(4) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(4).Value = userId
parms(5) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(5).Value = computer
parms(6) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(6).Value = remark
parms(7) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(7).Value = jobTimeListId
parms(8) = New SqlParameter("@tag", SqlDbType.Int)
parms(8).Value = tag
parms(9) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(9).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_InsertPackageCnmList", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function AddCheckPkg(ByVal hotelId As Integer, ByRef id As Integer, ByVal IsNow As Boolean, ByVal ParentId As Integer, _
ByVal PackageId As Integer, ByVal count As Decimal, _
ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal jobTimeListId As Integer, ByVal tag As Integer) As Boolean
Dim parms(11) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = id
parms(2) = New SqlParameter("@bIsNow", SqlDbType.Bit)
parms(2).Value = IsNow
parms(3) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(3).Value = ParentId
parms(4) = New SqlParameter("@nPackageId", SqlDbType.Int)
parms(4).Value = PackageId
parms(5) = New SqlParameter("@nCount", SqlDbType.Decimal)
parms(5).Value = count
parms(6) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(6).Value = userId
parms(7) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(7).Value = computer
parms(8) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(8).Value = remark
parms(9) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(9).Value = jobTimeListId
parms(10) = New SqlParameter("@tag", SqlDbType.Int)
parms(10).Value = tag
parms(11) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(11).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_InertCheckPkgList", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function CancelCheckedPkg(ByVal hotelId As Integer, ByVal CnmListId As Integer, _
ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal tag As Integer) As Boolean
Dim parms(6) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = CnmListId
parms(2) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(2).Value = userId
parms(3) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(3).Value = computer
parms(4) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(4).Value = remark
parms(5) = New SqlParameter("@tag", SqlDbType.Int)
parms(5).Value = tag
parms(6) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(6).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_CancelCheckPkgList", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function DoLeft(ByVal hotelId As Integer, ByVal Id As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, ByVal tag As Integer) As Boolean
Dim parms(5) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = Id
parms(2) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(2).Value = userId
parms(3) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(3).Value = computer
parms(4) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(4).Value = remark
parms(5) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(5).Value = hotelId
Dim procN As String = ""
If tag = 1 Then
procN = "P_DoLeftSingleBill"
ElseIf tag = 2 Then
procN = "P_DoLeftTeamBill"
Else
procN = "P_DoLeftGuest"
End If
Util.ExecProc("", CnnStr.MainCnnStr, procN, Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function CancelImprest(ByVal hotelId As Integer, ByVal Id As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, ByVal tag As Integer) As Boolean
Dim parms(6) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = Id
parms(2) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(2).Value = userId
parms(3) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(3).Value = computer
parms(4) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(4).Value = remark
parms(5) = New SqlParameter("@tag", SqlDbType.Int)
parms(5).Value = tag
parms(6) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(6).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_CanCelImprest", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function BackImprest(ByVal hotelId As Integer, ByVal Id As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, ByVal JobTimeListId As Integer, ByVal tag As Integer) As Boolean
Dim parms(7) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = Id
parms(2) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(2).Value = userId
parms(3) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(3).Value = computer
parms(4) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(4).Value = remark
parms(5) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(5).Value = JobTimeListId
parms(6) = New SqlParameter("@tag", SqlDbType.Int)
parms(6).Value = tag
parms(7) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(7).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_BackImprest", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function GetAutoTransferList(ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal tag As Integer) As DataTable
Dim data As DataSet
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(1).Value = ParentId
parms(2) = New SqlParameter("@tag", SqlDbType.Int)
parms(2).Value = tag
parms(3) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(3).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetAutoTransferList", data, parms)
If parms(0).Value = 1 Then
If data.Tables.Count > 0 Then
Return data.Tables(0)
Else
Return Nothing
End If
Else
Return Nothing
End If
End Function
Public Shared Function UpdateCnmListGroup(ByVal hotelId As Integer, ByVal CnmListId As Integer, ByVal GroupId As Integer, ByVal tag As Integer) As Boolean
Dim parms(4) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(1).Value = hotelId
parms(2) = New SqlParameter("@nCnmListId", SqlDbType.Int)
parms(2).Value = CnmListId
parms(3) = New SqlParameter("@nGroupId", SqlDbType.Int)
parms(3).Value = GroupId
parms(4) = New SqlParameter("@tag", SqlDbType.Int)
parms(4).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_UpdateCnmListGroup", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function DoAccountCtrl(ByRef ListId As Integer, ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal ConsumeKindId As Integer, _
ByVal IsControl As Boolean, ByVal jobTimeListId As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, ByVal tag As Integer) As Boolean
Dim parms(10) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nListId", SqlDbType.Int)
parms(1).Direction = ParameterDirection.InputOutput
parms(1).Value = ListId
parms(2) = New SqlParameter("@nConsumeKindId", SqlDbType.Int)
parms(2).Value = ConsumeKindId
parms(3) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(3).Value = ParentId
parms(4) = New SqlParameter("@bIsControl", SqlDbType.Bit)
parms(4).Value = IsControl
parms(5) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(5).Value = jobTimeListId
parms(6) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(6).Value = userId
parms(7) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(7).Value = computer
parms(8) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(8).Value = remark
parms(9) = New SqlParameter("@tag", SqlDbType.Int)
parms(9).Value = tag
parms(10) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(10).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_DoAccountCtrl", Nothing, parms)
If parms(0).Value = 1 Then
ListId = parms(1).Value
Return True
Else
ListId = -1
Return False
End If
End Function
Public Shared Function DoAutoTransferSet(ByVal hotelId As Integer, ByVal Type As Integer, ByVal SourceId As Integer, ByVal ConsumeKindId As Integer, _
ByVal IsControl As Boolean, ByVal TargetId As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, ByVal tag As Integer) As Boolean
Dim parms(10) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@Type", SqlDbType.Int)
parms(1).Value = Type
parms(2) = New SqlParameter("@nSourceId", SqlDbType.Int)
parms(2).Value = SourceId
parms(3) = New SqlParameter("@nTargetId", SqlDbType.Int)
parms(3).Value = TargetId
parms(4) = New SqlParameter("@nConsumeKindId", SqlDbType.Int)
parms(4).Value = ConsumeKindId
parms(5) = New SqlParameter("@bIsCtrl", SqlDbType.Bit)
parms(5).Value = IsControl
parms(6) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(6).Value = userId
parms(7) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(7).Value = computer
parms(8) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(8).Value = remark
parms(9) = New SqlParameter("@tag", SqlDbType.Int)
parms(9).Value = tag
parms(10) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(10).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_DoAutoTransferSet", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function GetTeamAccountList(ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal tag As Integer) As DataTable
Dim data As DataSet
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(1).Value = ParentId
parms(2) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(2).Value = hotelId
parms(3) = New SqlParameter("@tag", SqlDbType.Int)
parms(3).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetTeamAccountList", data, parms)
If parms(0).Value = 1 Then
If data.Tables.Count > 0 Then
Return data.Tables(0)
Else
Return Nothing
End If
Else
Return Nothing
End If
End Function
Public Shared Function GetCashOptionGroupList(ByVal hotelId As Integer, ByVal CashId As Integer, ByVal tag As Integer) As DataTable()
Dim data As DataSet
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nCashId", SqlDbType.Int)
parms(1).Value = CashId
parms(2) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(2).Value = hotelId
parms(3) = New SqlParameter("@tag", SqlDbType.Int)
parms(3).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetGathCashItmList", data, parms)
If parms(0).Value = 1 Then
If data.Tables.Count > 0 Then
Return New DataTable() {data.Tables(0), data.Tables(1)}
Else
Return Nothing
End If
Else
Return Nothing
End If
End Function
Public Shared Function CheckIsBackable(ByVal hotelId As Integer, ByVal Id As Integer, ByVal tag As Integer) As Boolean
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = Id
parms(2) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(2).Value = hotelId
parms(3) = New SqlParameter("@tag", SqlDbType.Int)
parms(3).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_DoCheckIsBackable", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function DoBackBillGuest(ByVal hotelId As Integer, ByVal Id As Integer, ByVal userId As Integer, ByVal computer As String, ByVal JobTimeListId As Integer, ByVal RemaRk As String, ByVal tag As Integer, ByVal RemarkId As Integer) As Boolean
Dim parms(8) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = Id
parms(2) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(2).Value = hotelId
parms(3) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(3).Value = userId
parms(4) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(4).Value = computer
parms(5) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(5).Value = JobTimeListId
parms(6) = New SqlParameter("@tag", SqlDbType.Int)
parms(6).Value = tag
parms(7) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(7).Value = RemaRk
parms(8) = New SqlParameter("@nRemarkId", SqlDbType.Int)
parms(8).Value = RemarkId
Util.ExecProc("", CnnStr.MainCnnStr, "P_DoBackBillGuest", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function DoBackGathCashItm(ByVal hotelId As Integer, ByVal CashId As Integer, ByVal UserId As Integer, ByVal Computer As String, ByVal JobTimeListId As Integer, ByVal tag As Integer) As Boolean
Dim parms(6) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nCashId", SqlDbType.Int)
parms(1).Value = CashId
parms(2) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(2).Value = hotelId
parms(3) = New SqlParameter("@nUser", SqlDbType.Int)
parms(3).Value = UserId
parms(4) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(4).Value = Computer
parms(5) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(5).Value = JobTimeListId
parms(6) = New SqlParameter("@tag", SqlDbType.Int)
parms(6).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_DoBackGathCashItmList", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function DoTeamAccountSet(ByVal hotelId As Integer, ByVal BillId As Integer, ByVal ConsumeKindId As Integer, _
ByVal IsControl As Boolean, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, ByVal tag As Integer) As Boolean
Dim parms(8) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nBillId", SqlDbType.Int)
parms(1).Value = BillId
parms(2) = New SqlParameter("@nConsumeKindId", SqlDbType.Int)
parms(2).Value = ConsumeKindId
parms(3) = New SqlParameter("@bIsCtrl", SqlDbType.Bit)
parms(3).Value = IsControl
parms(4) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(4).Value = userId
parms(5) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(5).Value = computer
parms(6) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(6).Value = remark
parms(7) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(7).Value = hotelId
parms(8) = New SqlParameter("@tag", SqlDbType.Int)
parms(8).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_DoTeamAccountSet", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function DoTransfer(ByVal hotelId As Integer, ByVal TargType As Integer, _
ByVal SrcId As Integer, ByVal TargId As Integer, ByVal CnmListId As Integer, _
ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal jobTimeListId As Integer, ByVal SrcType As Integer) As Boolean
Dim parms(10) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@SrcType", SqlDbType.Int)
parms(1).Value = SrcType
parms(10) = New SqlParameter("@TargType", SqlDbType.Int)
parms(10).Value = TargType
parms(2) = New SqlParameter("@nSrcId", SqlDbType.Int)
parms(2).Value = SrcId
parms(3) = New SqlParameter("@nTargId", SqlDbType.Int)
parms(3).Value = TargId
parms(4) = New SqlParameter("@nCnmListId", SqlDbType.Int)
parms(4).Value = CnmListId
parms(5) = New SqlParameter("@nHotelId", SqlDbType.Decimal)
parms(5).Value = hotelId
parms(6) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(6).Value = userId
parms(7) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(7).Value = computer
parms(8) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(8).Value = remark
parms(9) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(9).Value = jobTimeListId
Util.ExecProc("", CnnStr.MainCnnStr, "P_DoTransfer", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function DoPreCashTransfer(ByVal imprestId As Integer, ByVal srcType As Integer, ByVal srcId As Integer, _
ByVal targType As Integer, ByVal targId As Integer, ByVal userId As Integer, _
ByVal jobTimeListId As Integer, ByVal computer As String, ByVal remark As String, ByVal hotelId As Integer) As Boolean
Dim parms(10) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nImprestId", SqlDbType.Int)
parms(1).Value = imprestId
parms(2) = New SqlParameter("@nSrcType", SqlDbType.Int)
parms(2).Value = srcType
parms(3) = New SqlParameter("@nSrcId", SqlDbType.Int)
parms(3).Value = srcId
parms(4) = New SqlParameter("@nTargType", SqlDbType.Int)
parms(4).Value = targType
parms(5) = New SqlParameter("@nTargId", SqlDbType.Int)
parms(5).Value = targId
parms(6) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(6).Value = userId
parms(7) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(7).Value = jobTimeListId
parms(8) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(8).Value = computer
parms(9) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(9).Value = remark
parms(10) = New SqlParameter("@nHotelId", SqlDbType.Decimal)
parms(10).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_DoTransferImprest", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function DoTransfer(ByVal hotelId As Integer, ByVal TargType As Integer, _
ByVal SrcId As Integer, ByVal TargId As Integer, _
ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal jobTimeListId As Integer, ByVal SrcType As Integer) As Boolean
Dim parms(9) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@SrcType", SqlDbType.Int)
parms(1).Value = SrcType
parms(9) = New SqlParameter("@TargType", SqlDbType.Int)
parms(9).Value = TargType
parms(2) = New SqlParameter("@nSrcId", SqlDbType.Int)
parms(2).Value = SrcId
parms(3) = New SqlParameter("@nTargId", SqlDbType.Int)
parms(3).Value = TargId
parms(4) = New SqlParameter("@nHotelId", SqlDbType.Decimal)
parms(4).Value = hotelId
parms(5) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(5).Value = userId
parms(6) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(6).Value = computer
parms(7) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(7).Value = remark
parms(8) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(8).Value = jobTimeListId
Util.ExecProc("", CnnStr.MainCnnStr, "P_Z_DoTransferAll", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function DoSingleWalkIn(ByVal hotelId As Integer, ByRef billId As Integer, ByRef guestId As Integer, ByVal teamName As String, _
ByVal roomId As Integer, ByVal ConsumeRoomProductId As Integer, ByVal pactId As Integer, ByVal memberId As Integer, ByVal memberCardNo As String, _
ByVal price As Decimal, ByVal count As Integer, ByVal guestKindId As Integer, ByVal guestCount As Integer, ByVal kidCount As Integer, _
ByVal countryId As Integer, ByVal provinceId As Integer, ByVal cityId As Integer, ByVal townId As Integer, _
ByVal sex As Integer, ByVal birthday As DateTime, ByVal CertificateId As Integer, ByVal CertificateNo As String, ByVal mobile As String, _
ByVal VirtualGuestId As Integer, ByVal JobKindId As Integer, ByVal jobTimeListId As Integer, _
ByVal company As String, ByVal pactNo As String, ByVal pactCompany As String, ByVal guestName As String, ByVal mobileNo As String, _
ByVal telphoneHome As String, ByVal telphoneCompany As String, ByVal addressHome As String, ByVal addressCompany As String, _
ByVal accountTypeId As Integer, ByVal bankNo As String, ByVal rentKindId As Integer, ByVal authorizerId As Integer, _
ByVal salesmanId As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, _
ByVal ArrivedTime As DateTime, ByVal LeftTime As DateTime, ByVal isToVG As Boolean, ByVal serverFee As Decimal, ByVal IsSecret As Boolean, ByVal firstName As String, ByVal lastName As String, ByVal CertiBeginDate As DateTime, ByVal CertiEndDate As DateTime, ByVal CertiLength As Integer, ByVal pHeadPic As Byte(), ByVal pCardPic As Byte(), ByVal AuthorizationReasonId As Integer) As Boolean
Dim parms(53) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nBillId", SqlDbType.Int)
parms(1).Direction = ParameterDirection.InputOutput
parms(1).Value = billId
parms(2) = New SqlParameter("@nGuestId", SqlDbType.Int)
parms(2).Value = guestId
parms(3) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(3).Value = hotelId
parms(4) = New SqlParameter("@nRentKindId", SqlDbType.Int)
parms(4).Value = rentKindId
parms(5) = New SqlParameter("@nAccountTypeId", SqlDbType.Int)
parms(5).Value = accountTypeId
parms(6) = New SqlParameter("@nPactId", SqlDbType.Int)
parms(6).Value = pactId
parms(7) = New SqlParameter("@cPactNo", SqlDbType.NVarChar, 100)
parms(7).Value = pactNo
parms(8) = New SqlParameter("@cPactCompany", SqlDbType.NVarChar, 100)
parms(8).Value = pactCompany
parms(9) = New SqlParameter("@nRoomId", SqlDbType.Int)
parms(9).Value = roomId
parms(10) = New SqlParameter("@nConsumeRoomProductId", SqlDbType.Int)
parms(10).Value = ConsumeRoomProductId
parms(11) = New SqlParameter("@nSalesmanId", SqlDbType.Int)
parms(11).Value = salesmanId
parms(12) = New SqlParameter("@nAuthorizerId", SqlDbType.Int)
parms(12).Value = authorizerId
parms(13) = New SqlParameter("@nPrice", SqlDbType.Decimal)
parms(13).Value = price
parms(14) = New SqlParameter("@nCount", SqlDbType.Int)
parms(14).Value = count
parms(15) = New SqlParameter("@nGuestKindId", SqlDbType.Int)
parms(15).Value = guestKindId
parms(16) = New SqlParameter("@nGuestCount", SqlDbType.Int)
parms(16).Value = guestCount
parms(17) = New SqlParameter("@nKidCount", SqlDbType.Int)
parms(17).Value = kidCount
parms(18) = New SqlParameter("@dArrivedTime", SqlDbType.DateTime)
parms(18).Value = ArrivedTime
parms(19) = New SqlParameter("@dLeftTime", SqlDbType.DateTime)
parms(19).Value = LeftTime
parms(20) = New SqlParameter("@cGuestName", SqlDbType.NVarChar, 100)
parms(20).Value = guestName
parms(21) = New SqlParameter("@nSex", SqlDbType.Int)
parms(21).Value = sex
parms(22) = New SqlParameter("@dBirthday", SqlDbType.DateTime)
parms(22).Value = birthday
parms(23) = New SqlParameter("@nCountryId", SqlDbType.Int)
parms(23).Value = countryId
parms(24) = New SqlParameter("@nProvinceId", SqlDbType.Int)
parms(24).Value = provinceId
parms(25) = New SqlParameter("@nCityId", SqlDbType.Int)
parms(25).Value = cityId
parms(26) = New SqlParameter("@nTownId", SqlDbType.Int)
parms(26).Value = townId
parms(27) = New SqlParameter("@nCertificateId", SqlDbType.Int)
parms(27).Value = CertificateId
parms(28) = New SqlParameter("@cCertificateNo", SqlDbType.NVarChar, 100)
parms(28).Value = CertificateNo
parms(29) = New SqlParameter("@cMobile", SqlDbType.NVarChar, 100)
parms(29).Value = mobile
parms(30) = New SqlParameter("@cTelphoneHome", SqlDbType.NVarChar, 100)
parms(30).Value = telphoneHome
parms(31) = New SqlParameter("@cTelphoneCompany", SqlDbType.NVarChar, 100)
parms(31).Value = telphoneCompany
parms(32) = New SqlParameter("@cCompany", SqlDbType.NVarChar, 100)
parms(32).Value = company
parms(33) = New SqlParameter("@cAddressHome", SqlDbType.NVarChar, 100)
parms(33).Value = addressHome
parms(34) = New SqlParameter("@cAddressCompany", SqlDbType.NVarChar, 100)
parms(34).Value = addressCompany
parms(35) = New SqlParameter("@nVirtualGuestId", SqlDbType.Int)
parms(35).Value = VirtualGuestId
parms(36) = New SqlParameter("@nMemberId", SqlDbType.Int)
parms(36).Value = memberId
parms(37) = New SqlParameter("@cBankNo", SqlDbType.NVarChar, 100)
parms(37).Value = bankNo
parms(38) = New SqlParameter("@nJobKindId", SqlDbType.Int)
parms(38).Value = JobKindId
parms(39) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(39).Value = userId
parms(40) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(40).Value = jobTimeListId
parms(41) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(41).Value = computer
parms(42) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(42).Value = remark
parms(43) = New SqlParameter("@bIsToVG", SqlDbType.Bit)
parms(43).Value = isToVG
parms(44) = New SqlParameter("@nServerFee", SqlDbType.Decimal)
parms(44).Value = serverFee
parms(45) = New SqlParameter("@bIsSecret", SqlDbType.Int)
parms(45).Value = IsSecret
parms(46) = New SqlParameter("@cFirstName", SqlDbType.NVarChar, 100)
parms(46).Value = firstName
parms(47) = New SqlParameter("@cLastName", SqlDbType.NVarChar, 100)
parms(47).Value = lastName
parms(48) = New SqlParameter("@dCertiBeginDate", SqlDbType.DateTime)
parms(48).Value = CertiBeginDate
parms(49) = New SqlParameter("@dCertiEndDate", SqlDbType.DateTime)
parms(49).Value = CertiEndDate
parms(50) = New SqlParameter("@nCertiLength", SqlDbType.Int)
parms(50).Value = CertiLength
parms(51) = New SqlParameter("@pHeadPic", SqlDbType.Image)
parms(51).Value = pHeadPic
parms(52) = New SqlParameter("@pCardPic", SqlDbType.Image)
parms(52).Value = pCardPic
parms(53) = New SqlParameter("@nAuthorizationReasonId", SqlDbType.Int)
parms(53).Value = AuthorizationReasonId
Util.ExecProc("", CnnStr.MainCnnStr, "P_GuestWalkInSingle", Nothing, parms)
If parms(0).Value = 1 Then
billId = parms(1).Value
Return True
Else
Return False
End If
End Function
Public Shared Function SplitCnmList(ByVal hotelId As Integer, ByVal CnmListId As Integer, ByVal ParentId As Integer, _
ByVal productId As Integer, ByVal productTypeId As Integer, ByVal Value As Decimal, _
ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal jobTimeListId As Integer, ByVal tag As Integer, ByVal optionTime As DateTime, ByVal oldId As Integer) As Boolean
Dim parms(13) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = CnmListId
parms(2) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(2).Value = hotelId
parms(3) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(3).Value = ParentId
parms(4) = New SqlParameter("@nProductId", SqlDbType.Int)
parms(4).Value = productId
parms(5) = New SqlParameter("@nProductTypeId", SqlDbType.Int)
parms(5).Value = productTypeId
parms(6) = New SqlParameter("@nValue", SqlDbType.Decimal)
parms(6).Value = Value
parms(7) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(7).Value = userId
parms(8) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(8).Value = computer
parms(9) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(9).Value = remark
parms(10) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(10).Value = jobTimeListId
parms(11) = New SqlParameter("@tag", SqlDbType.Int)
parms(11).Value = tag
parms(12) = New SqlParameter("@optionTime", SqlDbType.DateTime)
parms(12).Value = optionTime
parms(13) = New SqlParameter("@OldId", SqlDbType.Int)
parms(13).Value = oldId
Util.ExecProc("", CnnStr.MainCnnStr, "P_UpdateCnmList", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function GatherCnmList(ByVal hotelId As Integer, ByVal CnmListId As Integer, ByVal Value As Decimal, _
ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal jobTimeListId As Integer, ByVal tag As Integer) As Boolean
Dim parms(8) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nCnmListId", SqlDbType.Int)
parms(1).Value = CnmListId
parms(2) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(2).Value = hotelId
parms(3) = New SqlParameter("@nValue", SqlDbType.Decimal)
parms(3).Value = Value
parms(4) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(4).Value = userId
parms(5) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(5).Value = computer
parms(6) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(6).Value = remark
parms(7) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(7).Value = jobTimeListId
parms(8) = New SqlParameter("@tag", SqlDbType.Int)
parms(8).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_GatherCnmList", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
#End Region
#Region "Tran Model"
Private _util As Util
Public Sub New()
Me._util = New Util()
End Sub
Public Sub BeginTran(ByVal hotelId As Integer)
Me._util.BeginTran(CnnStr.MainCnnStr)
End Sub
Public Sub CommitTran()
_util.CommitTran()
End Sub
Public Sub RollBackTran()
_util.RollBackTran()
End Sub
Public Function InsertPCashList(ByVal hotelid As Integer, ByRef id As Integer, ByVal ParentId As Integer, ByVal payTypeId As Integer, ByVal payTypeName As String, _
ByVal rate As Decimal, ByVal money As Decimal, ByVal jobTimeListId As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, ByVal tag As Integer, ByVal ImprestId As Integer, ByVal PreBillCode As String, ByVal CshGroupId As Integer) As Boolean
Dim parms(15) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(1).Value = ParentId
parms(2) = New SqlParameter("@nPayTypeId", SqlDbType.Int)
parms(2).Value = payTypeId
parms(3) = New SqlParameter("@cPayTypeName", SqlDbType.NVarChar, 50)
parms(3).Value = payTypeName
parms(4) = New SqlParameter("@nRate", SqlDbType.Decimal)
parms(4).Value = rate
parms(5) = New SqlParameter("@nMoney", SqlDbType.Decimal)
parms(5).Value = money
parms(6) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(6).Value = jobTimeListId
parms(7) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(7).Value = userId
parms(8) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(8).Value = computer
parms(9) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(9).Value = remark
parms(10) = New SqlParameter("@tag", SqlDbType.Int)
parms(10).Value = tag
parms(11) = New SqlParameter("@nId", SqlDbType.Int)
parms(11).Direction = ParameterDirection.Output
parms(12) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(12).Value = hotelid
parms(13) = New SqlParameter("@nImprestId", SqlDbType.Int)
parms(13).Value = ImprestId
parms(14) = New SqlParameter("@cPreBillCode", SqlDbType.NVarChar, 100)
parms(14).Value = PreBillCode
parms(15) = New SqlParameter("@nCshGroupId", SqlDbType.Int)
parms(15).Value = CshGroupId
_util.ExecProcs("", "P_InsertCashList", parms)
If parms(0).Value = 1 Then
id = parms(11).Value
Return True
Else
id = -1
Return False
End If
End Function
Public Function CashingCnmList(ByVal hotelId As Integer, ByVal listId As Integer, ByVal jobTimeListId As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, ByVal tag As Integer, ByVal CshGroupId As Integer) As Boolean
Dim parms(8) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nListId", SqlDbType.Int)
parms(1).Value = listId
parms(2) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(2).Value = jobTimeListId
parms(3) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(3).Value = userId
parms(4) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(4).Value = computer
parms(5) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(5).Value = remark
parms(6) = New SqlParameter("@tag", SqlDbType.Int)
parms(6).Value = tag
parms(7) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(7).Value = hotelId
parms(8) = New SqlParameter("@nCshGroupId", SqlDbType.Int)
parms(8).Value = CshGroupId
_util.ExecProcs("", "P_CashingCnmList", parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Function InsertCNMCashList(ByVal hotelId As Integer, ByRef id As Integer, ByVal CnmListId As Integer, ByVal CashId As Integer, ByVal PayValue As Decimal, ByVal tag As Integer, ByRef CshGroupId As Integer) As Boolean
Dim parms(7) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Direction = ParameterDirection.Output
parms(2) = New SqlParameter("@nCnmListId", SqlDbType.Int)
parms(2).Value = CnmListId
parms(3) = New SqlParameter("@nCashId", SqlDbType.Int)
parms(3).Value = CashId
parms(4) = New SqlParameter("@nPayValue", SqlDbType.Decimal)
parms(4).Value = PayValue
parms(5) = New SqlParameter("@tag", SqlDbType.Int)
parms(5).Value = tag
parms(6) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(6).Value = hotelId
parms(7) = New SqlParameter("@nCshGroupId", SqlDbType.Int)
parms(7).Direction = ParameterDirection.InputOutput
parms(7).Value = CshGroupId
_util.ExecProcs("", "P_InsertCnmCashList", parms)
If parms(0).Value = 1 Then
id = parms(1).Value
CshGroupId = parms(7).Value
Return True
Else
id = -1
CshGroupId = -1
Return False
End If
End Function
Public Function TransferToFA(ByVal hotelId As Integer, ByVal pctId As Integer, ByVal MemberId As Integer, ByVal CnmListId As Integer, ByVal userId As Integer, ByVal jobTimeListId As Integer, ByRef computer As String, ByVal remark As String, ByVal tag As Integer) As Boolean
Dim parms(9) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(1).Value = hotelId
parms(2) = New SqlParameter("@nCompanyId", SqlDbType.Int)
parms(2).Value = pctId
parms(3) = New SqlParameter("@nMemberId", SqlDbType.Int)
parms(3).Value = MemberId
parms(4) = New SqlParameter("@nCnmListId", SqlDbType.Int)
parms(4).Value = CnmListId
parms(5) = New SqlParameter("@tag", SqlDbType.Int)
parms(5).Value = tag
parms(6) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(6).Value = userId
parms(7) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(7).Value = jobTimeListId
parms(8) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(8).Value = computer
parms(9) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(9).Value = remark
_util.ExecProcs("", "P_Z_TransferToFA", parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
#Region "转应收-Cl"
'消费记录
Public Shared Function InsertFACnmList(ByRef id As Integer, ByVal OldCnmListId As Integer, ByVal FinanceAccountId As Integer, ByVal ProductTypeId As Integer, ByVal ProductId As Integer, ByVal Count As Integer, ByVal Price As Decimal, ByVal JobTimeListId As Integer, ByVal UserId As Integer, ByVal Computer As String, ByVal Remark As String, ByVal HotelId As Integer, ByVal GroupId As Integer, ByVal OutBillCode As String, ByVal tag As Integer) As Boolean
Dim parms(15) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Direction = ParameterDirection.Output
parms(2) = New SqlParameter("@nOldCnmListId", SqlDbType.Int)
parms(2).Value = OldCnmListId
parms(3) = New SqlParameter("@nFinanceAccountId", SqlDbType.Int)
parms(3).Value = FinanceAccountId
parms(4) = New SqlParameter("@nProductTypeId", SqlDbType.Int)
parms(4).Value = ProductTypeId
parms(5) = New SqlParameter("@nProductId", SqlDbType.Int)
parms(5).Value = ProductId
parms(6) = New SqlParameter("@nCount", SqlDbType.Int)
parms(6).Value = Count
parms(7) = New SqlParameter("@nPrice", SqlDbType.Decimal)
parms(7).Value = Price
parms(8) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(8).Value = JobTimeListId
parms(9) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(9).Value = UserId
parms(10) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(10).Value = Computer
parms(11) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(11).Value = Remark
parms(12) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(12).Value = HotelId
parms(13) = New SqlParameter("@nGroupId", SqlDbType.Int)
parms(13).Value = GroupId
parms(14) = New SqlParameter("@cOutBillCode", SqlDbType.NVarChar, 50)
parms(14).Value = OutBillCode
parms(15) = New SqlParameter("@tag", SqlDbType.Int)
parms(15).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_InsertFACnmList", Nothing, parms)
If parms(0).Value = 1 Then
id = parms(1).Value
Return True
Else
id = -1
Return False
End If
End Function
'付款记录
Public Shared Function InsertFACash(ByVal HotelId As Integer, ByRef id As Integer, ByVal CompanyId As Integer, ByVal Rate As Decimal, ByVal Money As Decimal, ByVal JobTimeListId As Integer, ByVal UserId As Integer, ByVal Computer As String, ByVal Remark As String, ByVal tag As Integer) As Boolean
Dim parms(10) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Direction = ParameterDirection.Output
parms(2) = New SqlParameter("@nCompanyId", SqlDbType.Int)
parms(2).Value = CompanyId
parms(3) = New SqlParameter("@nRate", SqlDbType.Decimal)
parms(3).Value = Rate
parms(4) = New SqlParameter("@nMoney", SqlDbType.Decimal)
parms(4).Value = Money
parms(5) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(5).Value = JobTimeListId
parms(6) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(6).Value = UserId
parms(7) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(7).Value = Computer
parms(8) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(8).Value = Remark
parms(9) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(9).Value = HotelId
parms(10) = New SqlParameter("@tag", SqlDbType.Int)
parms(10).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_InsertFACash", Nothing, parms)
If parms(0).Value = 1 Then
id = parms(1).Value
Return True
Else
id = -1
Return False
End If
End Function
'付款-消费记录
Public Shared Function InsertFACnmCsh(ByVal HotelId As Integer, ByVal id As Integer, ByVal FACnmListId As Integer, ByVal FACashId As Integer, ByVal PayValue As Decimal, ByVal tag As Integer) As Boolean
Dim parms(6) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Direction = ParameterDirection.Output
parms(2) = New SqlParameter("@nFACnmListId", SqlDbType.Int)
parms(2).Value = FACnmListId
parms(3) = New SqlParameter("@nFACashId", SqlDbType.Int)
parms(3).Value = FACashId
parms(4) = New SqlParameter("@nPayValue", SqlDbType.Decimal)
parms(4).Value = PayValue
parms(5) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(5).Value = HotelId
parms(6) = New SqlParameter("@tag", SqlDbType.Int)
parms(6).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_InsertFACnmCsh", Nothing, parms)
If parms(0).Value = 1 Then
id = parms(1).Value
Return True
Else
id = -1
Return False
End If
End Function
#End Region
#End Region
Public Shared Function QueryBill(ByVal hotelId As Integer, ByVal billStateName As String, ByVal accountTypeName As String, _
ByVal rentKindId As Integer, ByVal pactCompany As String, ByVal teamName As String, ByVal teamCode As String, ByVal reserveCode As String, _
ByVal salesmanId As Integer, ByVal addressHome As String, ByVal guestName As String, ByVal arrivedTimeMin As DateTime, _
ByVal arrivedTimeMax As DateTime, ByVal leftTimeMin As DateTime, ByVal leftTimeMax As DateTime) As DataTable
Dim parms(15) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(1).Value = hotelId
parms(2) = New SqlParameter("@cBillStateName", SqlDbType.NVarChar, 50)
parms(2).Value = Util.CheckParameter(billStateName)
parms(3) = New SqlParameter("@cAccountTypeName", SqlDbType.NVarChar, 50)
parms(3).Value = Util.CheckParameter(accountTypeName)
parms(4) = New SqlParameter("@nRentKindId", SqlDbType.Int)
parms(4).Value = Util.CheckParameter(rentKindId)
parms(5) = New SqlParameter("@cPactCompany", SqlDbType.NVarChar, 200)
parms(5).Value = Util.CheckParameter(pactCompany)
parms(6) = New SqlParameter("@cTeamName", SqlDbType.NVarChar, 50)
parms(6).Value = Util.CheckParameter(teamName)
parms(7) = New SqlParameter("@cTeamCode", SqlDbType.NVarChar, 50)
parms(7).Value = Util.CheckParameter(teamCode)
parms(8) = New SqlParameter("@cReserveCode", SqlDbType.NVarChar, 100)
parms(8).Value = Util.CheckParameter(reserveCode)
parms(9) = New SqlParameter("@nSalesmanId", SqlDbType.Int)
parms(9).Value = Util.CheckParameter(salesmanId)
parms(10) = New SqlParameter("@cAddressHome", SqlDbType.NVarChar, 200)
parms(10).Value = Util.CheckParameter(addressHome)
parms(11) = New SqlParameter("@cGuestName", SqlDbType.NVarChar, 50)
parms(11).Value = Util.CheckParameter(guestName)
parms(12) = New SqlParameter("@dArrivedTimeMin", SqlDbType.DateTime)
parms(12).Value = Util.CheckParameter(arrivedTimeMin)
parms(13) = New SqlParameter("@dArrivedTimeMax", SqlDbType.DateTime)
parms(13).Value = Util.CheckParameter(arrivedTimeMax)
parms(14) = New SqlParameter("@dLeftTimeMin", SqlDbType.DateTime)
parms(14).Value = Util.CheckParameter(leftTimeMin)
parms(15) = New SqlParameter("@dLeftTimeMax", SqlDbType.DateTime)
parms(15).Value = Util.CheckParameter(leftTimeMax)
Return Pub.GetDatatable(CnnStr.MainCnnStr, "P_QueryBill", parms)
End Function
Public Shared Function SetConsumeListState_FACnmList(ByVal hotelId As Integer, ByVal id As Integer, ByVal stateId As Integer) As Boolean
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(1).Value = hotelId
parms(2) = New SqlParameter("@nId", SqlDbType.Int)
parms(2).Value = id
parms(3) = New SqlParameter("@nStateId", SqlDbType.Int)
parms(3).Value = stateId
Util.ExecProc("", CnnStr.MainCnnStr, "P_SetConsumeListState_FACnmList", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function GetFinishedImprestList(ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal tag As Integer) As DataTable()
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(1).Value = hotelId
parms(2) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(2).Value = ParentId
parms(3) = New SqlParameter("@tag", SqlDbType.Int)
parms(3).Value = tag
Dim ds As DataSet
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetImprestListByBillAndGuest", ds, parms)
If parms(0).Value = 1 And ds.Tables.Count > 1 Then
Return New DataTable() {ds.Tables(0), ds.Tables(1)}
Else
Return Nothing
End If
End Function
Public Shared Function GetFACashList(ByVal hotelId As Integer) As DataTable
Dim parms(1) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(1).Value = hotelId
Return Pub.GetDatatable(CnnStr.MainCnnStr, "P_GetFACashList", parms)
End Function
Public Shared Function GetTransferConsume(ByVal hotelId As Integer, ByVal HallId As Integer) As DataTable
Return GetTransferConsume(hotelId, HallId, -1, 0)
End Function
Public Shared Function GetTransferConsume(ByVal hotelId As Integer, ByVal HallId As Integer, ByVal targId As Integer, ByVal tag As Integer) As DataTable
Dim parms(4) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(1).Value = hotelId
parms(2) = New SqlParameter("@nHallId", SqlDbType.Int)
parms(2).Value = HallId
parms(3) = New SqlParameter("@nTargId", SqlDbType.Int)
parms(3).Value = targId
parms(4) = New SqlParameter("@tag", SqlDbType.Int)
parms(4).Value = tag
Return Pub.GetDatatable(CnnStr.MainCnnStr, "P_GetConsumeByHall", parms)
End Function
'cl20090903
Public Shared Function DoEditCashRemark(ByVal Id As Integer, ByVal Remark As String, ByVal HotelId As Integer, ByVal Tag As Integer) As Boolean
Dim parms(4) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = Id
parms(2) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(2).Value = Remark
parms(3) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(3).Value = HotelId
parms(4) = New SqlParameter("@nTag", SqlDbType.Int)
parms(4).Value = Tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_DoEditCashRemark", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function GetCashSumOrDetail(ByVal hotelId As Integer, ByVal id As Integer, ByVal tag As Integer, ByVal cursor As Integer) As DataTable
Dim parms(3) As SqlParameter
Dim ds As DataSet
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = id
parms(2) = New SqlParameter("@tag", SqlDbType.Int)
parms(2).Value = tag
parms(3) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(3).Value = hotelId
Select Case cursor
Case 1
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetCashDetail_Consume", ds, parms)
Case 2
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetCashDetail_Date", ds, parms)
Case 3
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetCashSum_Consume", ds, parms)
Case 4
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetCashSum_Date", ds, parms)
End Select
If parms(0).Value = 1 AndAlso ds.Tables.Count > 0 Then
Return ds.Tables(0)
Else
Return Nothing
End If
End Function
Public Function GetGlobalId() As Integer
Dim parms(0) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetGlobalId", Nothing, parms)
Return parms(0).Value
End Function
End Class
Imports System.Data
Imports System.Data.SqlClient
Imports HNA.Common.ServerData
Public Class BillAccess
#Region "Shared function"
Public Shared Function SaveBill(ByVal hotelId As Integer, ByVal vBill As BillBase, ByVal userId As Integer, ByVal computer As String) As Boolean
Dim parms(24) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = vBill.Id
parms(2) = New SqlParameter("@cTeamName", SqlDbType.NVarChar, 100)
parms(2).Value = vBill.TeamName
parms(3) = New SqlParameter("@nMemberId", SqlDbType.Int)
parms(3).Value = vBill.MemberId
parms(4) = New SqlParameter("@cMemberCardNo", SqlDbType.NVarChar, 100)
parms(4).Value = vBill.MemberCardNo
parms(5) = New SqlParameter("@cCompany", SqlDbType.NVarChar, 100)
parms(5).Value = vBill.Company
parms(6) = New SqlParameter("@cPactNo", SqlDbType.NVarChar, 100)
parms(6).Value = vBill.PactNo
parms(7) = New SqlParameter("@cPactCompany", SqlDbType.NVarChar, 100)
parms(7).Value = vBill.PactCompany
parms(8) = New SqlParameter("@cGuestName", SqlDbType.NVarChar, 100)
parms(8).Value = vBill.GuestName
parms(9) = New SqlParameter("@cMobileNo", SqlDbType.NVarChar, 100)
parms(9).Value = vBill.MobileNo
parms(10) = New SqlParameter("@cTelphoneHome", SqlDbType.NVarChar, 100)
parms(10).Value = vBill.TelphoneHome
parms(11) = New SqlParameter("@cAddressHome", SqlDbType.NVarChar, 100)
parms(11).Value = vBill.AddressHome
parms(12) = New SqlParameter("@cAddressCompany", SqlDbType.NVarChar, 100)
parms(12).Value = vBill.AddressCompany
parms(13) = New SqlParameter("@nAccountTypeId", SqlDbType.Int)
parms(13).Value = vBill.AccountTypeId
parms(14) = New SqlParameter("@cBalanceNo", SqlDbType.NVarChar, 100)
parms(14).Value = vBill.BalanceNo
parms(15) = New SqlParameter("@nRentKindId", SqlDbType.Int)
parms(15).Value = vBill.RentKindId
parms(16) = New SqlParameter("@nAuthorizerId", SqlDbType.Int)
parms(16).Value = vBill.AuthorizerId
parms(17) = New SqlParameter("@nSalesmanId", SqlDbType.Int)
parms(17).Value = vBill.SalesmanId
parms(18) = New SqlParameter("@dArrivedTime", SqlDbType.DateTime)
parms(18).Value = vBill.ArrivedTime
parms(19) = New SqlParameter("@dLeftTime", SqlDbType.DateTime)
parms(19).Value = vBill.LeftTime
parms(20) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(20).Value = userId
parms(21) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(21).Value = computer
parms(22) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(22).Value = vBill.Remark
parms(23) = New SqlParameter("@cTelphoneCompany", SqlDbType.NVarChar, 100)
parms(23).Value = vBill.TelphoneCompany
parms(24) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(24).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_UpdateBill", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
'Public Shared Function SaveBill(ByVal hotelId As Integer, ByVal Id As Integer, ByVal teamName As String, ByVal memberId As Integer, ByVal memberCardNo As String, _
' ByVal company As String, ByVal pactNo As String, ByVal pactCompany As String, ByVal guestName As String, ByVal mobileNo As String, _
' ByVal telphoneHome As String, ByVal telphoneCompany As String, ByVal addressHome As String, ByVal addressCompany As String, _
' ByVal accountTypeId As Integer, ByVal balanceNo As String, ByVal rentKindId As Integer, ByVal authorizerId As Integer, _
' ByVal salesmanId As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, _
' ByVal ArrivedTime As DateTime, ByVal LeftTime As DateTime) As Boolean
' Dim parms(24) As SqlParameter
' parms(0) = New SqlParameter("@ret", SqlDbType.Int)
' parms(0).Direction = ParameterDirection.Output
' parms(1) = New SqlParameter("@nId", SqlDbType.Int)
' parms(1).Value = Id
' parms(2) = New SqlParameter("@cTeamName", SqlDbType.NVarChar, 100)
' parms(2).Value = teamName
' parms(3) = New SqlParameter("@nMemberId", SqlDbType.Int)
' parms(3).Value = memberId
' parms(4) = New SqlParameter("@cMemberCardNo", SqlDbType.NVarChar, 100)
' parms(4).Value = memberCardNo
' parms(5) = New SqlParameter("@cCompany", SqlDbType.NVarChar, 100)
' parms(5).Value = company
' parms(6) = New SqlParameter("@cPactNo", SqlDbType.NVarChar, 100)
' parms(6).Value = pactNo
' parms(7) = New SqlParameter("@cPactCompany", SqlDbType.NVarChar, 100)
' parms(7).Value = pactCompany
' parms(8) = New SqlParameter("@cGuestName", SqlDbType.NVarChar, 100)
' parms(8).Value = guestName
' parms(9) = New SqlParameter("@cMobileNo", SqlDbType.NVarChar, 100)
' parms(9).Value = mobileNo
' parms(10) = New SqlParameter("@cTelphoneHome", SqlDbType.NVarChar, 100)
' parms(10).Value = telphoneHome
' parms(11) = New SqlParameter("@cAddressHome", SqlDbType.NVarChar, 100)
' parms(11).Value = addressHome
' parms(12) = New SqlParameter("@cAddressCompany", SqlDbType.NVarChar, 100)
' parms(12).Value = addressCompany
' parms(13) = New SqlParameter("@nAccountTypeId", SqlDbType.Int)
' parms(13).Value = accountTypeId
' parms(14) = New SqlParameter("@cBalanceNo", SqlDbType.NVarChar, 100)
' parms(14).Value = balanceNo
' parms(15) = New SqlParameter("@nRentKindId", SqlDbType.Int)
' parms(15).Value = rentKindId
' parms(16) = New SqlParameter("@nAuthorizerId", SqlDbType.Int)
' parms(16).Value = authorizerId
' parms(17) = New SqlParameter("@nSalesmanId", SqlDbType.Int)
' parms(17).Value = salesmanId
' parms(18) = New SqlParameter("@dArrivedTime", SqlDbType.DateTime)
' parms(18).Value = ArrivedTime
' parms(19) = New SqlParameter("@dLeftTime", SqlDbType.DateTime)
' parms(19).Value = LeftTime
' parms(20) = New SqlParameter("@nUserId", SqlDbType.Int)
' parms(20).Value = userId
' parms(21) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
' parms(21).Value = computer
' parms(22) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
' parms(22).Value = remark
' parms(23) = New SqlParameter("@cTelphoneCompany", SqlDbType.NVarChar, 100)
' parms(23).Value = telphoneCompany
' parms(24) = New SqlParameter("@nHotelId", SqlDbType.Int)
' parms(24).Value = hotelId
' Util.ExecProc("", CnnStr.MainCnnStr, "P_UpdateBill", Nothing, parms)
' If parms(0).Value = 1 Then
' Return True
' Else
' Return False
' End If
'End Function
'Public Shared Function CreateSingleBill(ByVal hotelId As Integer, ByVal teamName As String, ByVal memberId As Integer, ByVal memberCardNo As String, _
' ByVal company As String, ByVal pactNo As String, ByVal pactCompany As String, ByVal guestName As String, ByVal mobileNo As String, _
' ByVal telphoneHome As String, ByVal telphoneCompany As String, ByVal addressHome As String, ByVal addressCompany As String, _
' ByVal accountTypeId As Integer, ByVal balanceNo As String, ByVal rentKindId As Integer, ByVal authorizerId As Integer, _
' ByVal salesmanId As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String) As Boolean
Public Shared Function CreateSingleBill(ByVal hotelId As Integer, ByVal vBill As BillBase) As Boolean
Dim parms(21) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@cTeamName", SqlDbType.NVarChar, 100)
parms(1).Value = vBill.TeamName
parms(2) = New SqlParameter("@nMemberId", SqlDbType.Int)
parms(2).Value = vBill.MemberId
parms(3) = New SqlParameter("@cMemberCardNo", SqlDbType.NVarChar, 100)
parms(3).Value = vBill.MemberCardNo
parms(4) = New SqlParameter("@cCompany", SqlDbType.NVarChar, 100)
parms(4).Value = vBill.Company
parms(5) = New SqlParameter("@cPactNo", SqlDbType.NVarChar, 100)
parms(5).Value = vBill.PactNo
parms(6) = New SqlParameter("@cPactCompany", SqlDbType.NVarChar, 100)
parms(6).Value = vBill.PactCompany
parms(7) = New SqlParameter("@cGuestName", SqlDbType.NVarChar, 100)
parms(7).Value = vBill.GuestName
parms(8) = New SqlParameter("@cMobileNo", SqlDbType.NVarChar, 100)
parms(8).Value = vBill.MobileNo
parms(9) = New SqlParameter("@cTelphoneHome", SqlDbType.NVarChar, 100)
parms(9).Value = vBill.TelphoneHome
parms(10) = New SqlParameter("@cTelphoneCompany", SqlDbType.NVarChar, 100)
parms(10).Value = vBill.TelphoneCompany
parms(11) = New SqlParameter("@cAddressHome", SqlDbType.NVarChar, 100)
parms(11).Value = vBill.AddressHome
parms(12) = New SqlParameter("@cAddressCompany", SqlDbType.NVarChar, 100)
parms(12).Value = vBill.AddressCompany
parms(13) = New SqlParameter("@nAccountTypeId", SqlDbType.Int)
parms(13).Value = vBill.AccountTypeId
parms(14) = New SqlParameter("@cBalanceNo", SqlDbType.NVarChar, 100)
parms(14).Value = vBill.BalanceNo
parms(15) = New SqlParameter("@nRentKindId", SqlDbType.Int)
parms(15).Value = vBill.RentKindId
parms(16) = New SqlParameter("@nAuthorizerId", SqlDbType.Int)
parms(16).Value = vBill.AccountTypeId
parms(17) = New SqlParameter("@nSalesmanId", SqlDbType.Int)
parms(17).Value = vBill.SalesmanId
parms(18) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(18).Value = vBill.UserId
parms(19) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(19).Value = vBill.Computer
parms(20) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(20).Value = vBill.Remark
parms(21) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(21).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_CreateSingleBill", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function GetSingleBillList(ByVal hotelId As Integer, ByVal searchStr As String, ByVal tag As Integer) As DataTable
Dim data As DataSet
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@searchStr", SqlDbType.NVarChar, 4000)
parms(1).Value = IIf(searchStr = "", DBNull.Value, searchStr)
parms(2) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(2).Value = hotelId
parms(3) = New SqlParameter("@tag", SqlDbType.Int)
parms(3).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetSingleBillList", data, parms)
If parms(0).Value = 1 Then
If data.Tables.Count > 0 Then
Return data.Tables(0)
Else
Return Nothing
End If
Else
Return Nothing
End If
End Function
Public Shared Function GetSingleBillListPause(ByVal hotelId As Integer) As DataTable
Return Pub.GetDatatable(hotelId, CnnStr.MainCnnStr, "P_ZZ_GetSingleBillListPause")
End Function
Public Shared Function GetTeamBillList(ByVal hotelId As Integer, ByVal searchStr As String, ByVal tag As Integer) As DataTable()
Dim ds As DataSet
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(1).Value = hotelId
parms(2) = New SqlParameter("@searchStr", SqlDbType.NVarChar, 4000)
parms(2).Value = IIf(searchStr = "", DBNull.Value, searchStr)
parms(3) = New SqlParameter("@tag", SqlDbType.Int)
parms(3).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetTeamBillList", ds, parms)
If parms(0).Value = 1 Then
If ds Is Nothing Then Return Nothing
If ds.Tables.Count <> 2 Then Return Nothing
Return New DataTable(1) {ds.Tables(0), ds.Tables(1)}
Else
Return Nothing
End If
End Function
Public Shared Function GetTeamBillListPause(ByVal hotelId As Integer) As DataTable()
Dim ds As DataSet
Dim parms(0) As SqlParameter
parms(0) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(0).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_ZZ_GetTeamBillListPause", ds, parms)
If ds Is Nothing Then Return Nothing
If ds.Tables.Count <> 2 Then Return Nothing
Return New DataTable(1) {ds.Tables(0), ds.Tables(1)}
End Function
Private Shared Function GetCnmList(ByVal hotelId As Integer, ByVal BillId As Integer, ByVal procName As String) As DataTable
Dim data As DataSet
Dim parms(2) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nBillId", SqlDbType.Int)
parms(1).Value = BillId
parms(2) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(2).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, procName, data, parms)
If parms(0).Value = 1 Then
If data.Tables.Count > 0 Then
Return data.Tables(0)
Else
Return Nothing
End If
Else
Return Nothing
End If
End Function
Public Shared Function GetCnmListAll(ByVal hotelId As Integer, ByVal BillId As Integer) As DataTable
Return GetCnmList(hotelId, BillId, "P_GetBillCnmList_All")
End Function
Public Shared Function GetCnmListCancel(ByVal hotelId As Integer, ByVal BillId As Integer) As DataTable
Return GetCnmList(hotelId, BillId, "P_GetBillCnmList_Cancel")
End Function
Public Shared Function GetCnmListCashed(ByVal hotelId As Integer, ByVal BillId As Integer) As DataTable
Return GetCnmList(hotelId, BillId, "P_GetBillCnmList_Cashed")
End Function
Public Shared Function GetCnmListNoCash(ByVal hotelId As Integer, ByVal BillId As Integer) As DataTable
Return GetCnmList(hotelId, BillId, "P_GetBillCnmList_NoCashed")
End Function
Public Shared Function GetCnmListTurnIn(ByVal hotelId As Integer, ByVal BillId As Integer) As DataTable
Return GetCnmList(hotelId, BillId, "P_GetBillCnmList_TurnIn")
End Function
Public Shared Function GetCnmListTurnOut(ByVal hotelId As Integer, ByVal BillId As Integer) As DataTable
Return GetCnmList(hotelId, BillId, "P_GetBillCnmList_TurnOut")
End Function
Public Shared Function AddConsume(ByVal hotelId As Integer, ByVal billId As Integer, _
ByVal productId As Integer, ByVal productTypeId As Integer, ByVal count As Decimal, _
ByVal price As Decimal, ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal jobTimeListId As Integer, ByVal outBillCode As String, ByVal tag As Integer) As Boolean
Dim parms(12) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nbillId", SqlDbType.Int)
parms(1).Value = billId
parms(2) = New SqlParameter("@nProductId", SqlDbType.Int)
parms(2).Value = productId
parms(3) = New SqlParameter("@nProductTypeId", SqlDbType.Int)
parms(3).Value = productTypeId
parms(4) = New SqlParameter("@nCount", SqlDbType.Decimal)
parms(4).Value = count
parms(5) = New SqlParameter("@nPrice", SqlDbType.Decimal)
parms(5).Value = price
parms(6) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(6).Value = userId
parms(7) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(7).Value = computer
parms(8) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(8).Value = remark
parms(9) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(9).Value = jobTimeListId
parms(10) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(10).Value = hotelId
parms(11) = New SqlParameter("@cOutBillCode", SqlDbType.NVarChar, 50)
parms(11).Value = outBillCode
parms(12) = New SqlParameter("@tag", SqlDbType.Int)
parms(12).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_InsertBillCnmList", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function CancelConsume(ByVal hotelId As Integer, ByVal CnmListId As Integer, _
ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal jobTimeListId As Integer, ByVal remarkId As Integer) As Boolean
Dim parms(7) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nBillCnmListId", SqlDbType.Int)
parms(1).Value = CnmListId
parms(2) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(2).Value = userId
parms(3) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(3).Value = computer
parms(4) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(4).Value = remark
parms(5) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(5).Value = jobTimeListId
parms(6) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(6).Value = hotelId
parms(7) = New SqlParameter("@nRemarkId", SqlDbType.Int)
parms(7).Value = remarkId
Util.ExecProc("", CnnStr.MainCnnStr, "P_CancelBillCnmList", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function GetCheckedMProductList(ByVal hotelId As Integer, ByVal BillId As Integer) As DataTable
Return GetCnmList(hotelId, BillId, "P_GetBillMPrdtList")
End Function
Public Shared Function AddCheckedCnm(ByRef id As Integer, ByVal hotelId As Integer, ByVal billId As Integer, _
ByVal productId As Integer, ByVal productTypeId As Integer, ByVal count As Decimal, _
ByVal price As Decimal, ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal jobTimeListId As Integer, ByVal isNow As Boolean, ByVal tag As Integer) As Boolean
Dim parms(13) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nbillId", SqlDbType.Int)
parms(1).Value = billId
parms(2) = New SqlParameter("@nProductId", SqlDbType.Int)
parms(2).Value = productId
parms(3) = New SqlParameter("@nProductTypeId", SqlDbType.Int)
parms(3).Value = productTypeId
parms(4) = New SqlParameter("@nCount", SqlDbType.Decimal)
parms(4).Value = count
parms(5) = New SqlParameter("@nPrice", SqlDbType.Decimal)
parms(5).Value = price
parms(6) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(6).Value = userId
parms(7) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(7).Value = computer
parms(8) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(8).Value = remark
parms(9) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(9).Value = jobTimeListId
parms(10) = New SqlParameter("@bIsNow", SqlDbType.Bit)
parms(10).Value = isNow
parms(11) = New SqlParameter("@nId", SqlDbType.Int)
parms(11).Direction = ParameterDirection.Output
parms(12) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(12).Value = hotelId
parms(13) = New SqlParameter("@tag", SqlDbType.Int)
parms(13).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_InertBillMPrdtList", Nothing, parms)
If parms(0).Value = 1 Then
id = parms(11).Value
Return True
Else
Return False
End If
End Function
Public Shared Function CancelCheckedCnm(ByVal hotelId As Integer, ByVal CnmListId As Integer, _
ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal ProductTypeId As Integer, ByVal remarkId As Integer) As Boolean
Dim parms(7) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = CnmListId
parms(2) = New SqlParameter("@nProductTypeId", SqlDbType.Int)
parms(2).Value = ProductTypeId
parms(3) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(3).Value = userId
parms(4) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(4).Value = computer
parms(5) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(5).Value = remark
parms(6) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(6).Value = hotelId
parms(7) = New SqlParameter("@nRemarkId", SqlDbType.Int)
parms(7).Value = remarkId
Util.ExecProc("", CnnStr.MainCnnStr, "P_CancelBillMPrdtList", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function GetPayCashList(ByVal hotelId As Integer, ByVal parentId As Integer) As DataTable
Return GetCashList(hotelId, parentId, 1)
End Function
Public Shared Function GetPreCashList(ByVal hotelId As Integer, ByVal parentId As Integer) As DataTable
Return GetCashList(hotelId, parentId, 3)
End Function
Public Shared Function GetCashList(ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal tag As Integer) As DataTable
Dim data As DataSet
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(1).Value = ParentId
parms(2) = New SqlParameter("@tag", SqlDbType.Int)
parms(2).Value = tag
parms(3) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(3).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetCashList", data, parms)
If parms(0).Value = 1 Then
If data.Tables.Count > 0 Then
Return data.Tables(0)
Else
Return Nothing
End If
Else
Return Nothing
End If
End Function
Public Shared Function GetAccountCtrlList(ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal tag As Integer) As DataTable
Dim data As DataSet
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(1).Value = ParentId
parms(2) = New SqlParameter("@tag", SqlDbType.Int)
parms(2).Value = tag
parms(3) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(3).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetAccountCtrlList", data, parms)
If parms(0).Value = 1 Then
If data.Tables.Count > 0 Then
Return data.Tables(0)
Else
Return Nothing
End If
Else
Return Nothing
End If
End Function
'Public Shared Function InsertPayCashList(ByVal id As Integer, ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal payTypeId As Integer, ByVal payTypeName As String, _
' ByVal rate As Decimal, ByVal money As Decimal, ByVal jobTimeListId As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String) As Boolean
Public Shared Function InsertPayCashList(ByVal id As Integer, ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal item As CashItemBase) As Boolean
Return InsertCashList(id, hotelId, ParentId, item.PayTypeId, item.PayTypeName, item.Rate, item.Money, item.JobTimeListId, item.UserId, item.Computer, item.Remark, "", 1)
End Function
'Public Shared Function InsertPreCashList(ByVal id As Integer, ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal payTypeId As Integer, ByVal payTypeName As String, _
' ByVal rate As Decimal, ByVal money As Decimal, ByVal jobTimeListId As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, ByVal PreBillCode As String) As Boolean
Public Shared Function InsertPreCashList(ByVal id As Integer, ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal item As CashItemBase) As Boolean
Return InsertCashList(id, hotelId, ParentId, item.PayTypeId, item.PayTypeName, item.Rate, item.Money, item.JobTimeListId, item.UserId, item.Computer, item.Remark, item.PreBillCode, 3)
End Function
Public Shared Function InsertCashList(ByRef id As Integer, ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal payTypeId As Integer, ByVal payTypeName As String, _
ByVal rate As Decimal, ByVal money As Decimal, ByVal jobTimeListId As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, ByVal PreBillCode As String, ByVal tag As Integer) As Boolean
Dim parms(13) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(1).Value = ParentId
parms(2) = New SqlParameter("@nPayTypeId", SqlDbType.Int)
parms(2).Value = payTypeId
parms(3) = New SqlParameter("@cPayTypeName", SqlDbType.NVarChar, 50)
parms(3).Value = payTypeName
parms(4) = New SqlParameter("@nRate", SqlDbType.Decimal)
parms(4).Value = rate
parms(5) = New SqlParameter("@nMoney", SqlDbType.Decimal)
parms(5).Value = money
parms(6) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(6).Value = jobTimeListId
parms(7) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(7).Value = userId
parms(8) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(8).Value = computer
parms(9) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(9).Value = remark
parms(10) = New SqlParameter("@tag", SqlDbType.Int)
parms(10).Value = tag
parms(11) = New SqlParameter("@nId", SqlDbType.Int)
parms(11).Direction = ParameterDirection.Output
parms(12) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(12).Value = hotelId
parms(13) = New SqlParameter("@cPreBillCode", SqlDbType.NVarChar, 50)
parms(13).Value = PreBillCode
Util.ExecProc("", CnnStr.MainCnnStr, "P_InsertCashList", Nothing, parms)
If parms(0).Value = 1 Then
id = parms(11).Value
Return True
Else
id = -1
Return False
End If
End Function
Public Shared Function GetCheckPkgList(ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal tag As Integer) As DataTable
Dim data As DataSet
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(1).Value = ParentId
parms(2) = New SqlParameter("@tag", SqlDbType.Int)
parms(2).Value = tag
parms(3) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(3).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetCheckedPkgList", data, parms)
If parms(0).Value = 1 Then
If data.Tables.Count > 0 Then
Return data.Tables(0)
Else
Return Nothing
End If
Else
Return Nothing
End If
End Function
Public Shared Function AddConsumeByPkg(ByVal hotelId As Integer, ByVal ParentId As Integer, _
ByVal PackageId As Integer, ByVal count As Decimal, _
ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal jobTimeListId As Integer, ByVal tag As Integer) As Boolean
Dim parms(9) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(1).Value = ParentId
parms(2) = New SqlParameter("@nPackageId", SqlDbType.Int)
parms(2).Value = PackageId
parms(3) = New SqlParameter("@nCount", SqlDbType.Decimal)
parms(3).Value = count
parms(4) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(4).Value = userId
parms(5) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(5).Value = computer
parms(6) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(6).Value = remark
parms(7) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(7).Value = jobTimeListId
parms(8) = New SqlParameter("@tag", SqlDbType.Int)
parms(8).Value = tag
parms(9) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(9).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_InsertPackageCnmList", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function AddCheckPkg(ByVal hotelId As Integer, ByRef id As Integer, ByVal IsNow As Boolean, ByVal ParentId As Integer, _
ByVal PackageId As Integer, ByVal count As Decimal, _
ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal jobTimeListId As Integer, ByVal tag As Integer) As Boolean
Dim parms(11) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = id
parms(2) = New SqlParameter("@bIsNow", SqlDbType.Bit)
parms(2).Value = IsNow
parms(3) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(3).Value = ParentId
parms(4) = New SqlParameter("@nPackageId", SqlDbType.Int)
parms(4).Value = PackageId
parms(5) = New SqlParameter("@nCount", SqlDbType.Decimal)
parms(5).Value = count
parms(6) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(6).Value = userId
parms(7) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(7).Value = computer
parms(8) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(8).Value = remark
parms(9) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(9).Value = jobTimeListId
parms(10) = New SqlParameter("@tag", SqlDbType.Int)
parms(10).Value = tag
parms(11) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(11).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_InertCheckPkgList", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function CancelCheckedPkg(ByVal hotelId As Integer, ByVal CnmListId As Integer, _
ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal tag As Integer) As Boolean
Dim parms(6) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = CnmListId
parms(2) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(2).Value = userId
parms(3) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(3).Value = computer
parms(4) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(4).Value = remark
parms(5) = New SqlParameter("@tag", SqlDbType.Int)
parms(5).Value = tag
parms(6) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(6).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_CancelCheckPkgList", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function DoLeft(ByVal hotelId As Integer, ByVal Id As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, ByVal tag As Integer) As Boolean
Dim parms(5) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = Id
parms(2) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(2).Value = userId
parms(3) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(3).Value = computer
parms(4) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(4).Value = remark
parms(5) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(5).Value = hotelId
Dim procN As String = ""
If tag = 1 Then
procN = "P_DoLeftSingleBill"
ElseIf tag = 2 Then
procN = "P_DoLeftTeamBill"
Else
procN = "P_DoLeftGuest"
End If
Util.ExecProc("", CnnStr.MainCnnStr, procN, Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function CancelImprest(ByVal hotelId As Integer, ByVal Id As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, ByVal tag As Integer) As Boolean
Dim parms(6) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = Id
parms(2) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(2).Value = userId
parms(3) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(3).Value = computer
parms(4) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(4).Value = remark
parms(5) = New SqlParameter("@tag", SqlDbType.Int)
parms(5).Value = tag
parms(6) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(6).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_CanCelImprest", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function BackImprest(ByVal hotelId As Integer, ByVal Id As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, ByVal JobTimeListId As Integer, ByVal tag As Integer) As Boolean
Dim parms(7) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = Id
parms(2) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(2).Value = userId
parms(3) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(3).Value = computer
parms(4) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(4).Value = remark
parms(5) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(5).Value = JobTimeListId
parms(6) = New SqlParameter("@tag", SqlDbType.Int)
parms(6).Value = tag
parms(7) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(7).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_BackImprest", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function GetAutoTransferList(ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal tag As Integer) As DataTable
Dim data As DataSet
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(1).Value = ParentId
parms(2) = New SqlParameter("@tag", SqlDbType.Int)
parms(2).Value = tag
parms(3) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(3).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetAutoTransferList", data, parms)
If parms(0).Value = 1 Then
If data.Tables.Count > 0 Then
Return data.Tables(0)
Else
Return Nothing
End If
Else
Return Nothing
End If
End Function
Public Shared Function UpdateCnmListGroup(ByVal hotelId As Integer, ByVal CnmListId As Integer, ByVal GroupId As Integer, ByVal tag As Integer) As Boolean
Dim parms(4) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(1).Value = hotelId
parms(2) = New SqlParameter("@nCnmListId", SqlDbType.Int)
parms(2).Value = CnmListId
parms(3) = New SqlParameter("@nGroupId", SqlDbType.Int)
parms(3).Value = GroupId
parms(4) = New SqlParameter("@tag", SqlDbType.Int)
parms(4).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_UpdateCnmListGroup", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function DoAccountCtrl(ByRef ListId As Integer, ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal ConsumeKindId As Integer, _
ByVal IsControl As Boolean, ByVal jobTimeListId As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, ByVal tag As Integer) As Boolean
Dim parms(10) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nListId", SqlDbType.Int)
parms(1).Direction = ParameterDirection.InputOutput
parms(1).Value = ListId
parms(2) = New SqlParameter("@nConsumeKindId", SqlDbType.Int)
parms(2).Value = ConsumeKindId
parms(3) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(3).Value = ParentId
parms(4) = New SqlParameter("@bIsControl", SqlDbType.Bit)
parms(4).Value = IsControl
parms(5) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(5).Value = jobTimeListId
parms(6) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(6).Value = userId
parms(7) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(7).Value = computer
parms(8) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(8).Value = remark
parms(9) = New SqlParameter("@tag", SqlDbType.Int)
parms(9).Value = tag
parms(10) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(10).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_DoAccountCtrl", Nothing, parms)
If parms(0).Value = 1 Then
ListId = parms(1).Value
Return True
Else
ListId = -1
Return False
End If
End Function
Public Shared Function DoAutoTransferSet(ByVal hotelId As Integer, ByVal Type As Integer, ByVal SourceId As Integer, ByVal ConsumeKindId As Integer, _
ByVal IsControl As Boolean, ByVal TargetId As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, ByVal tag As Integer) As Boolean
Dim parms(10) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@Type", SqlDbType.Int)
parms(1).Value = Type
parms(2) = New SqlParameter("@nSourceId", SqlDbType.Int)
parms(2).Value = SourceId
parms(3) = New SqlParameter("@nTargetId", SqlDbType.Int)
parms(3).Value = TargetId
parms(4) = New SqlParameter("@nConsumeKindId", SqlDbType.Int)
parms(4).Value = ConsumeKindId
parms(5) = New SqlParameter("@bIsCtrl", SqlDbType.Bit)
parms(5).Value = IsControl
parms(6) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(6).Value = userId
parms(7) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(7).Value = computer
parms(8) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(8).Value = remark
parms(9) = New SqlParameter("@tag", SqlDbType.Int)
parms(9).Value = tag
parms(10) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(10).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_DoAutoTransferSet", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function GetTeamAccountList(ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal tag As Integer) As DataTable
Dim data As DataSet
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(1).Value = ParentId
parms(2) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(2).Value = hotelId
parms(3) = New SqlParameter("@tag", SqlDbType.Int)
parms(3).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetTeamAccountList", data, parms)
If parms(0).Value = 1 Then
If data.Tables.Count > 0 Then
Return data.Tables(0)
Else
Return Nothing
End If
Else
Return Nothing
End If
End Function
Public Shared Function GetCashOptionGroupList(ByVal hotelId As Integer, ByVal CashId As Integer, ByVal tag As Integer) As DataTable()
Dim data As DataSet
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nCashId", SqlDbType.Int)
parms(1).Value = CashId
parms(2) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(2).Value = hotelId
parms(3) = New SqlParameter("@tag", SqlDbType.Int)
parms(3).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetGathCashItmList", data, parms)
If parms(0).Value = 1 Then
If data.Tables.Count > 0 Then
Return New DataTable() {data.Tables(0), data.Tables(1)}
Else
Return Nothing
End If
Else
Return Nothing
End If
End Function
Public Shared Function CheckIsBackable(ByVal hotelId As Integer, ByVal Id As Integer, ByVal tag As Integer) As Boolean
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = Id
parms(2) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(2).Value = hotelId
parms(3) = New SqlParameter("@tag", SqlDbType.Int)
parms(3).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_DoCheckIsBackable", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function DoBackBillGuest(ByVal hotelId As Integer, ByVal Id As Integer, ByVal userId As Integer, ByVal computer As String, ByVal JobTimeListId As Integer, ByVal RemaRk As String, ByVal tag As Integer, ByVal RemarkId As Integer) As Boolean
Dim parms(8) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = Id
parms(2) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(2).Value = hotelId
parms(3) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(3).Value = userId
parms(4) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(4).Value = computer
parms(5) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(5).Value = JobTimeListId
parms(6) = New SqlParameter("@tag", SqlDbType.Int)
parms(6).Value = tag
parms(7) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(7).Value = RemaRk
parms(8) = New SqlParameter("@nRemarkId", SqlDbType.Int)
parms(8).Value = RemarkId
Util.ExecProc("", CnnStr.MainCnnStr, "P_DoBackBillGuest", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function DoBackGathCashItm(ByVal hotelId As Integer, ByVal CashId As Integer, ByVal UserId As Integer, ByVal Computer As String, ByVal JobTimeListId As Integer, ByVal tag As Integer) As Boolean
Dim parms(6) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nCashId", SqlDbType.Int)
parms(1).Value = CashId
parms(2) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(2).Value = hotelId
parms(3) = New SqlParameter("@nUser", SqlDbType.Int)
parms(3).Value = UserId
parms(4) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(4).Value = Computer
parms(5) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(5).Value = JobTimeListId
parms(6) = New SqlParameter("@tag", SqlDbType.Int)
parms(6).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_DoBackGathCashItmList", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function DoTeamAccountSet(ByVal hotelId As Integer, ByVal BillId As Integer, ByVal ConsumeKindId As Integer, _
ByVal IsControl As Boolean, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, ByVal tag As Integer) As Boolean
Dim parms(8) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nBillId", SqlDbType.Int)
parms(1).Value = BillId
parms(2) = New SqlParameter("@nConsumeKindId", SqlDbType.Int)
parms(2).Value = ConsumeKindId
parms(3) = New SqlParameter("@bIsCtrl", SqlDbType.Bit)
parms(3).Value = IsControl
parms(4) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(4).Value = userId
parms(5) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(5).Value = computer
parms(6) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(6).Value = remark
parms(7) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(7).Value = hotelId
parms(8) = New SqlParameter("@tag", SqlDbType.Int)
parms(8).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_DoTeamAccountSet", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function DoTransfer(ByVal hotelId As Integer, ByVal TargType As Integer, _
ByVal SrcId As Integer, ByVal TargId As Integer, ByVal CnmListId As Integer, _
ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal jobTimeListId As Integer, ByVal SrcType As Integer) As Boolean
Dim parms(10) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@SrcType", SqlDbType.Int)
parms(1).Value = SrcType
parms(10) = New SqlParameter("@TargType", SqlDbType.Int)
parms(10).Value = TargType
parms(2) = New SqlParameter("@nSrcId", SqlDbType.Int)
parms(2).Value = SrcId
parms(3) = New SqlParameter("@nTargId", SqlDbType.Int)
parms(3).Value = TargId
parms(4) = New SqlParameter("@nCnmListId", SqlDbType.Int)
parms(4).Value = CnmListId
parms(5) = New SqlParameter("@nHotelId", SqlDbType.Decimal)
parms(5).Value = hotelId
parms(6) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(6).Value = userId
parms(7) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(7).Value = computer
parms(8) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(8).Value = remark
parms(9) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(9).Value = jobTimeListId
Util.ExecProc("", CnnStr.MainCnnStr, "P_DoTransfer", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function DoPreCashTransfer(ByVal imprestId As Integer, ByVal srcType As Integer, ByVal srcId As Integer, _
ByVal targType As Integer, ByVal targId As Integer, ByVal userId As Integer, _
ByVal jobTimeListId As Integer, ByVal computer As String, ByVal remark As String, ByVal hotelId As Integer) As Boolean
Dim parms(10) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nImprestId", SqlDbType.Int)
parms(1).Value = imprestId
parms(2) = New SqlParameter("@nSrcType", SqlDbType.Int)
parms(2).Value = srcType
parms(3) = New SqlParameter("@nSrcId", SqlDbType.Int)
parms(3).Value = srcId
parms(4) = New SqlParameter("@nTargType", SqlDbType.Int)
parms(4).Value = targType
parms(5) = New SqlParameter("@nTargId", SqlDbType.Int)
parms(5).Value = targId
parms(6) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(6).Value = userId
parms(7) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(7).Value = jobTimeListId
parms(8) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(8).Value = computer
parms(9) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(9).Value = remark
parms(10) = New SqlParameter("@nHotelId", SqlDbType.Decimal)
parms(10).Value = hotelId
Util.ExecProc("", CnnStr.MainCnnStr, "P_DoTransferImprest", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function DoTransfer(ByVal hotelId As Integer, ByVal TargType As Integer, _
ByVal SrcId As Integer, ByVal TargId As Integer, _
ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal jobTimeListId As Integer, ByVal SrcType As Integer) As Boolean
Dim parms(9) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@SrcType", SqlDbType.Int)
parms(1).Value = SrcType
parms(9) = New SqlParameter("@TargType", SqlDbType.Int)
parms(9).Value = TargType
parms(2) = New SqlParameter("@nSrcId", SqlDbType.Int)
parms(2).Value = SrcId
parms(3) = New SqlParameter("@nTargId", SqlDbType.Int)
parms(3).Value = TargId
parms(4) = New SqlParameter("@nHotelId", SqlDbType.Decimal)
parms(4).Value = hotelId
parms(5) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(5).Value = userId
parms(6) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(6).Value = computer
parms(7) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(7).Value = remark
parms(8) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(8).Value = jobTimeListId
Util.ExecProc("", CnnStr.MainCnnStr, "P_Z_DoTransferAll", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function DoSingleWalkIn(ByVal hotelId As Integer, ByRef billId As Integer, ByRef guestId As Integer, ByVal teamName As String, _
ByVal roomId As Integer, ByVal ConsumeRoomProductId As Integer, ByVal pactId As Integer, ByVal memberId As Integer, ByVal memberCardNo As String, _
ByVal price As Decimal, ByVal count As Integer, ByVal guestKindId As Integer, ByVal guestCount As Integer, ByVal kidCount As Integer, _
ByVal countryId As Integer, ByVal provinceId As Integer, ByVal cityId As Integer, ByVal townId As Integer, _
ByVal sex As Integer, ByVal birthday As DateTime, ByVal CertificateId As Integer, ByVal CertificateNo As String, ByVal mobile As String, _
ByVal VirtualGuestId As Integer, ByVal JobKindId As Integer, ByVal jobTimeListId As Integer, _
ByVal company As String, ByVal pactNo As String, ByVal pactCompany As String, ByVal guestName As String, ByVal mobileNo As String, _
ByVal telphoneHome As String, ByVal telphoneCompany As String, ByVal addressHome As String, ByVal addressCompany As String, _
ByVal accountTypeId As Integer, ByVal bankNo As String, ByVal rentKindId As Integer, ByVal authorizerId As Integer, _
ByVal salesmanId As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, _
ByVal ArrivedTime As DateTime, ByVal LeftTime As DateTime, ByVal isToVG As Boolean, ByVal serverFee As Decimal, ByVal IsSecret As Boolean, ByVal firstName As String, ByVal lastName As String, ByVal CertiBeginDate As DateTime, ByVal CertiEndDate As DateTime, ByVal CertiLength As Integer, ByVal pHeadPic As Byte(), ByVal pCardPic As Byte(), ByVal AuthorizationReasonId As Integer) As Boolean
Dim parms(53) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nBillId", SqlDbType.Int)
parms(1).Direction = ParameterDirection.InputOutput
parms(1).Value = billId
parms(2) = New SqlParameter("@nGuestId", SqlDbType.Int)
parms(2).Value = guestId
parms(3) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(3).Value = hotelId
parms(4) = New SqlParameter("@nRentKindId", SqlDbType.Int)
parms(4).Value = rentKindId
parms(5) = New SqlParameter("@nAccountTypeId", SqlDbType.Int)
parms(5).Value = accountTypeId
parms(6) = New SqlParameter("@nPactId", SqlDbType.Int)
parms(6).Value = pactId
parms(7) = New SqlParameter("@cPactNo", SqlDbType.NVarChar, 100)
parms(7).Value = pactNo
parms(8) = New SqlParameter("@cPactCompany", SqlDbType.NVarChar, 100)
parms(8).Value = pactCompany
parms(9) = New SqlParameter("@nRoomId", SqlDbType.Int)
parms(9).Value = roomId
parms(10) = New SqlParameter("@nConsumeRoomProductId", SqlDbType.Int)
parms(10).Value = ConsumeRoomProductId
parms(11) = New SqlParameter("@nSalesmanId", SqlDbType.Int)
parms(11).Value = salesmanId
parms(12) = New SqlParameter("@nAuthorizerId", SqlDbType.Int)
parms(12).Value = authorizerId
parms(13) = New SqlParameter("@nPrice", SqlDbType.Decimal)
parms(13).Value = price
parms(14) = New SqlParameter("@nCount", SqlDbType.Int)
parms(14).Value = count
parms(15) = New SqlParameter("@nGuestKindId", SqlDbType.Int)
parms(15).Value = guestKindId
parms(16) = New SqlParameter("@nGuestCount", SqlDbType.Int)
parms(16).Value = guestCount
parms(17) = New SqlParameter("@nKidCount", SqlDbType.Int)
parms(17).Value = kidCount
parms(18) = New SqlParameter("@dArrivedTime", SqlDbType.DateTime)
parms(18).Value = ArrivedTime
parms(19) = New SqlParameter("@dLeftTime", SqlDbType.DateTime)
parms(19).Value = LeftTime
parms(20) = New SqlParameter("@cGuestName", SqlDbType.NVarChar, 100)
parms(20).Value = guestName
parms(21) = New SqlParameter("@nSex", SqlDbType.Int)
parms(21).Value = sex
parms(22) = New SqlParameter("@dBirthday", SqlDbType.DateTime)
parms(22).Value = birthday
parms(23) = New SqlParameter("@nCountryId", SqlDbType.Int)
parms(23).Value = countryId
parms(24) = New SqlParameter("@nProvinceId", SqlDbType.Int)
parms(24).Value = provinceId
parms(25) = New SqlParameter("@nCityId", SqlDbType.Int)
parms(25).Value = cityId
parms(26) = New SqlParameter("@nTownId", SqlDbType.Int)
parms(26).Value = townId
parms(27) = New SqlParameter("@nCertificateId", SqlDbType.Int)
parms(27).Value = CertificateId
parms(28) = New SqlParameter("@cCertificateNo", SqlDbType.NVarChar, 100)
parms(28).Value = CertificateNo
parms(29) = New SqlParameter("@cMobile", SqlDbType.NVarChar, 100)
parms(29).Value = mobile
parms(30) = New SqlParameter("@cTelphoneHome", SqlDbType.NVarChar, 100)
parms(30).Value = telphoneHome
parms(31) = New SqlParameter("@cTelphoneCompany", SqlDbType.NVarChar, 100)
parms(31).Value = telphoneCompany
parms(32) = New SqlParameter("@cCompany", SqlDbType.NVarChar, 100)
parms(32).Value = company
parms(33) = New SqlParameter("@cAddressHome", SqlDbType.NVarChar, 100)
parms(33).Value = addressHome
parms(34) = New SqlParameter("@cAddressCompany", SqlDbType.NVarChar, 100)
parms(34).Value = addressCompany
parms(35) = New SqlParameter("@nVirtualGuestId", SqlDbType.Int)
parms(35).Value = VirtualGuestId
parms(36) = New SqlParameter("@nMemberId", SqlDbType.Int)
parms(36).Value = memberId
parms(37) = New SqlParameter("@cBankNo", SqlDbType.NVarChar, 100)
parms(37).Value = bankNo
parms(38) = New SqlParameter("@nJobKindId", SqlDbType.Int)
parms(38).Value = JobKindId
parms(39) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(39).Value = userId
parms(40) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(40).Value = jobTimeListId
parms(41) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(41).Value = computer
parms(42) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(42).Value = remark
parms(43) = New SqlParameter("@bIsToVG", SqlDbType.Bit)
parms(43).Value = isToVG
parms(44) = New SqlParameter("@nServerFee", SqlDbType.Decimal)
parms(44).Value = serverFee
parms(45) = New SqlParameter("@bIsSecret", SqlDbType.Int)
parms(45).Value = IsSecret
parms(46) = New SqlParameter("@cFirstName", SqlDbType.NVarChar, 100)
parms(46).Value = firstName
parms(47) = New SqlParameter("@cLastName", SqlDbType.NVarChar, 100)
parms(47).Value = lastName
parms(48) = New SqlParameter("@dCertiBeginDate", SqlDbType.DateTime)
parms(48).Value = CertiBeginDate
parms(49) = New SqlParameter("@dCertiEndDate", SqlDbType.DateTime)
parms(49).Value = CertiEndDate
parms(50) = New SqlParameter("@nCertiLength", SqlDbType.Int)
parms(50).Value = CertiLength
parms(51) = New SqlParameter("@pHeadPic", SqlDbType.Image)
parms(51).Value = pHeadPic
parms(52) = New SqlParameter("@pCardPic", SqlDbType.Image)
parms(52).Value = pCardPic
parms(53) = New SqlParameter("@nAuthorizationReasonId", SqlDbType.Int)
parms(53).Value = AuthorizationReasonId
Util.ExecProc("", CnnStr.MainCnnStr, "P_GuestWalkInSingle", Nothing, parms)
If parms(0).Value = 1 Then
billId = parms(1).Value
Return True
Else
Return False
End If
End Function
Public Shared Function SplitCnmList(ByVal hotelId As Integer, ByVal CnmListId As Integer, ByVal ParentId As Integer, _
ByVal productId As Integer, ByVal productTypeId As Integer, ByVal Value As Decimal, _
ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal jobTimeListId As Integer, ByVal tag As Integer, ByVal optionTime As DateTime, ByVal oldId As Integer) As Boolean
Dim parms(13) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = CnmListId
parms(2) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(2).Value = hotelId
parms(3) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(3).Value = ParentId
parms(4) = New SqlParameter("@nProductId", SqlDbType.Int)
parms(4).Value = productId
parms(5) = New SqlParameter("@nProductTypeId", SqlDbType.Int)
parms(5).Value = productTypeId
parms(6) = New SqlParameter("@nValue", SqlDbType.Decimal)
parms(6).Value = Value
parms(7) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(7).Value = userId
parms(8) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(8).Value = computer
parms(9) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(9).Value = remark
parms(10) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(10).Value = jobTimeListId
parms(11) = New SqlParameter("@tag", SqlDbType.Int)
parms(11).Value = tag
parms(12) = New SqlParameter("@optionTime", SqlDbType.DateTime)
parms(12).Value = optionTime
parms(13) = New SqlParameter("@OldId", SqlDbType.Int)
parms(13).Value = oldId
Util.ExecProc("", CnnStr.MainCnnStr, "P_UpdateCnmList", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function GatherCnmList(ByVal hotelId As Integer, ByVal CnmListId As Integer, ByVal Value As Decimal, _
ByVal userId As Integer, ByVal computer As String, _
ByVal remark As String, ByVal jobTimeListId As Integer, ByVal tag As Integer) As Boolean
Dim parms(8) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nCnmListId", SqlDbType.Int)
parms(1).Value = CnmListId
parms(2) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(2).Value = hotelId
parms(3) = New SqlParameter("@nValue", SqlDbType.Decimal)
parms(3).Value = Value
parms(4) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(4).Value = userId
parms(5) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 50)
parms(5).Value = computer
parms(6) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(6).Value = remark
parms(7) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(7).Value = jobTimeListId
parms(8) = New SqlParameter("@tag", SqlDbType.Int)
parms(8).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_GatherCnmList", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
#End Region
#Region "Tran Model"
Private _util As Util
Public Sub New()
Me._util = New Util()
End Sub
Public Sub BeginTran(ByVal hotelId As Integer)
Me._util.BeginTran(CnnStr.MainCnnStr)
End Sub
Public Sub CommitTran()
_util.CommitTran()
End Sub
Public Sub RollBackTran()
_util.RollBackTran()
End Sub
Public Function InsertPCashList(ByVal hotelid As Integer, ByRef id As Integer, ByVal ParentId As Integer, ByVal payTypeId As Integer, ByVal payTypeName As String, _
ByVal rate As Decimal, ByVal money As Decimal, ByVal jobTimeListId As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, ByVal tag As Integer, ByVal ImprestId As Integer, ByVal PreBillCode As String, ByVal CshGroupId As Integer) As Boolean
Dim parms(15) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(1).Value = ParentId
parms(2) = New SqlParameter("@nPayTypeId", SqlDbType.Int)
parms(2).Value = payTypeId
parms(3) = New SqlParameter("@cPayTypeName", SqlDbType.NVarChar, 50)
parms(3).Value = payTypeName
parms(4) = New SqlParameter("@nRate", SqlDbType.Decimal)
parms(4).Value = rate
parms(5) = New SqlParameter("@nMoney", SqlDbType.Decimal)
parms(5).Value = money
parms(6) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(6).Value = jobTimeListId
parms(7) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(7).Value = userId
parms(8) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(8).Value = computer
parms(9) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(9).Value = remark
parms(10) = New SqlParameter("@tag", SqlDbType.Int)
parms(10).Value = tag
parms(11) = New SqlParameter("@nId", SqlDbType.Int)
parms(11).Direction = ParameterDirection.Output
parms(12) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(12).Value = hotelid
parms(13) = New SqlParameter("@nImprestId", SqlDbType.Int)
parms(13).Value = ImprestId
parms(14) = New SqlParameter("@cPreBillCode", SqlDbType.NVarChar, 100)
parms(14).Value = PreBillCode
parms(15) = New SqlParameter("@nCshGroupId", SqlDbType.Int)
parms(15).Value = CshGroupId
_util.ExecProcs("", "P_InsertCashList", parms)
If parms(0).Value = 1 Then
id = parms(11).Value
Return True
Else
id = -1
Return False
End If
End Function
Public Function CashingCnmList(ByVal hotelId As Integer, ByVal listId As Integer, ByVal jobTimeListId As Integer, ByVal userId As Integer, ByVal computer As String, ByVal remark As String, ByVal tag As Integer, ByVal CshGroupId As Integer) As Boolean
Dim parms(8) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nListId", SqlDbType.Int)
parms(1).Value = listId
parms(2) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(2).Value = jobTimeListId
parms(3) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(3).Value = userId
parms(4) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(4).Value = computer
parms(5) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(5).Value = remark
parms(6) = New SqlParameter("@tag", SqlDbType.Int)
parms(6).Value = tag
parms(7) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(7).Value = hotelId
parms(8) = New SqlParameter("@nCshGroupId", SqlDbType.Int)
parms(8).Value = CshGroupId
_util.ExecProcs("", "P_CashingCnmList", parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Function InsertCNMCashList(ByVal hotelId As Integer, ByRef id As Integer, ByVal CnmListId As Integer, ByVal CashId As Integer, ByVal PayValue As Decimal, ByVal tag As Integer, ByRef CshGroupId As Integer) As Boolean
Dim parms(7) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Direction = ParameterDirection.Output
parms(2) = New SqlParameter("@nCnmListId", SqlDbType.Int)
parms(2).Value = CnmListId
parms(3) = New SqlParameter("@nCashId", SqlDbType.Int)
parms(3).Value = CashId
parms(4) = New SqlParameter("@nPayValue", SqlDbType.Decimal)
parms(4).Value = PayValue
parms(5) = New SqlParameter("@tag", SqlDbType.Int)
parms(5).Value = tag
parms(6) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(6).Value = hotelId
parms(7) = New SqlParameter("@nCshGroupId", SqlDbType.Int)
parms(7).Direction = ParameterDirection.InputOutput
parms(7).Value = CshGroupId
_util.ExecProcs("", "P_InsertCnmCashList", parms)
If parms(0).Value = 1 Then
id = parms(1).Value
CshGroupId = parms(7).Value
Return True
Else
id = -1
CshGroupId = -1
Return False
End If
End Function
Public Function TransferToFA(ByVal hotelId As Integer, ByVal pctId As Integer, ByVal MemberId As Integer, ByVal CnmListId As Integer, ByVal userId As Integer, ByVal jobTimeListId As Integer, ByRef computer As String, ByVal remark As String, ByVal tag As Integer) As Boolean
Dim parms(9) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(1).Value = hotelId
parms(2) = New SqlParameter("@nCompanyId", SqlDbType.Int)
parms(2).Value = pctId
parms(3) = New SqlParameter("@nMemberId", SqlDbType.Int)
parms(3).Value = MemberId
parms(4) = New SqlParameter("@nCnmListId", SqlDbType.Int)
parms(4).Value = CnmListId
parms(5) = New SqlParameter("@tag", SqlDbType.Int)
parms(5).Value = tag
parms(6) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(6).Value = userId
parms(7) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(7).Value = jobTimeListId
parms(8) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(8).Value = computer
parms(9) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(9).Value = remark
_util.ExecProcs("", "P_Z_TransferToFA", parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
#Region "转应收-Cl"
'消费记录
Public Shared Function InsertFACnmList(ByRef id As Integer, ByVal OldCnmListId As Integer, ByVal FinanceAccountId As Integer, ByVal ProductTypeId As Integer, ByVal ProductId As Integer, ByVal Count As Integer, ByVal Price As Decimal, ByVal JobTimeListId As Integer, ByVal UserId As Integer, ByVal Computer As String, ByVal Remark As String, ByVal HotelId As Integer, ByVal GroupId As Integer, ByVal OutBillCode As String, ByVal tag As Integer) As Boolean
Dim parms(15) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Direction = ParameterDirection.Output
parms(2) = New SqlParameter("@nOldCnmListId", SqlDbType.Int)
parms(2).Value = OldCnmListId
parms(3) = New SqlParameter("@nFinanceAccountId", SqlDbType.Int)
parms(3).Value = FinanceAccountId
parms(4) = New SqlParameter("@nProductTypeId", SqlDbType.Int)
parms(4).Value = ProductTypeId
parms(5) = New SqlParameter("@nProductId", SqlDbType.Int)
parms(5).Value = ProductId
parms(6) = New SqlParameter("@nCount", SqlDbType.Int)
parms(6).Value = Count
parms(7) = New SqlParameter("@nPrice", SqlDbType.Decimal)
parms(7).Value = Price
parms(8) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(8).Value = JobTimeListId
parms(9) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(9).Value = UserId
parms(10) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(10).Value = Computer
parms(11) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(11).Value = Remark
parms(12) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(12).Value = HotelId
parms(13) = New SqlParameter("@nGroupId", SqlDbType.Int)
parms(13).Value = GroupId
parms(14) = New SqlParameter("@cOutBillCode", SqlDbType.NVarChar, 50)
parms(14).Value = OutBillCode
parms(15) = New SqlParameter("@tag", SqlDbType.Int)
parms(15).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_InsertFACnmList", Nothing, parms)
If parms(0).Value = 1 Then
id = parms(1).Value
Return True
Else
id = -1
Return False
End If
End Function
'付款记录
Public Shared Function InsertFACash(ByVal HotelId As Integer, ByRef id As Integer, ByVal CompanyId As Integer, ByVal Rate As Decimal, ByVal Money As Decimal, ByVal JobTimeListId As Integer, ByVal UserId As Integer, ByVal Computer As String, ByVal Remark As String, ByVal tag As Integer) As Boolean
Dim parms(10) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Direction = ParameterDirection.Output
parms(2) = New SqlParameter("@nCompanyId", SqlDbType.Int)
parms(2).Value = CompanyId
parms(3) = New SqlParameter("@nRate", SqlDbType.Decimal)
parms(3).Value = Rate
parms(4) = New SqlParameter("@nMoney", SqlDbType.Decimal)
parms(4).Value = Money
parms(5) = New SqlParameter("@nJobTimeListId", SqlDbType.Int)
parms(5).Value = JobTimeListId
parms(6) = New SqlParameter("@nUserId", SqlDbType.Int)
parms(6).Value = UserId
parms(7) = New SqlParameter("@cComputer", SqlDbType.NVarChar, 100)
parms(7).Value = Computer
parms(8) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(8).Value = Remark
parms(9) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(9).Value = HotelId
parms(10) = New SqlParameter("@tag", SqlDbType.Int)
parms(10).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_InsertFACash", Nothing, parms)
If parms(0).Value = 1 Then
id = parms(1).Value
Return True
Else
id = -1
Return False
End If
End Function
'付款-消费记录
Public Shared Function InsertFACnmCsh(ByVal HotelId As Integer, ByVal id As Integer, ByVal FACnmListId As Integer, ByVal FACashId As Integer, ByVal PayValue As Decimal, ByVal tag As Integer) As Boolean
Dim parms(6) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Direction = ParameterDirection.Output
parms(2) = New SqlParameter("@nFACnmListId", SqlDbType.Int)
parms(2).Value = FACnmListId
parms(3) = New SqlParameter("@nFACashId", SqlDbType.Int)
parms(3).Value = FACashId
parms(4) = New SqlParameter("@nPayValue", SqlDbType.Decimal)
parms(4).Value = PayValue
parms(5) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(5).Value = HotelId
parms(6) = New SqlParameter("@tag", SqlDbType.Int)
parms(6).Value = tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_InsertFACnmCsh", Nothing, parms)
If parms(0).Value = 1 Then
id = parms(1).Value
Return True
Else
id = -1
Return False
End If
End Function
#End Region
#End Region
Public Shared Function QueryBill(ByVal hotelId As Integer, ByVal billStateName As String, ByVal accountTypeName As String, _
ByVal rentKindId As Integer, ByVal pactCompany As String, ByVal teamName As String, ByVal teamCode As String, ByVal reserveCode As String, _
ByVal salesmanId As Integer, ByVal addressHome As String, ByVal guestName As String, ByVal arrivedTimeMin As DateTime, _
ByVal arrivedTimeMax As DateTime, ByVal leftTimeMin As DateTime, ByVal leftTimeMax As DateTime) As DataTable
Dim parms(15) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(1).Value = hotelId
parms(2) = New SqlParameter("@cBillStateName", SqlDbType.NVarChar, 50)
parms(2).Value = Util.CheckParameter(billStateName)
parms(3) = New SqlParameter("@cAccountTypeName", SqlDbType.NVarChar, 50)
parms(3).Value = Util.CheckParameter(accountTypeName)
parms(4) = New SqlParameter("@nRentKindId", SqlDbType.Int)
parms(4).Value = Util.CheckParameter(rentKindId)
parms(5) = New SqlParameter("@cPactCompany", SqlDbType.NVarChar, 200)
parms(5).Value = Util.CheckParameter(pactCompany)
parms(6) = New SqlParameter("@cTeamName", SqlDbType.NVarChar, 50)
parms(6).Value = Util.CheckParameter(teamName)
parms(7) = New SqlParameter("@cTeamCode", SqlDbType.NVarChar, 50)
parms(7).Value = Util.CheckParameter(teamCode)
parms(8) = New SqlParameter("@cReserveCode", SqlDbType.NVarChar, 100)
parms(8).Value = Util.CheckParameter(reserveCode)
parms(9) = New SqlParameter("@nSalesmanId", SqlDbType.Int)
parms(9).Value = Util.CheckParameter(salesmanId)
parms(10) = New SqlParameter("@cAddressHome", SqlDbType.NVarChar, 200)
parms(10).Value = Util.CheckParameter(addressHome)
parms(11) = New SqlParameter("@cGuestName", SqlDbType.NVarChar, 50)
parms(11).Value = Util.CheckParameter(guestName)
parms(12) = New SqlParameter("@dArrivedTimeMin", SqlDbType.DateTime)
parms(12).Value = Util.CheckParameter(arrivedTimeMin)
parms(13) = New SqlParameter("@dArrivedTimeMax", SqlDbType.DateTime)
parms(13).Value = Util.CheckParameter(arrivedTimeMax)
parms(14) = New SqlParameter("@dLeftTimeMin", SqlDbType.DateTime)
parms(14).Value = Util.CheckParameter(leftTimeMin)
parms(15) = New SqlParameter("@dLeftTimeMax", SqlDbType.DateTime)
parms(15).Value = Util.CheckParameter(leftTimeMax)
Return Pub.GetDatatable(CnnStr.MainCnnStr, "P_QueryBill", parms)
End Function
Public Shared Function SetConsumeListState_FACnmList(ByVal hotelId As Integer, ByVal id As Integer, ByVal stateId As Integer) As Boolean
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(1).Value = hotelId
parms(2) = New SqlParameter("@nId", SqlDbType.Int)
parms(2).Value = id
parms(3) = New SqlParameter("@nStateId", SqlDbType.Int)
parms(3).Value = stateId
Util.ExecProc("", CnnStr.MainCnnStr, "P_SetConsumeListState_FACnmList", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function GetFinishedImprestList(ByVal hotelId As Integer, ByVal ParentId As Integer, ByVal tag As Integer) As DataTable()
Dim parms(3) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(1).Value = hotelId
parms(2) = New SqlParameter("@nParentId", SqlDbType.Int)
parms(2).Value = ParentId
parms(3) = New SqlParameter("@tag", SqlDbType.Int)
parms(3).Value = tag
Dim ds As DataSet
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetImprestListByBillAndGuest", ds, parms)
If parms(0).Value = 1 And ds.Tables.Count > 1 Then
Return New DataTable() {ds.Tables(0), ds.Tables(1)}
Else
Return Nothing
End If
End Function
Public Shared Function GetFACashList(ByVal hotelId As Integer) As DataTable
Dim parms(1) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(1).Value = hotelId
Return Pub.GetDatatable(CnnStr.MainCnnStr, "P_GetFACashList", parms)
End Function
Public Shared Function GetTransferConsume(ByVal hotelId As Integer, ByVal HallId As Integer) As DataTable
Return GetTransferConsume(hotelId, HallId, -1, 0)
End Function
Public Shared Function GetTransferConsume(ByVal hotelId As Integer, ByVal HallId As Integer, ByVal targId As Integer, ByVal tag As Integer) As DataTable
Dim parms(4) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(1).Value = hotelId
parms(2) = New SqlParameter("@nHallId", SqlDbType.Int)
parms(2).Value = HallId
parms(3) = New SqlParameter("@nTargId", SqlDbType.Int)
parms(3).Value = targId
parms(4) = New SqlParameter("@tag", SqlDbType.Int)
parms(4).Value = tag
Return Pub.GetDatatable(CnnStr.MainCnnStr, "P_GetConsumeByHall", parms)
End Function
'cl20090903
Public Shared Function DoEditCashRemark(ByVal Id As Integer, ByVal Remark As String, ByVal HotelId As Integer, ByVal Tag As Integer) As Boolean
Dim parms(4) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = Id
parms(2) = New SqlParameter("@cRemark", SqlDbType.NVarChar, 4000)
parms(2).Value = Remark
parms(3) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(3).Value = HotelId
parms(4) = New SqlParameter("@nTag", SqlDbType.Int)
parms(4).Value = Tag
Util.ExecProc("", CnnStr.MainCnnStr, "P_DoEditCashRemark", Nothing, parms)
If parms(0).Value = 1 Then
Return True
Else
Return False
End If
End Function
Public Shared Function GetCashSumOrDetail(ByVal hotelId As Integer, ByVal id As Integer, ByVal tag As Integer, ByVal cursor As Integer) As DataTable
Dim parms(3) As SqlParameter
Dim ds As DataSet
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
parms(1) = New SqlParameter("@nId", SqlDbType.Int)
parms(1).Value = id
parms(2) = New SqlParameter("@tag", SqlDbType.Int)
parms(2).Value = tag
parms(3) = New SqlParameter("@nHotelId", SqlDbType.Int)
parms(3).Value = hotelId
Select Case cursor
Case 1
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetCashDetail_Consume", ds, parms)
Case 2
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetCashDetail_Date", ds, parms)
Case 3
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetCashSum_Consume", ds, parms)
Case 4
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetCashSum_Date", ds, parms)
End Select
If parms(0).Value = 1 AndAlso ds.Tables.Count > 0 Then
Return ds.Tables(0)
Else
Return Nothing
End If
End Function
Public Function GetGlobalId() As Integer
Dim parms(0) As SqlParameter
parms(0) = New SqlParameter("@ret", SqlDbType.Int)
parms(0).Direction = ParameterDirection.Output
Util.ExecProc("", CnnStr.MainCnnStr, "P_GetGlobalId", Nothing, parms)
Return parms(0).Value
End Function
End Class