日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > asp.net >内容正文

asp.net

VB.NET 委托处理 传递参数

發布時間:2025/6/17 asp.net 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 VB.NET 委托处理 传递参数 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
代碼Imports?Wireless.Entities
Imports?Wireless.Printer.RemotingConnection
Imports?Wireless.Common
Imports?Dsdt.CasinoManager.BusinessRule
Imports?HNA.PubClass.DishModel



Namespace?DishInterface

????
Public?Delegate?Sub?PrintBillDeletate(ByVal?IsLaress?As?Boolean,?ByVal?machineNumber?As?String,?ByVal?data?As?List(Of?BillList),?ByVal?currenttable?As?Table,?ByVal?userStatus?As?LoginUserStatus)
????
Public?Class?OrderDishesImpl

????????
Private?Shared?_currentTable?As?Table

????????
Private?Shared?uStatus?As?Wireless.Entities.LoginUserStatus

????????
'種數(本次點菜)
????????Private?Shared?_orderKindCount?As?Decimal
????????
'份數(本次點菜)
????????Private?Shared?_copiesCount?As?Decimal

????????
'''?<summary>
????????
'''?點菜?(入單)
????????
'''?</summary>
????????
'''?<param?name="argOrderDishes"></param>
????????
'''?<returns></returns>
????????
'''?<remarks></remarks>
????????Public?Shared?Function?OrderDishes(ByVal?argOrderDishes?As?Entities.OrderDishes())?As?String

????????????
If?argOrderDishes?Is?Nothing?OrElse?argOrderDishes.Length?<?1?Then
????????????????
Throw?New?Exception("獲取菜單數據異常!")
????????????
End?If

????????????
Dim?message?As?String?=?String.Empty
????????????
Dim?result?As?String?=?String.Format("{0}?{1}{2}",?MobilFormatUtil.FormatString(argOrderDishes(0).TypeCode,?4),?_
??????????????????????????????????????????????????????????MobilFormatUtil.FormatString(argOrderDishes(
0).MachineNumber,?3),?_
?????????????????????????????????????????????????????????vbCrLf)

????????????uStatus?
=?GlobalDataProvider.GetLoginUserStatusByMachineNo(argOrderDishes(0).MachineNumber)
????????????
If?uStatus?Is?Nothing?Then
????????????????
Return?String.Concat(result,?"請先登錄!")
????????????
End?If

????????????
'將手持設備的臺號(nWireTableId)映射為原有的桌號(cCode)
????????????For?i?As?Integer?=?0?To?argOrderDishes.Length?-?1
????????????????argOrderDishes(i).TabelNoBillNo?
=?TableCollection.All.GetCodeByWirlessId(argOrderDishes(i).TabelNoBillNo)
????????????
Next

????????????
If?argOrderDishes(0).TabelNoBillNo?Is?Nothing?Then
????????????????
Return?String.Concat(result,?"臺不存在!")
????????????
End?If


????????????
'取得臺對象
????????????_currentTable?=?TableCollection.All.GetTableByCode(argOrderDishes(0).TabelNoBillNo.Trim)
????????????_currentTable?
=?TableCollection.All.GetOneTables(_currentTable.ID)

????????????
If?_currentTable?Is?Nothing?Then
????????????????
Return?String.Concat(result,?"臺不存在!")
????????????
End?If
????????????
'取得當前臺所有開臺?
????????????Dim?_currentOpentTables?As?OpenTableCollection?=?_currentTable.GetOpenTables()

????????????
If?_currentOpentTables?Is?Nothing?OrElse?_currentOpentTables.Count?<?1?Then
????????????????
Return?String.Concat(result,?"當前臺未開!")
????????????
End?If

????????????
'NOTE?:取得當前開臺對象?
????????????Dim?_openTable?As?Dsdt.CasinoManager.BusinessRule.OpenTable?=?_currentOpentTables(0)

