public void T() { var ecr = new Dp25("COM1"); ecr.FeedPaper(10); ecr.Dispose(); }
public SaleCommandsViewModel(Dp25 ecr, IMessageAggregator messenger) { _ecr = ecr; _messenger = messenger; Items = new BindableCollection<SaleItem>(); Items.CollectionChanged += (sender, args) => NotifyOfPropertyChange(() => CanExecuteCommands); }
protected override void Configure() { _container = new CompositionContainer(new AggregateCatalog(AssemblySource .Instance .Select(x => new AssemblyCatalog(x)) .OfType <ComposablePartCatalog>() ) ); var batch = new CompositionBatch(); _portName = SerialPort.GetPortNames()[0]; _ecr = new Dp25(_portName); var messenger = new MessageAggregator(); messenger.GetStream <SelectedPortChangedEvent>() .Subscribe(e => _ecr.ChangePort(e.PortName)); batch.AddExportedValue <IWindowManager>(new WindowManager()); batch.AddExportedValue <IMessageAggregator>(messenger); batch.AddExportedValue <Dp25>(_ecr); batch.AddExportedValue(_container); _container.Compose(batch); }
public SaleCommandsViewModel(Dp25 ecr, IMessageAggregator messenger) { _ecr = ecr; _messenger = messenger; Items = new BindableCollection <SaleItem>(); Items.CollectionChanged += (sender, args) => NotifyOfPropertyChange(() => CanExecuteCommands); }
protected override void Configure() { _container = new CompositionContainer(new AggregateCatalog(AssemblySource .Instance .Select(x => new AssemblyCatalog(x)) .OfType<ComposablePartCatalog>() ) ); var batch = new CompositionBatch(); _portName = SerialPort.GetPortNames()[0]; _ecr = new Dp25(_portName); var messenger = new MessageAggregator(); messenger.GetStream<SelectedPortChangedEvent>() .Subscribe(e => _ecr.ChangePort(e.PortName)); batch.AddExportedValue<IWindowManager>(new WindowManager()); batch.AddExportedValue<IMessageAggregator>(messenger); batch.AddExportedValue<Dp25>(_ecr); batch.AddExportedValue(_container); _container.Compose(batch); }
public void T() { var ecr = new Dp25("COM3"); ecr.OpenFiscalReceipt("1", "1"); // ecr.RegisterProgrammedItemSale); ecr.Total(); ecr.CloseFiscalReceipt(); ecr.Dispose(); }
public GeneralCommandsViewModel(Dp25 ecr, IMessageAggregator messenger) { _ecr = ecr; _messenger = messenger; Frequency = 1000; Interval = 1; FeedPaperLines = 5; CashAmount = 100.00M; ImpulseLength = 50; }
protected override void Configure() { _container = new CompositionContainer(new AggregateCatalog(AssemblySource .Instance .Select(x => new AssemblyCatalog(x)) .OfType <ComposablePartCatalog>() ) ); var batch = new CompositionBatch(); var portNames = SerialPort.GetPortNames(); _portName = portNames.Length > 0 ? portNames[0] : string.Empty; try { _ecr = new Dp25(_portName); } catch (Exception ex) { } var messenger = new MessageAggregator(); messenger.GetStream <SelectedPortChangedEvent>() .Subscribe(e => { MessageBox.Show( "ChangePort method removed from API, try to set the portname manually in code AppBootstrapper.cs:line 43"); }); batch.AddExportedValue <IWindowManager>(new WindowManager()); batch.AddExportedValue <IMessageAggregator>(messenger); batch.AddExportedValue <Dp25>(_ecr); batch.AddExportedValue(_container); _container.Compose(batch); }
private void pictureBox2_Click_1(object sender, EventArgs e) { try { if (MessageBox.Show("ნამდვილად გსურთ Z რეპორტის დაბეჭდვა?", "Z რეპორტი", MessageBoxButtons.YesNo) == DialogResult.Yes) { if (Ecr.PrintReport(ReportType.Z).CommandPassed) MessageBox.Show("რეპორტი დაიბეჭდა."); else MessageBox.Show("შეცდომა: რეპორტი არ დაიბეჭდა."); } } catch (Exception ex) { _ecr = null; throw; } }
private void pictureBox2_Click(object sender, EventArgs e) { try { var data = (SortableBindingList<DailyPayment>)gridData.DataSource; var items = new List<ReadNextItemResponse>(); var firsIitem = Ecr.ExecuteCustomCommand<ReadItemsResponse>(new ReadItemsCommand(1)); ReadNextItemResponse response = null; if (firsIitem.CommandPassed) { do { response = Ecr.ExecuteCustomCommand<ReadNextItemResponse>(new ReadNextItemCommand()); items.Add(response); } while (response.CommandPassed); data.FirstOrDefault(x => x.LoanID == int.Parse(firsIitem.Name.Substring(0, firsIitem.Name.IndexOf("/")))).Payment = firsIitem.Turnover; foreach (var pay in items) { if (pay.CommandPassed) { data.FirstOrDefault(x => x.LoanID == int.Parse(pay.Name.Substring(0, pay.Name.IndexOf("/")))).Payment = pay.Turnover; } } } MessageBox.Show(string.Format("განახლდა {0} გადახდა. გთხოვთ ატვირთოთ. \nჯამი: {1}", items.Count, items.Sum(x => x.Turnover) + firsIitem.Turnover)); } catch (Exception ex) { _ecr = null; throw; } }
private void pictureBox1_Click_1(object sender, EventArgs e) { try { var data = (SortableBindingList<DailyPayment>)gridData.DataSource; if (MessageBox.Show("ნამდვილად გსურთ ჩაწერა?", "საქონლის ჩაწერა", MessageBoxButtons.YesNo) == DialogResult.Yes) { if (MessageBox.Show("ამოიბეჭდოს Z ანგარიში?", "განულება", MessageBoxButtons.YesNo) == DialogResult.Yes) { Ecr.PrintReport(ReportType.Z); } Ecr.DeleteItems(1, 10000); var list = new SortableBindingList<object>(); for (int i = 1; i <= data.Count; i++) list.Add(Ecr.ProgramItem(data[i - 1].LoanID + "/" + data[i - 1].PersonalID + " " + data[i - 1].LastName, i, KasaGE.Commands.TaxGr.A, 1, 1, 1)); TaxOrderGenerator.ExportToExcel(list, typeof(ProgramItemResponse)); var success = list.All(x => ((ProgramItemResponse)x).CommandPassed); if (success) MessageBox.Show("ჩაიწერა წარმატებით."); else MessageBox.Show("მოხდა შეცდომა, გადახედე გახსნილ ექსელის ფაილს."); } } catch (Exception ex) { _ecr = null; throw; } }
public ReportCommandsViewModel(Dp25 ecr, IMessageAggregator messenger) { _ecr = ecr; _messenger = messenger; }