private void onLoadData() { decimal tempBalance; WsdlRepository.GetOperatorShiftCheckpoints(StationRepository.LocationID, Int16.Parse(StationRepository.GetUid(ChangeTracker.CurrentUser).account_id), out tempBalance); Balance = tempBalance; OnPropertyChanged("Balance"); osd = WsdlRepository.GetOperatorShiftReport(StationRepository.LocationID, Int16.Parse(StationRepository.GetUid(ChangeTracker.CurrentUser).account_id)); OnPropertyChanged("osd"); }
private void CurrentShiftReport() { try { osd = WsdlRepository.GetOperatorShiftReport(StationRepository.LocationID, Int16.Parse(StationRepository.GetUid(ChangeTracker.CurrentUser).account_id)); OnPropertyChanged("osd"); } catch (Exception ex) { } }
private void onLoadData() { try { decimal tempBalance; WsdlRepository.GetOperatorShiftCheckpoints(StationRepository.LocationID, Int16.Parse(StationRepository.GetUid(ChangeTracker.CurrentUser).account_id), out tempBalance, false); //Balance = tempBalance; osd = WsdlRepository.GetOperatorShiftReport(StationRepository.LocationID, Int16.Parse(StationRepository.GetUid(ChangeTracker.CurrentUser).account_id)); Balance = osd.balance; OnPropertyChanged("osd"); } catch (FaultException <HubServiceException> e) { Log.Error(e.Message, e); } }
private void CreateCheckpoint() { OperatorShiftCheckpoint checkpoint = new OperatorShiftCheckpoint(); DateTime stDate; DateTime enDate; int ebTN; int pTN; decimal ebTA; decimal pTA; decimal tempBalance; string operatorName; if (CheckForEmptyBox()) { ShowError(TranslationProvider.Translate(MultistringTags.TERMINAL_PLEASE_EMPTY_BOX).ToString(), null, false); return; } try { OperatorShiftData data = WsdlRepository.CreateOperatorShiftCheckpoint(StationRepository.LocationID, Int16.Parse(StationRepository.GetUid(ChangeTracker.CurrentUser).account_id)); stDate = data.startDate; enDate = data.endDate; ebTA = data.emptyBoxTotalAmount; pTA = data.payoutTotalAmount; ebTN = data.emptyBoxTotalNumber; pTN = data.payoutTotalNumber; tempBalance = data.balance; operatorName = data.operatorName; } catch (Exception ex) { if (ex is System.ServiceModel.FaultException <HubServiceException> ) { System.ServiceModel.FaultException <HubServiceException> exep = (System.ServiceModel.FaultException <HubServiceException>)ex; ShowError(TranslationProvider.Translate(MultistringTags.TERMINAL_NO_EMPTY_BOXES).ToString(), null, false); } return; } checkpoint.startDate = stDate; checkpoint.endDate = enDate; checkpoint.emptyBoxTotalAmount = ebTA; checkpoint.emptyBoxTotalNumber = ebTN; checkpoint.payoutTotalAmount = pTA; checkpoint.payoutTotalNumber = pTN; checkpoint.operatorName = operatorName; checkpoint.operatorId = (int)ChangeTracker.CurrentUser.AccountId; ObservableCollection <OperatorShiftCheckpoint> tempCollection = new ObservableCollection <OperatorShiftCheckpoint>(); globalCollection.Insert(0, checkpoint); if ((currentPosition + pageSize) < globalCollection.Count) { for (int i = currentPosition; i < pageSize; i++) { tempCollection.Add(globalCollection[i]); } } else { for (int i = currentPosition; i < globalCollection.Count; i++) { tempCollection.Add(globalCollection[i]); } } SelectedCheckpoint = tempCollection[0]; //recalculate balance //CalculateBalance(); _Checkpoints = new ObservableCollection <OperatorShiftCheckpoint>(tempCollection); EnabledPrintCheckpoint = _Checkpoints.Count > 0 && SelectedCheckpoint != null && SelectedCheckpoint.id != -1000; OnPropertyChanged("Checkpoints"); OnPropertyChanged("EnabledPrintCheckpoint"); Balance = tempBalance; OnPropertyChanged("Balance"); CurrentShiftReport(); //printout bool isPrinted = PrinterHandler.PrintOperatorShiftReport(checkpoint, tempBalance); if (!isPrinted) { ShowPrinterErrorMessage(); } ShowError(TranslationProvider.Translate(MultistringTags.TERMINAL_SHIFT_REPORT_CREATED).ToString() + "\n\n" + SelectedCheckpoint.startDate.ToString() + " - " + SelectedCheckpoint.endDate.ToString(), null, false, 15); }