????????????
'判斷當前臺的賬單狀態
????????????If?_openTable.CurrentBillState?=?BillState.Printed?Then
????????????????
Return?String.Concat(result,?"本單已預結,請先解凍!")
????????????
Else
????????????????
Try
????????????????????
'執行入單操作
????????????????????'本次點菜種數和份數
????????????????????_orderKindCount?=?0
????????????????????_copiesCount?
=?0

????????????????????
If?ExecInsertBillList(argOrderDishes,?False,?-1)?Then
????????????????????????
'取得累計點菜種類和份數
????????????????????????Dim?billLists?As?BillListCollection?=?_openTable.GetBillLists
????????????????????????
Dim?_totalOrderKindCount?As?Decimal?=?billLists.Count
????????????????????????
Dim?_totalCopiesCount?As?Decimal

????????????????????????
For?Each?item?As?BillList?In?billLists
????????????????????????????_totalCopiesCount?
+=?item.Count
????????????????????????
Next
????????????????????????message?
=?String.Format("點菜成功")
????????????????????????
'message?=?String.Format("點菜成功!"?+?vbCrLf,?_
????????????????????????'????????????????????????"{0}?本次點菜:{1}種/{2}份?累計點菜:{3}種/{4}份",?_
????????????????????????'????????????????????????argOrderDishes(0).TabelNoBillNo,?_
????????????????????????'?????????????????????????_orderKindCount,?_copiesCount,?_
????????????????????????'????????????????????????_totalOrderKindCount,?_totalCopiesCount?_
????????????????????????'????????????????????????)
????????????????????Else
????????????????????????message?
=?"點菜失敗!"
????????????????????
End?If
????????????????
Catch?ex?As?Exception
????????????????????message?
=?"點菜失敗!"
????????????????
End?Try
????????????
End?If

????????????
Return?String.Concat(result,?message)

????????
End?Function

????????
'''?<summary>
????????
'''?執行入單操作
????????
'''?</summary>
????????
'''?<param?name="argOrderDishes"></param>
????????
'''?<param?name="IsLaress"></param>
????????
'''?<param?name="nLargessManId"></param>
????????
'''?<returns></returns>
????????
'''?<remarks></remarks>
????????Private?Shared?Function?ExecInsertBillList(ByVal?argOrderDishes?As?Entities.OrderDishes(),?ByVal?IsLaress?As?Boolean,?ByVal?nLargessManId?As?Integer)?As?Boolean

????????????
Dim?result?As?Boolean
????????????
If?argOrderDishes.Length?>?0?Then
????????????????
'菜單List
????????????????Dim?data?As?New?List(Of?BillList)

????????????????
'將數據封裝到BillList列表中
????????????????For?Each?item?As?Entities.OrderDishes?In?argOrderDishes
????????????????????data.Add(InsertDataToBillList(item,?IsLaress,?nLargessManId))
????????????????????_orderKindCount?
+=?1
????????????????
Next

????????????????
If?data.Count?>?0?Then
????????????????????
'
????????????????????'If?_currentTable.GetOpenTables()(0).InsertBillList(data,?argOrderDishes(0).MachineNumber,?argOrderDishes(0).MachineNumber)?Then
????????????????????If?_currentTable.GetOpenTables()(0).InsertBillList(data,?uStatus.UserId,?argOrderDishes(0).MachineNumber)?Then
????????????????????????
'Print
????????????????????????Dim?printDelegate?As?PrintBillDeletate?=?New?PrintBillDeletate(AddressOf?PrintBill)
????????????????????????printDelegate.BeginInvoke(IsLaress,?argOrderDishes(
0).MachineNumber,?data,?_currentTable,?uStatus,?Nothing,?Nothing)
????????????????????????result?
=?True
????????????????????
Else
????????????????????????result?
=?False
????????????????????
End?If
????????????????
End?If

????????????
End?If

????????????
Return?result

????????
End?Function

