/// <summary> /// 点击ActionButton /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmAssets_ActionButtonPress(object sender, ActionButtonPressEventArgs e) { try { switch (e.Index) { case 0: //资产调拨 //调拨 frmAssTransferRows frmT = new frmAssTransferRows(); this.Form.Show(frmT); break; case 1: //资产打印 try { if (string.IsNullOrEmpty(SelectAssId)) { throw new Exception("请先选择资产."); } AssetsOutputDto outputDto = _autofacConfig.SettingService.GetAssetsByID(SelectAssId); PosPrinterEntityCollection Commands = new PosPrinterEntityCollection(); Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.Initial)); Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.EnabledBarcode)); Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.AbsoluteLocation)); Commands.Add(new PosPrinterBarcodeEntity(PosBarcodeType.CODE128Height, "62")); Commands.Add(new PosPrinterBarcodeEntity(PosBarcodeType.CODE128, outputDto.SN)); //Commands.Add(new PosPrinterBarcodeEntity(PosBarcodeType.CODE128, "E2000017320082231027BD")); Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.DisabledBarcode)); Commands.Add(new PosPrinterContentEntity(System.Environment.NewLine)); Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.Cut)); posPrinter1.Print(Commands, (obj, args) => { if (args.isError == true) { this.Toast("Error: " + args.error); } else { this.Toast("打印成功"); } }); } catch (Exception ex) { Toast(ex.Message); } break; } } catch (Exception ex) { Toast(ex.Message); } }
private void iconMenu_ItemPress(object sender, IconMenuViewItemPressEventArgs e) { switch (e.Item.Value) { //资产 case "Assets": frmAssets frmAssets = new frmAssets(); if (btnWareHouse.Tag != null) { frmAssets.wareId = btnWareHouse.Tag.ToString(); } this.Form.Show(frmAssets); break; case "AssTemplate": frmAssTemplate frmAssTemplate = new frmAssTemplate(); this.Form.Show(frmAssTemplate); break; case "AssIn": frmAssIn frmAssIn = new frmAssIn(); this.Form.Show(frmAssIn); break; case "AssOut": frmAssOut frmAssOut = new frmAssOut(); this.Form.Show(frmAssOut); break; case "AssTransfer": frmAssTransferRows frmAssTransferRows = new frmAssTransferRows(); this.Form.Show(frmAssTransferRows); break; case "AssInventory": frmAssInventory frmAssInventory = new frmAssInventory(); this.Form.Show(frmAssInventory); break; //耗材 case "ConManage": frmConsumables frmConsumables = new frmConsumables(); this.Form.Show(frmConsumables); break; case "ConIn": frmConPORInSto frmConPORInSto = new frmConPORInSto(); this.Form.Show(frmConPORInSto); break; case "ConOut": frmConSOROutbound frmConSOROutbound = new frmConSOROutbound(); this.Form.Show(frmConSOROutbound); break; case "ConTransfer": frmTransferRows frmTransferRows = new frmTransferRows(); this.Form.Show(frmTransferRows); break; case "ConInventory": frmConInventory frmConInventory = new frmConInventory(); this.Form.Show(frmConInventory); break; } }