????????
Private?Shared?Sub?PrintBill(ByVal?IsLaress?As?Boolean,?ByVal?machineNumber?As?String,?ByVal?data?As?List(Of?BillList),?ByVal?currenttable?As?Table,?ByVal?userStatus?As?LoginUserStatus)
????????????
Try
????????????????PrintBillListDoc(IsLaress,?data,?machineNumber,?currenttable,?userStatus)???
'打印小票
????????????????PrintDoc(data,?machineNumber,?currenttable,?userStatus)?????????????????????'打印總單
????????????Catch?ex?As?Exception
????????????????
'note?打印日志
????????????End?Try
????????
End?Sub

????????
'''?<summary>
????????
'''?將數據追加到BillList中
????????
'''?</summary>
????????
'''?<param?name="orderDish"></param>
????????
'''?<param?name="IsLaress"></param>
????????
'''?<param?name="nLargessManId"></param>
????????
'''?<returns></returns>
????????
'''?<remarks></remarks>
????????Private?Shared?Function?InsertDataToBillList(ByVal?orderDish?As?Entities.OrderDishes,?ByVal?IsLaress?As?Boolean,?ByVal?nLargessManId?As?Integer)?As?BillList
????????????
'菜品?套餐號為空則是菜品否則為套餐
????????????If?String.IsNullOrEmpty(orderDish.ComboNumber.Trim)?Then
????????????????
Return?InsertDishToList(orderDish,?IsLaress,?nLargessManId)

????????????
End?If
????????????
'套餐
????????????Return?InsertSuitToList(orderDish,?IsLaress,?nLargessManId)

????????
End?Function


????????
'''?<summary>
????????
'''?將套餐子類數據追加到BillList對象中
????????
'''?</summary>
????????
'''?<param?name="suitMenu"></param>
????????
'''?<param?name="cookState"></param>
????????
'''?<param?name="IsLaress"></param>
????????
'''?<param?name="nLargessManId"></param>
????????
'''?<returns></returns>
????????
'''?<remarks></remarks>
????????Private?Shared?Function?InsertSuitMenuToList(ByVal?suitMenu?As?SuitMenu,?_
?????????????????????????????????????????????????????
ByVal?cookState?As?String,?_
?????????????????????????????????????????????????????
ByVal?IsLaress?As?Boolean,?_
?????????????????????????????????????????????????????
ByVal?nLargessManId?As?Integer)

????????????
If?suitMenu?Is?Nothing?Then
????????????????
Return?Nothing
????????????
End?If
????????????
'消費菜式狀態
????????????Dim?curCookState?As?String?=?cookState.Trim
????????????
Dim?curCookStateName?As?String?=?String.Empty
????????????
Dim?ckState?As?EnumCookState
????????????
If?Not?String.IsNullOrEmpty(curCookState)?Then
????????????????ckState?
=?curCookState
????????????????curCookStateName?
=?BusinessUtil.GetCookStateName(ckState)
????????????
End?If

????????????
'名稱
????????????Dim?name?As?String?=?suitMenu.Name
????????????
'數量
????????????Dim?count?As?Decimal?=?suitMenu.Count
????????????
'價格
????????????Dim?price?As?Decimal?=?suitMenu.Price
????????????
'備注
????????????Dim?remark?As?String?=?String.Empty
????????????
'單價
????????????Dim?UnitId?As?Integer?=?suitMenu.UnitId
????????????
Dim?UnitName?As?String?=?suitMenu.UnitName
????????????
'廚房
????????????Dim?CookRoomId?As?Integer?=?suitMenu.CookRoomId
????????????
'帳單明細狀態
????????????Dim?listState?As?BillListState?=?IIf(IsLaress,?BillListState.Largess,?BillListState.Natural)
????????????
'是否收服務費
????????????Dim?IsServerFee?=?False
????????????
Dim?IsAgio?=?False
????????????
'M:菜品
????????????Dim?Id?As?Integer?=?suitMenu.ID
????????????
Dim?IdSource?As?String?=?"SM"

????????????
Dim?result?As?BillList?=?New?BillList(Id,?name,?listState,?ckState,?curCookStateName,?CookRoomId,?count,?price,?remark,?_
????????????????????????????????????????????????????????????IdSource,?UnitId,?UnitName,?nLargessManId,?IsServerFee,?IsAgio)

????????????
Return?result
????????
End?Function

????????
'''?<summary>
????????
'''?將套餐數據追加到BillList對象中
????????
'''?</summary>
????????
'''?<returns></returns>
????????
'''?<remarks></remarks>
????????Private?Shared?Function?InsertSuitToList(ByVal?orderDish?As?Entities.OrderDishes,?ByVal?IsLaress?As?Boolean,?ByVal?nLargessManId?As?Integer)
????????????
'消費菜式狀態
????????????Dim?curCookState?As?String?=?orderDish.WaitState.Trim
????????????
Dim?curCookStateName?As?String?=?String.Empty
????????????
Dim?ckState?As?EnumCookState
????????????
If?Not?String.IsNullOrEmpty(curCookState)?Then
????????????????ckState?
=?curCookState
????????????????curCookStateName?
=?BusinessUtil.GetCookStateName(ckState)
????????????
End?If

????????????
'NOTE?根據CODE取得套餐對象
????????????Dim?suit?As?Suit?=?GlobalDataProvider.Menus.GetSuitByCode(orderDish.ComboNumber.Trim)
????????????
If?suit?Is?Nothing?Then
????????????????
Return?Nothing
????????????
End?If
????????????
'名稱
????????????Dim?name?As?String?=?suit.Name
????????????
'數量
????????????Dim?count?As?Decimal?=?orderDish.Count
????????????
'價格
????????????Dim?price?As?Decimal?=?suit.Price
????????????
'備注
????????????Dim?remark?As?String?=?String.Empty
????????????
'單價
????????????Dim?UnitId?As?Integer?=?suit.UnitId
????????????
Dim?UnitName?As?String?=?suit.UnitName
????????????
'廚房
????????????Dim?CookRoomId?As?Integer?=?suit.CookRoomId
????????????
'帳單明細狀態
????????????Dim?listState?As?BillListState?=?IIf(IsLaress,?BillListState.Largess,?BillListState.Natural)
????????????
'是否收服務費
????????????Dim?IsServerFee?=?suit.IsServerFee
????????????
Dim?IsAgio?=?suit.IsAgio
????????????
'S:套餐
????????????Dim?Id?As?Integer?=?suit.ID
????????????
Dim?IdSource?As?String?=?"S"

????????????
Dim?result?As?BillList?=?New?BillList(Id,?name,?listState,?ckState,?curCookStateName,?CookRoomId,?count,?price,?remark,?_
????????????????????????????????????????????????????????????IdSource,?UnitId,?UnitName,?nLargessManId,?IsServerFee,?IsAgio)

????????????
'取得套餐子類
????????????Dim?lstSuitMenu?As?List(Of?SuitMenu)?=?GlobalDataProvider.Menus.GetMenusFromSuit(orderDish.ComboNumber.Trim)
????????????
If?Not?lstSuitMenu?Is?Nothing?AndAlso?lstSuitMenu.Count?>?0?Then
????????????????
For?Each?item?As?SuitMenu?In?lstSuitMenu
????????????????????result.Items.Add(InsertSuitMenuToList(item,?orderDish.WaitState.Trim,?IsLaress,?nLargessManId))
????????????????
Next
????????????
End?If

????????????
Return?result
????????
End?Function

????????
'''?<summary>
????????
'''?將菜品數據追加到BillList對象中
????????
'''?</summary>
????????
'''?<param?name="orderDish"></param>
????????
'''?<param?name="IsLaress"></param>
????????
'''?<param?name="nLargessManId"></param>
????????
'''?<returns></returns>
????????
'''?<remarks></remarks>
????????Private?Shared?Function?InsertDishToList(ByVal?orderDish?As?Entities.OrderDishes,?_
?????????????????????????????????????????????????
ByVal?IsLaress?As?Boolean,?_
?????????????????????????????????????????????????
ByVal?nLargessManId?As?Integer)?As?BillList

????????????
'消費菜式狀態
????????????Dim?curCookState?As?String?=?orderDish.WaitState.Trim
????????????
Dim?curCookStateName?As?String?=?String.Empty
????????????
Dim?ckState?As?EnumCookState
????????????
'If?Not?String.IsNullOrEmpty(curCookState)?Then
????????????'????ckState?=?curCookState
????????????'????curCookStateName?=?BusinessUtil.GetCookStateName(ckState)
????????????'End?If
????????????'NOTE?手持機無法輸入消費菜式狀態?默認為"即起"
????????????ckState?=?EnumCookState.Checked
????????????curCookStateName?
=?BusinessUtil.GetCookStateName(ckState)

????????????
'Note?NULL?取得菜對象
????????????Dim?menu?As?Menu?=?GlobalDataProvider.Menus.GetMenuByCode(orderDish.MenuId.Trim)
????????????
'菜名
????????????Dim?name?As?String?=?menu.Name
????????????
'數量
????????????Dim?count?As?Decimal?=?orderDish.Count
????????????
'總份數統計
????????????_copiesCount?+=?count
????????????
'價格
????????????Dim?price?As?Decimal?=?menu.Price
????????????
'備注
????????????Dim?remark?As?String?=?menu.Remark
????????????
'單價
????????????Dim?UnitId?As?Integer?=?menu.UnitId
????????????
Dim?UnitName?As?String?=?menu.UnitName
????????????
'廚房
????????????Dim?CookRoomId?As?Integer?=?menu.CookroomId
????????????
'帳單明細狀態
????????????Dim?listState?As?BillListState?=?IIf(IsLaress,?BillListState.Largess,?BillListState.Natural)
????????????
'是否收服務費
????????????Dim?IsServerFee?=?menu.IsServerFee
????????????
Dim?IsAgio?=?menu.IsAgio
????????????
'M:菜品
????????????Dim?Id?As?Integer?=?menu.ID
????????????
Dim?IdSource?As?String?=?"M"

????????????
Dim?dish?As?BillList?=?New?BillList(Id,?name,?listState,?ckState,?curCookStateName,?CookRoomId,?count,?price,?remark,?_
????????????????????????????????????????????????????????????IdSource,?UnitId,?UnitName,?nLargessManId,?IsServerFee,?IsAgio)
????????????
'如果有做法,則追加做法對象
????????????If?Not?String.IsNullOrEmpty(orderDish.MakeWay.Trim)?Then

????????????????
'制作方法中的任何一位不是數字,則認為輸入的是內容而不是制作法的編號。
????????????????If?IsNumeric(orderDish.MakeWay.Trim)?Then
????????????????????
'?Feihu?Huang?2009/12/29
????????????????????'去做法的時候,3位取法優先,如果不是3位不是做法,則跳1位,取下三位,取到為止
????????????????????Dim?s?As?String
????????????????????s?
=?orderDish.MakeWay.Trim
????????????????????
Dim?threeBytes?As?String
????????????????????
Dim?i?As?Integer
????????????????????
Try
????????????????????????
For?i?=?0?To?s.Length?-?2
????????????????????????????threeBytes?
=?s.Substring(i,?3)
????????????????????????????
If?Wireless.Common.MenusClass.IsAFunction(threeBytes)?=?True?Then
????????????????????????????????System.Console.WriteLine(threeBytes)
????????????????????????????????
'????'根據CODE取得菜品做法對象
????????????????????????????????'orderDish.WaitState.Trim,?_
????????????????????????????????Dim?makeWayItem?As?BillList?=?SetDataToMakeWay(threeBytes,?_
????????????????????????????????
"1",?_
???????????????????????????????????????????????????????????????????IsLaress,?_
???????????????????????????????????????????????????????????????????nLargessManId)
????????????????????????????????
If?Not?makeWayItem?Is?Nothing?Then
????????????????????????????????????dish.Items.Add(makeWayItem)
????????????????????????????????????dish.MenuRemark?
+=?makeWayItem.MenuName?+?","
????????????????????????????????
End?If
????????????????????????????????i?
=?i?+?2
????????????????????????????
End?If

????????????????????????
Next
????????????????????????
If?Not?dish.MenuRemark?Is?Nothing?AndAlso?dish.MenuRemark.Length?>?0?Then
????????????????????????????dish.MenuRemark?
=?dish.MenuRemark.Substring(0,?dish.MenuRemark.Length?-?1)
????????????????????????
End?If

????????????????????
Catch?ex?As?Exception

????????????????????
End?Try
????????????????????
''每3位為一做法的Code
????????????????????'Dim?functionCodes()?As?String?=?MobilFormatUtil.SplitStringByLenth(orderDish.MakeWay.Trim,?3)
????????????????????'For?Each?code?As?String?In?functionCodes
????????????????????'????'根據CODE取得菜品做法對象
????????????????????'????Dim?makeWayItem?As?BillList?=?SetDataToMakeWay(code,?_
????????????????????'???????????????????????????????????????????????????orderDish.WaitState.Trim,?_
????????????????????'???????????????????????????????????????????????????IsLaress,?_
????????????????????'???????????????????????????????????????????????????nLargessManId)
????????????????????'????If?Not?makeWayItem?Is?Nothing?Then
????????????????????'????????dish.Items.Add(makeWayItem)
????????????????????'????End?If
????????????????????'Next

????????????????
End?If

????????????
End?If

????????????
Return?dish

????????
End?Function


????????
'''?<summary>
????????
'''?將做法數據追加到BillList對象中
????????
'''?</summary>
????????
'''?<param?name="makeWayCode"></param>
????????
'''?<param?name="waitState"></param>
????????
'''?<param?name="IsLaress"></param>
????????
'''?<param?name="nLargessManId"></param>
????????
'''?<returns></returns>
????????
'''?<remarks></remarks>
????????Private?Shared?Function?SetDataToMakeWay(ByVal?makeWayCode?As?String,?_
?????????????????????????????????????????????????
ByVal?waitState?As?String,?_
?????????????????????????????????????????????????
ByVal?IsLaress?As?Boolean,?_
?????????????????????????????????????????????????
ByVal?nLargessManId?As?Integer)?As?BillList

????????????
'消費菜式狀態
????????????Dim?curCookState?As?String?=?waitState
????????????
Dim?curCookStateName?As?String?=?String.Empty
????????????
Dim?ckState?As?EnumCookState
????????????
If?Not?String.IsNullOrEmpty(curCookState)?Then
????????????????ckState?
=?curCookState
????????????????curCookStateName?
=?BusinessUtil.GetCookStateName(ckState)
????????????
End?If

????????????
'NOTE?根據CODE取得菜品做法對象
????????????Dim?makeWay?As?MenuFunction?=?GlobalDataProvider.Menus.GetFunctionById(makeWayCode)
????????????
If?makeWay?Is?Nothing?Then
????????????????
Return?Nothing
????????????
End?If
????????????
'名稱
????????????Dim?name?As?String?=?makeWay.Name
????????????
'數量
????????????Dim?count?As?Decimal?=?1
????????????
'價格
????????????Dim?price?As?Decimal?=?makeWay.Price
????????????
'備注
????????????Dim?remark?As?String?=?String.Empty
????????????
'單價
????????????Dim?UnitId?As?Integer?=?makeWay.UnitId
????????????
Dim?UnitName?As?String?=?makeWay.UnitName
????????????
'廚房
????????????Dim?CookRoomId?As?Integer?=?-1
????????????
'帳單明細狀態
????????????Dim?listState?As?BillListState?=?IIf(IsLaress,?BillListState.Largess,?BillListState.Natural)
????????????
'是否收服務費
????????????Dim?IsServerFee?=?makeWay.IsServerFee
????????????
Dim?IsAgio?=?makeWay.IsAgio
????????????
'M:菜品
????????????Dim?Id?As?Integer?=?makeWay.ID
????????????
Dim?IdSource?As?String?=?"F"

????????????
Dim?makeWayItem?As?BillList?=?New?BillList(Id,?name,?listState,?ckState,?curCookStateName,?CookRoomId,?count,?price,?remark,?_
????????????????????????????????????????????????????????????IdSource,?UnitId,?UnitName,?nLargessManId,?IsServerFee,?IsAgio)

????????????
Return?makeWayItem
????????
End?Function


#Region?"打印小票"
????????
Private?Shared?Sub?PrintBillListDoc(ByVal?IsLaress?As?Boolean,?ByVal?data?As?List(Of?BillList),?ByVal?machineCode?As?String,?ByVal?currenttable?As?Table,?ByVal?userStatus?As?LoginUserStatus)
????????????
'TODO?手持設備的用戶名
????????????'Dim?currentUserName?As?String?=?machineCode
????????????Dim?currentUserName?As?String?=?userStatus.UserName

????????????
Dim?BLCol?As?New?BillListCollection
????????????
For?Each?l?As?BillList?In?data
????????????????
If?l.IsPrintB()?Then
????????????????????BLCol.Add(l)
????????????????
End?If
????????????
Next
????????????
If?BLCol.Count?>?0?Then
????????????????
For?Each?BL?As?BillList?In?BLCol
????????????????????
If?IsPrintPassPrintCenter?Then
????????????????????????
Dim?L?As?New?SystemLicenseRule(True)
????????????????????????
Dim?P?As?New?RemotingConnection
????????????????????????
Dim?C?As?CookRoom?=?CType(CookRoomCollection.GetOneCookRooms(BL.CookRoomId)(0),?CookRoom)
????????????????????????
Dim?BillListDoc?As?New?PrintBillListRpt(IIf(IsLaress,?"贈送",?BL.CurrentCookStateName),?currenttable.Name,?_
????????????????????????????????????????????????????currentUserName,?Now.ToString,?BL.MenuName,?BL.Count,?BL.UnitName,?BL.Price,?_
????????????????????????????????????????????????????BL.Count?
*?BL.Price,?BL.MenuRemark,?C.PrintAreaCode,?_
????????????????????????????????????????????????????L.CurLicense.name,?currenttable.DepartmentName,?currenttable.HallName,?_
????????????????????????????????????????????????????currenttable.ServerFee,?
0,?0,?0,?0,?0)
????????????????????????P.LoadBillListPiaoRpt(BillListDoc)
????????????????????
Else

????????????????????
End?If

????????????????
Next

????????????????
'Dim?doc?As?New?Doc_TolBill(cols,?Me._checkedTbl.Name,?AppConfig.CurrentUser.cName,?IIf(cols(0).ListState?=?BillListState.Natural,?"總單",?"贈送"))
????????????????'doc.PrintController?=?New?System.Drawing.Printing.StandardPrintController()
????????????????'doc.PrintDoc()
????????????End?If

????????
End?Sub

????????
'''?<summary>
????????
'''?是否用打印中心來打印賬單
????????
'''?</summary>
????????
'''?<remarks></remarks>
????????Public?Shared?ReadOnly?Property?IsPrintPassPrintCenter()?As?Boolean
????????????
Get
????????????????
Dim?p?As?New?SystemParamsRule(True)
????????????????
Return?p.IsPrintPassPrintCenter
????????????
End?Get
????????????
''Get
????????????''????Return?_IsPrintPassPrintCenter
????????????''End?Get
????????????''Set(ByVal?value?As?Boolean)
????????????''????Dim?p?As?New?SystemParamsRule(True)
????????????''????_IsPrintPassPrintCenter?=?p.IsPrintPassPrintCenter
????????????''End?Set
????????End?Property

#End?Region

#Region?"打印總單"

????????
Private?Shared?Sub?PrintDoc(ByVal?data?As?List(Of?BillList),?ByVal?machineCode?As?String,?ByVal?currenttable?As?Table,?ByVal?userStatus?As?LoginUserStatus)

????????????
Dim?Plsts?As?New?BillListCollection
????????????
For?Each?l?As?BillList?In?data
????????????????
If?l.IsPrintA()?Then
????????????????????Plsts.Add(l)
????????????????
End?If
????????????
Next
????????????
If?Plsts.Count?>?0?Then
????????????????
Dim?L?As?New?SystemLicenseRule(True)
????????????????
''If?AppConfig.IsPrintPassPrintCenter?Then
????????????????''????''用C1REPORT來打印
????????????????''????Dim?BLdata?As?PrintBillListData?=?New?PrintBillListData("zongdan")
????????????????''????For?Each?BL?As?BillList?In?Plsts
????????????????''????????BLdata.AddOneRow(BL)
????????????????''????Next
????????????????''????Dim?P?As?New?RemotingConnection
????????????????''????'Dim?C?As?CookRoom?=?CType(CookRoomCollection.GetOneCookRooms(lst.CookRoomId)(0),?CookRoom)
????????????????''????Dim?pbr?As?New?PrintBillListRpt("總單",?Me._checkedTbl.Name,?AppConfig.CurrentUser.cName,?_
????????????????''????????????????????????????????Now.ToString,?"",?0,?"",?0,?_
????????????????''????????????????????????????????0,?"",?_PrintArea,?_
????????????????''????????????????????????????????L.CurLicense.name,?_checkedTbl.DepartmentName,?_checkedTbl.HallName,?_
????????????????''????????????????????????????????Me._checkedTbl.ServerFee,?Plsts.TolServerFeeMoney(Me._checkedTbl.ServerFee),?0,?0,?Plsts.TolNaturalMoney,?Plsts.TolLargessMoney)?'C.PrintAreaCode)
????????????????''????P.LoadBillListZongRpt(BLdata._BillListData,?pbr)
????????????????''????''用C1REPORT來打印
????????????????''Else
????????????????''用畫的PrintDocument來打印()
????????????????Dim?msg?As?New?CashBillMsg
????????????????msg.title?
=?IIf(Plsts(0).ListState?=?BillListState.Natural,?"總單",?"贈送")
????????????????msg.HotelName?
=?L.CurLicense.name
????????????????msg.DprtName?
=?currenttable.DepartmentName
????????????????msg.HallName?
=?currenttable.HallName
????????????????msg.TableCode?
=?currenttable.Code
????????????????msg.TableName?
=?currenttable.Name
????????????????msg.PrintCount?
=?0
????????????????msg.BillCode?
=?""
????????????????
'TODO?手持設備的用戶名
????????????????msg.UserCode?=?userStatus.UserCode
????????????????msg.UserName?
=?userStatus.UserName
????????????????msg.GuestCount?
=?currenttable.GetOpenTables(0).GuestCount
????????????????msg.MenuInTime?
=?Now
????????????????msg.ServerFeeRate?
=?currenttable.ServerFee
????????????????msg.ServerFee?
=?Plsts.TolServerFeeMoney(currenttable.ServerFee)
????????????????msg.AgioRate?
=?0
????????????????msg.Agio?
=?0
????????????????msg.MenuMoney?
=?Plsts.TolAllMoney
????????????????msg.TolMoney?
=?Plsts.TolAllMoney?+?Plsts.TolServerFeeMoney(currenttable.ServerFee)

????????????????
'Dim?doc?As?New?Doc_TolBill(cols,?Me._checkedTbl.Name,?AppConfig.CurrentUser.cName,?IIf(cols(0).ListState?=?BillListState.Natural,?"總單",?"贈送"))
????????????????Dim?doc?As?New?Doc_TolBill(Plsts,?msg)
????????????????doc.PrintController?
=?New?System.Drawing.Printing.StandardPrintController()
????????????????doc.PrintDoc()
????????????????
''用畫的PrintDocument來打印
????????????????''End?If

????????????
End?If
????????
End?Sub

#End?Region

????
End?Class
End?Namespace

?

轉載于:https://www.cnblogs.com/callbin/archive/2010/01/03/1638104.html

總結

以上是生活随笔為你收集整理的VB.NET 委托处理 传递参数的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。