Example #1
0
 public UserController(IUserService userService, ISessionService sessionService, ITicketService ticketService, IWinnerService winnerService)
 {
     _userService    = userService;
     _sessionService = sessionService;
     _ticketService  = ticketService;
     _winnerService  = winnerService;
 }
        public PaymentEditorViewModel(IApplicationState applicationState,
                                      TicketTotalsViewModel paymentTotals, PaymentEditor paymentEditor, NumberPadViewModel numberPadViewModel,
                                      OrderSelectorViewModel orderSelectorViewModel, ITicketService ticketService,
                                      ForeignCurrencyButtonsViewModel foreignCurrencyButtonsViewModel, PaymentButtonsViewModel paymentButtonsViewModel,
                                      CommandButtonsViewModel commandButtonsViewModel, TenderedValueViewModel tenderedValueViewModel,
                                      ReturningAmountViewModel returningAmountViewModel, ChangeTemplatesViewModel changeTemplatesViewModel, AccountBalances accountBalances)
        {
            _applicationState                = applicationState;
            _paymentTotals                   = paymentTotals;
            _paymentEditor                   = paymentEditor;
            _numberPadViewModel              = numberPadViewModel;
            _orderSelectorViewModel          = orderSelectorViewModel;
            _ticketService                   = ticketService;
            _foreignCurrencyButtonsViewModel = foreignCurrencyButtonsViewModel;
            _commandButtonsViewModel         = commandButtonsViewModel;
            _tenderedValueViewModel          = tenderedValueViewModel;
            _returningAmountViewModel        = returningAmountViewModel;
            _changeTemplatesViewModel        = changeTemplatesViewModel;
            _accountBalances                 = accountBalances;

            _makePaymentCommand             = new CaptionCommand <PaymentType>("", OnMakePayment, CanMakePayment);
            _selectChangePaymentTypeCommand = new CaptionCommand <PaymentData>("", OnSelectChangePaymentType);

            ClosePaymentScreenCommand = new CaptionCommand <string>(Resources.Close, OnClosePaymentScreen, CanClosePaymentScreen);
            paymentButtonsViewModel.SetButtonCommands(_makePaymentCommand, null, ClosePaymentScreenCommand);
        }
Example #3
0
        public MyPageViewModel(ITicketService ticketService, ITicketMapper mapper)
        {
            _ticketService = ticketService;
            _mapper = mapper;

            LoadTickets = new ReactiveAsyncCommand(null, 1, RxApp.DeferredScheduler);

            LoadTickets.RegisterAsyncFunction(x => loadTickets())
                .ToProperty(this, x => x.Tickets);

            Observable.Interval(TimeSpan.FromSeconds(10), RxApp.DeferredScheduler)
                    .InvokeCommand(LoadTickets);
            LoadTickets.Execute(null);

            _redmineBaseUrl = ConfigurationManager.AppSettings["Redmine.BaseRedmineUrl"];

            SortBy = new List<SortByModel>()
            {
                new SortByModel("Project", c => c.Project),
                new SortByModel("Due date", c=> c.DueDate),
                new SortByModel("Priority", c => c.Priority),
            };

            SortByCommand = new ReactiveCommand(this.WhenAny(c => c.Tickets,
                                                                                                            ((tickets) => tickets.Value != null && tickets.Value.Count > 0)));

            SortByCommand.Subscribe(c => sortTickets((SortByModel)c));
        }
Example #4
0
 public MasterController(ITicketService ticketService, IUserRepository userRepo, IProjectRepository projectRepo, ITicketRepository ticketRepo)
 {
     _ticketService = ticketService;
     _userRepo = userRepo;
     _projectRepo = projectRepo;
     _ticketRepo = ticketRepo;
 }
Example #5
0
 public ExecutePrintJob(ITicketService ticketService, IApplicationState applicationState, ICacheService cacheService, IPrinterService printerService)
 {
     _ticketService = ticketService;
     _applicationState = applicationState;
     _cacheService = cacheService;
     _printerService = printerService;
 }
Example #6
0
 public AttendanceController(IAttendanceService attendanceService, IEmployeeService employeeService, ITicketService ticketService, IAspNetUserService aspNetUserService)
 {
     this.attendanceService = attendanceService;
     this.employeeService   = employeeService;
     this.ticketService     = ticketService;
     this.aspNetUserService = aspNetUserService;
 }
Example #7
0
 public TicketsController(IUnitOfWork _uow, ITicketService ticketService, IClientService _clientSvc, IStaffService _staffService)
 {
     uow          = _uow;
     ticketSvc    = ticketService;
     clientSvc    = _clientSvc;
     staffService = _staffService;
 }
Example #8
0
 public PurchaseService(CoffeeCardContext context, IMobilePayPaymentsService mobilePayPaymentsService, ITicketService ticketService, IEmailService emailService)
 {
     _context = context;
     _mobilePayPaymentsService = mobilePayPaymentsService;
     _ticketService = ticketService;
     _emailService = emailService;
 }
Example #9
0
        public PosViewModel(IRegionManager regionManager, IApplicationState applicationState, IApplicationStateSetter applicationStateSetter,
            ITicketService ticketService, IUserService userService, ICacheService cacheService, TicketListViewModel ticketListViewModel,
            TicketTagListViewModel ticketTagListViewModel, MenuItemSelectorViewModel menuItemSelectorViewModel, MenuItemSelectorView menuItemSelectorView,
            TicketViewModel ticketViewModel, TicketOrdersViewModel ticketOrdersViewModel,TicketEntityListViewModel ticketEntityListViewModel)
        {
            _ticketService = ticketService;
            _userService = userService;
            _cacheService = cacheService;
            _applicationState = applicationState;
            _applicationStateSetter = applicationStateSetter;
            _regionManager = regionManager;
            _menuItemSelectorView = menuItemSelectorView;
            _ticketViewModel = ticketViewModel;
            _ticketOrdersViewModel = ticketOrdersViewModel;
            _menuItemSelectorViewModel = menuItemSelectorViewModel;
            _ticketListViewModel = ticketListViewModel;
            _ticketTagListViewModel = ticketTagListViewModel;
            _ticketEntityListViewModel = ticketEntityListViewModel;

            EventServiceFactory.EventService.GetEvent<GenericEvent<Ticket>>().Subscribe(OnTicketEventReceived);
            EventServiceFactory.EventService.GetEvent<GenericEvent<SelectedOrdersData>>().Subscribe(OnSelectedOrdersChanged);
            EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe(OnTicketEvent);
            EventServiceFactory.EventService.GetEvent<GenericEvent<ScreenMenuItemData>>().Subscribe(OnMenuItemSelected);
            EventServiceFactory.EventService.GetEvent<GenericIdEvent>().Subscribe(OnTicketIdPublished);
            EventServiceFactory.EventService.GetEvent<GenericEvent<EntityOperationRequest<Entity>>>().Subscribe(OnEntitySelectedForTicket);
            EventServiceFactory.EventService.GetEvent<GenericEvent<TicketTagGroup>>().Subscribe(OnTicketTagSelected);
            EventServiceFactory.EventService.GetEvent<GenericEvent<TicketStateData>>().Subscribe(OnTicketStateSelected);
            EventServiceFactory.EventService.GetEvent<GenericEvent<Department>>().Subscribe(OnDepartmentChanged);
        }
Example #10
0
 public SalesViewModel(IProductService productService, ITicketService ticketService, IEventAggregator eventAggregator, INotifyService notifyService)
 {
     _productService = productService;
     _ticketService = ticketService;
     _eventAggregator = eventAggregator;
     _notifyService = notifyService;
 }
Example #11
0
        public TicketViewModel(Ticket model, TicketTemplate ticketTemplate, bool forcePayment,
            ITicketService ticketService, IAutomationService automationService,
            IApplicationState applicationState)
        {
            _ticketService = ticketService;
            _forcePayment = forcePayment;
            _model = model;
            _ticketTemplate = ticketTemplate;
            _automationService = automationService;
            _applicationState = applicationState;

            _orders = new ObservableCollection<OrderViewModel>(model.Orders.Select(x => new OrderViewModel(x, ticketTemplate, _automationService)).OrderBy(x => x.Model.CreatedDateTime));
            _itemsViewSource = new CollectionViewSource { Source = _orders };
            _itemsViewSource.GroupDescriptions.Add(new PropertyGroupDescription("GroupObject"));

            SelectAllItemsCommand = new CaptionCommand<string>("", OnSelectAllItemsExecute);

            PrintJobButtons = _applicationState.CurrentTerminal.PrintJobs
                .Where(x => (!string.IsNullOrEmpty(x.ButtonHeader))
                    && (x.PrinterMaps.Count(y => y.DepartmentId == 0 || y.DepartmentId == model.DepartmentId) > 0))
                .OrderBy(x => x.Order)
                .Select(x => new PrintJobButton(x, Model));

            if (PrintJobButtons.Count(x => x.Model.UseForPaidTickets) > 0)
            {
                PrintJobButtons = IsPaid
                    ? PrintJobButtons.Where(x => x.Model.UseForPaidTickets)
                    : PrintJobButtons.Where(x => !x.Model.UseForPaidTickets);
            }
        }
        public PaymentEditorViewModel(IApplicationState applicationState, ICacheService cacheService, IExpressionService expressionService,
            TicketTotalsViewModel paymentTotals, PaymentEditor paymentEditor, NumberPadViewModel numberPadViewModel,
            OrderSelectorViewModel orderSelectorViewModel, ITicketService ticketService,
            ForeignCurrencyButtonsViewModel foreignCurrencyButtonsViewModel, PaymentButtonsViewModel paymentButtonsViewModel,
            CommandButtonsViewModel commandButtonsViewModel, TenderedValueViewModel tenderedValueViewModel,
            ReturningAmountViewModel returningAmountViewModel, ChangeTemplatesViewModel changeTemplatesViewModel, AccountBalances accountBalances)
        {
            _applicationState = applicationState;
            _cacheService = cacheService;
            _expressionService = expressionService;
            _paymentTotals = paymentTotals;
            _paymentEditor = paymentEditor;
            _numberPadViewModel = numberPadViewModel;
            _orderSelectorViewModel = orderSelectorViewModel;
            _ticketService = ticketService;
            _foreignCurrencyButtonsViewModel = foreignCurrencyButtonsViewModel;
            _commandButtonsViewModel = commandButtonsViewModel;
            _tenderedValueViewModel = tenderedValueViewModel;
            _returningAmountViewModel = returningAmountViewModel;
            _changeTemplatesViewModel = changeTemplatesViewModel;
            _accountBalances = accountBalances;

            _makePaymentCommand = new CaptionCommand<PaymentType>("", OnMakePayment, CanMakePayment);
            _selectChangePaymentTypeCommand = new CaptionCommand<PaymentData>("", OnSelectChangePaymentType);

            ClosePaymentScreenCommand = new CaptionCommand<string>(Resources.Close, OnClosePaymentScreen, CanClosePaymentScreen);
            paymentButtonsViewModel.SetButtonCommands(_makePaymentCommand, null, ClosePaymentScreenCommand);
        }
Example #13
0
 public DashboardController(IMailService mailService, UserManager <MyUser> userManager, RoleManager <IdentityRole> roleManager, ITicketService ticketService)
 {
     _mailService   = mailService;
     _userManager   = userManager;
     _roleManager   = roleManager;
     _ticketService = ticketService;
 }
        public IEnumerable <Ticket> SearchIndex(ITicketService ticketService, string searchText, out string queryTerm)
        {
            string[] fields = new[] { "title", "details", "tags", "comments" };
            MultiFieldQueryParser parser = new MultiFieldQueryParser(Lucene.Net.Util.Version.LUCENE_29, fields, TdIndexAnalyzer);

            Query query = parser.Parse(searchText);

            queryTerm = query.ToString();
            TopScoreDocCollector collector = TopScoreDocCollector.create(20, true);

            TdIndexSearcher.Search(query, collector);

            ScoreDoc[] hits = collector.TopDocs().scoreDocs;

            SortedList <int, int> ticketIDs = new SortedList <int, int>();
            var o = 0;

            foreach (ScoreDoc scoreDoc in hits)
            {
                //Get the document that represents the search result.
                Document document = TdIndexSearcher.Doc(scoreDoc.doc);

                int ticketID = int.Parse(document.Get("ticketid"));

                //The same document can be returned multiple times within the search results.
                if (!ticketIDs.Values.Contains(ticketID))
                {
                    ticketIDs.Add(o, ticketID);
                    o++;
                }
            }
            return(ticketService.ListTickets(ticketIDs, false));
        }
Example #15
0
 public TicketTypeController(ITicketTypeService ticketTypeService, IIdentityService identityService, IMapper mapper, ITicketService ticketService)
 {
     _ticketTypeService = ticketTypeService;
     _identityService   = identityService;
     _mapper            = mapper;
     _ticketService     = ticketService;
 }
Example #16
0
 public TicketsController(IUserService userManager, IAdminProjectService projects, ITicketService tickets, IMessageService messages)
 {
     this.userManager = userManager ?? throw new ArgumentNullException(nameof(userManager));
     this.projects    = projects ?? throw new ArgumentNullException(nameof(projects));
     this.tickets     = tickets ?? throw new ArgumentNullException(nameof(tickets));
     this.messages    = messages ?? throw new ArgumentNullException(nameof(messages));
 }
Example #17
0
 public ReservationsController(UserManager <EventsUser> userManager, ITicketService ticketService, IEventService eventService, IReservationService reservationService)
 {
     _userManager            = userManager;
     this.ticketService      = ticketService;
     this.eventService       = eventService;
     this.reservationService = reservationService;
 }
        public void StartUp()
        {
            var optionsBuilder = new DbContextOptionsBuilder <AirportContext>();

            optionsBuilder.UseSqlServer(@"Server = (localdb)\mssqllocaldb; Database = AirportDB; Trusted_Connection = True; ConnectRetryCount = 0");
            _context = new AirportContext(optionsBuilder.Options);
            _mapper  = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <TicketDTO, Ticket>()
                .ForMember(x => x.Id, opt => opt.Ignore());
                cfg.CreateMap <Ticket, TicketDTO>();
                cfg.CreateMap <CrewDTO, Crew>()
                .ForMember(i => i.Id, opt => opt.Ignore())
                .ForMember(i => i.Stewardesses, opt => opt.Ignore())
                .ForMember(i => i.Pilot, opt => opt.Ignore());
                cfg.CreateMap <Crew, CrewDTO>()
                .ForMember(i => i.StewardessesId, opt => opt.MapFrom(m => m.Stewardesses.Select(s => s.Id)))
                .ForMember(i => i.PilotId, opt => opt.MapFrom(m => m.Pilot.Id));
                cfg.CreateMap <Ticket, TicketDTO>();
            }).CreateMapper();
            _uow              = new UnitOfWork(_context);
            _ticketService    = new TicketService(_uow, _mapper);
            _crewService      = new CrewService(_uow, _mapper);
            _crewController   = new CrewController(_crewService);
            _ticketController = new TicketController(_ticketService);
        }
Example #19
0
        public virtual async void TestDelete()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);
            var        client     = new ApiClient(testServer.CreateClient());

            client.SetBearerToken(JWTTestHelper.GenerateBearerToken());
            ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext;

            ITicketService service = testServer.Host.Services.GetService(typeof(ITicketService)) as ITicketService;
            var            model   = new ApiTicketServerRequestModel();

            model.SetProperties("B", 1);
            CreateResponse <ApiTicketServerResponseModel> createdResponse = await service.Create(model);

            createdResponse.Success.Should().BeTrue();

            ActionResponse deleteResult = await client.TicketDeleteAsync(2);

            deleteResult.Success.Should().BeTrue();
            ApiTicketServerResponseModel verifyResponse = await service.Get(2);

            verifyResponse.Should().BeNull();
        }
 public TicketController(ITicketService ticketService, IVoyageService voyageService, IGenericService <Location> locationService, IGenericService <Bus> busService)
 {
     _ticketService   = ticketService;
     _voyageService   = voyageService;
     _locationService = locationService;
     _busService      = busService;
 }
 public TicketOrdersViewModel(ITicketService ticketService)
 {
     _ticketService = ticketService;
     _orders = new ObservableCollection<OrderViewModel>();
     _itemsViewSource = new CollectionViewSource { Source = _orders };
     _itemsViewSource.GroupDescriptions.Add(new PropertyGroupDescription("GroupObject"));
 }
Example #22
0
        public TicketServiceTest()
        {
            var optionsBuilder = new DbContextOptionsBuilder <ApplicationDbContext>();

            optionsBuilder.UseInMemoryDatabase("TestDb" + Guid.NewGuid());
            applicationDbContext = new ApplicationDbContext(optionsBuilder.Options);

            seatRepository  = new SeatRepository(applicationDbContext);
            orderRepository = new OrderRepository(applicationDbContext);
            movieRepository = new MovieRepository(applicationDbContext);
            snackRepository = new SnackRepository(applicationDbContext);

            seatRepository.Insert(new Seat {
                Status = SeatStatus.Free
            });
            seatRepository.Insert(new Seat {
                Status = SeatStatus.Free
            });
            movieRepository.Insert(new Movie {
                Title = "Test", ScreeningTimes = new List <ScreeningTime> {
                    screeningTime
                }
            });
            snackRepository.Insert(new Snack {
                Name = "SnackTest1"
            });
            snackRepository.Insert(new Snack {
                Name = "SnackTest2"
            });

            applicationDbContext.SaveChanges();

            ticketService = new TicketService(seatRepository, movieRepository, orderRepository, snackRepository);
        }
 public void Deinitialize()
 {
     ticketRepository = null;
     mockUoW          = null;
     mapper           = null;
     service          = null;
 }
 public CreatTicetController(ITicketService ticketService, IgetService igetService, IPersonService service, NewCrmContext context)
 {
     _ticketService = ticketService;
     _getService    = igetService;
     _service       = service;
     _context       = context;
 }
Example #25
0
 public TicketsController(IUserService userManager, IAdminProjectService projects, ITicketService tickets, IMessageService messages)
 {
     this.userManager = userManager;
     this.projects    = projects;
     this.tickets     = tickets;
     this.messages    = messages;
 }
 public DiscountController(IDiscountService discountService, ITicketService ticketService, IHangfireService hangfireService, UserManager <User> userManager)
 {
     _discountService = discountService;
     _ticketService   = ticketService;
     _hangfireService = hangfireService;
     _userManager     = userManager;
 }
        public PaymentEditorViewModel(IApplicationState applicationState, ITicketService ticketService,
            IPrinterService printerService, IUserService userService, IAutomationService automationService, TicketTotalsViewModel totals)
        {
            _applicationState = applicationState;
            _ticketService = ticketService;
            _printerService = printerService;
            _userService = userService;
            _automationService = automationService;

            _manualPrintCommand = new CaptionCommand<PrintJob>(Resources.Print, OnManualPrint, CanManualPrint);
            _makePaymentCommand = new CaptionCommand<PaymentTemplate>("", OnMakePayment, CanMakePayment);
            _serviceSelectedCommand = new CaptionCommand<CalculationTemplate>("", OnSelectCalculationTemplate);

            SubmitAccountPaymentCommand = new CaptionCommand<string>(Resources.AccountBalance_r, OnSubmitAccountPayment, CanSubmitAccountPayment);
            ClosePaymentScreenCommand = new CaptionCommand<string>(Resources.Close, OnClosePaymentScreen, CanClosePaymentScreen);
            TenderAllCommand = new CaptionCommand<string>(Resources.All, OnTenderAllCommand);
            TypeValueCommand = new DelegateCommand<string>(OnTypeValueExecuted);
            SetValueCommand = new DelegateCommand<string>(OnSetValue);
            DivideValueCommand = new DelegateCommand<string>(OnDivideValue);
            SelectMergedItemCommand = new DelegateCommand<MergedItem>(OnMergedItemSelected);

            SetDiscountAmountCommand = new CaptionCommand<string>(Resources.Round, OnSetDiscountAmountCommand, CanSetDiscount);
            AutoSetDiscountAmountCommand = new CaptionCommand<string>(Resources.Flat, OnAutoSetDiscount, CanAutoSetDiscount);
            SetDiscountRateCommand = new CaptionCommand<string>(Resources.DiscountPercentSign, OnSetDiscountRateCommand, CanSetDiscountRate);

            MergedItems = new ObservableCollection<MergedItem>();
            ReturningAmountVisibility = Visibility.Collapsed;

            Totals = totals;

            PaymentButtonGroup = new PaymentButtonGroupViewModel(_makePaymentCommand, null, ClosePaymentScreenCommand);

            LastTenderedAmount = "1";
        }
 public void Reset()
 {
     _ticketController = null;
     _uow           = null;
     _mapper        = null;
     _ticketService = null;
 }
        public MenuItemSelectorViewModel(IApplicationState applicationState, ITicketService ticketService,
            IUserService userService, IMenuService menuService, ISettingService settingService, ICacheService cacheService)
        {
            _ticketService = ticketService;
            _userService = userService;
            _applicationState = applicationState;
            _menuService = menuService;
            _settingService = settingService;
            _cacheService = cacheService;

            CategoryCommand = new DelegateCommand<ScreenMenuCategory>(OnCategoryCommandExecute);
            MenuItemCommand = new DelegateCommand<ScreenMenuItem>(OnMenuItemCommandExecute);
            TypeValueCommand = new DelegateCommand<string>(OnTypeValueExecute);
            FindLocationCommand = new DelegateCommand<string>(OnFindLocationExecute, CanFindLocation);
            FindMenuItemCommand = new DelegateCommand<string>(OnFindMenuItemCommand);
            FindTicketCommand = new DelegateCommand<string>(OnFindTicketExecute, CanFindTicket);
            IncPageNumberCommand = new CaptionCommand<string>(Localization.Properties.Resources.NextPage + " >>", OnIncPageNumber, CanIncPageNumber);
            DecPageNumberCommand = new CaptionCommand<string>("<< " + Localization.Properties.Resources.PreviousPage, OnDecPageNumber, CanDecPageNumber);
            SubCategoryCommand = new CaptionCommand<ScreenSubCategoryButton>(".", OnSubCategoryCommand);

            EventServiceFactory.EventService.GetEvent<GenericEvent<Department>>().Subscribe(OnDepartmentChanged);
            EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe(OnNumeratorReset);
            NumeratorValue = "";

            SubCategories = new ObservableCollection<ScreenSubCategoryButton>();
        }
Example #30
0
 public ChangeTripStatusCommand(ITripService tripService, IBusStationService busStationService, IArrivedTripService arrivedTripService, ITicketService ticketService)
 {
     this.tripService        = tripService;
     this.busStationService  = busStationService;
     this.arrivedTripService = arrivedTripService;
     this.ticketService      = ticketService;
 }
Example #31
0
 public ChangeTicketEntity(ITicketService ticketService, IApplicationState applicationState, ICacheService cacheService, IEntityService entityService)
 {
     _ticketService    = ticketService;
     _applicationState = applicationState;
     _cacheService     = cacheService;
     _entityService    = entityService;
 }
Example #32
0
 public ChangeTicketEntity(ITicketService ticketService, IApplicationState applicationState, ICacheService cacheService, IEntityService entityService)
 {
     _ticketService = ticketService;
     _applicationState = applicationState;
     _cacheService = cacheService;
     _entityService = entityService;
 }
Example #33
0
 public EditModel(ITicketService ticketRepository, IUserService userRepository, IOptionSetService optionSetService, ILogger <EditModel> logger)
 {
     _ticketRepository = ticketRepository;
     _userRepository   = userRepository;
     _optionSetService = optionSetService;
     _logger           = logger;
 }
Example #34
0
        ////----------正式参数---------------
        //public string organization = "1000000438";//机构号
        //public string password = "******";//密码
        //public string skey = "oiszFLRc";//DES密钥

        ////-----------测试参数----------------
        //public string organization = "1000000286";//机构号
        //public string password = "******";//密码
        //public string skey = "vSK5eIRC";//des密钥

        #region  发送电子票
        internal string Add_Order(ApiService mapiservice, Api_yg_addorder_input minput)
        {
            StringBuilder builderOrder = new StringBuilder();

            builderOrder.Append(@"<?xml version=""1.0"" encoding=""utf-8"" ?>");
            builderOrder.Append(@"<business_trans version=""1.0"">");
            builderOrder.AppendFormat("<request_type>{0}</request_type>", "add_order");
            builderOrder.AppendFormat("<organization>{0}</organization>", mapiservice.Organization);  //<!-机构号-->
            builderOrder.AppendFormat("<password>{0}</password>", mapiservice.Password);              //<!-- 接口使用密码  y-->
            builderOrder.AppendFormat("<req_seq>{0}</req_seq>", minput.req_seq);                      //<!--请求流水号 y-->
            builderOrder.AppendFormat("<order>");                                                     //<!--订单信息-->
            builderOrder.AppendFormat("<product_num>{0}</product_num>", minput.product_num);          //<!--产品编码 y-->
            builderOrder.AppendFormat("<num>{0}</num>", minput.num);                                  //<!--购买数量 y-->
            builderOrder.AppendFormat("<mobile>{0}</mobile>", minput.mobile);                         //<!-- 手机号码 y-->
            builderOrder.AppendFormat("<use_date>{0}</use_date>", minput.use_date);                   //<!-- 使用时间 -->
            builderOrder.AppendFormat("<real_name_type>{0}</real_name_type>", minput.real_name_type); //<!-- 实名制类型:0无需实名 1一张一人,2一单一人,3一单一人+身份证-->
            builderOrder.AppendFormat("<real_name>{0}</real_name>", minput.real_name);                //<!--真是姓名  ,隔开 最多3个名字 <=3 -->
            builderOrder.AppendFormat("<id_card>{0}</id_card>", minput.id_card);                      //<!--证件号码 -->
            builderOrder.AppendFormat("<card_type>{0}</card_type>", minput.card_type);                //<!--证件类型0身份证;1其他证件 -->
            builderOrder.AppendFormat("</order>");
            builderOrder.AppendFormat("</business_trans>");

            string bstr = "";

            try
            {
                ITicketService its10   = new ITicketService();
                string         en      = EncryptionHelper.DESEnCode(builderOrder.ToString(), mapiservice.Deskey);
                string         retxmls = its10.getEleInterface(mapiservice.Organization, en);

                bstr = EncryptionHelper.DESDeCode(retxmls, mapiservice.Deskey);
            }
            catch (Exception e)
            {
                bstr = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                       "<business_trans>" +
                       "<response_type>add_order</response_type>" +
                       "<req_seq>" + minput.req_seq + "</req_seq>" +
                       "<result>" +
                       "<id></id>" +
                       "<comment>" + e.Message + "</comment>" +
                       " </result>" +
                       "</business_trans>";
            }
            //录入交互日志
            ApiLog mapilog = new ApiLog
            {
                Id            = 0,
                request_type  = "add_order",
                Serviceid     = 1,
                Str           = builderOrder.ToString().Trim(),
                Subdate       = DateTime.Now,
                ReturnStr     = bstr,
                ReturnSubdate = DateTime.Now,
                Errmsg        = "",
            };
            int ins = new ApiLogData().EditLog(mapilog);

            return(bstr);
        }
Example #35
0
 public TicketController(ITicketService ticketService, IEmployeeService employeeService, IAspNetUserService aspNetUserService, ITicketTypeService ticketTypeService)
 {
     this.ticketService     = ticketService;
     this.employeeService   = employeeService;
     this.aspNetUserService = aspNetUserService;
     this.ticketTypeService = ticketTypeService;
 }
Example #36
0
        public EditSalesViewModel(ITicketService ticketService, IEventAggregator eventAggregator)
        {
            _ticketService = ticketService;
            _eventAggregator = eventAggregator;

            Tickets = new List<Ticket>(ticketService.GetTickets());
        }
Example #37
0
 public HomeController(IStationService stationService,
     ITicketService ticketService,
     IOrderService orderService)
 {
     this.stationService = stationService;
     this.ticketService = ticketService;
     this.orderService = orderService;
 }
Example #38
0
 public TicketListViewModel(ITicketService ticketService)
 {
     _ticketService = ticketService;
     _tickets = new List<TicketButtonViewModel>();
     AddTicketCommand = new CaptionCommand<string>(string.Format(Resources.Add_f, Resources.Ticket).Replace(" ", "\r"), OnAddTicket, CanAddTicket);
     MergeTicketsCommand = new CaptionCommand<string>(Resources.MergeTickets.Replace(" ", "\r"), OnMergeTickets, CanMergeTickets);
     CloseCommand = new CaptionCommand<string>(Resources.Close.Replace(" ", "\r"), OnCloseCommand);
 }
        public TicketTagEditorViewModel(ICacheService cacheService, ITicketService ticketService)
        {
            _cacheService = cacheService;
            _ticketService = ticketService;

            TicketTags = new ObservableCollection<TicketTag>();
            CloseCommand = new CaptionCommand<string>(Resources.Close, OnCloseCommandExecuted);
            SelectTicketTagCommand = new DelegateCommand<TicketTag>(OnTicketTagSelected);
            UpdateFreeTagCommand = new CaptionCommand<string>(Resources.AddAndSave, OnUpdateFreeTag, CanUpdateFreeTag);
        }
        public TicketServiceTests()
        {
            _mockTicketRepo = new Mock<ITicketRepository>();
            _mockProjectRepo = new Mock<IProjectRepository>();

            _mockProjectRepo.Setup(p => p.Save(It.Is<Project>(isp => isp != null)));

            _mockUnitOfWork = new Mock<IUnitOfWork>();
            _ticketService = new TicketService(_mockUnitOfWork.Object, _mockTicketRepo.Object, _mockProjectRepo.Object);
        }
Example #41
0
 public OrderService(IRepository<Order> repository,
     ITicketService ticketService,
     IOrderQueuedService orderQueuedService,
     ISyncLockService syncLockService)
 {
     this.repository = repository;
     this.ticketService = ticketService;
     this.orderQueuedService = orderQueuedService;
     this.syncLockService = syncLockService;
 }
Example #42
0
 public ServicesManager(IPushNotificationService pushNotification,
     IEmailService emailService, ITicketService ticketService, IPropertyDataImporter propertyDataImporter,
     IFileStorageService fileStorageService)
 {
     _pushNotification = pushNotification;
     _emailService = emailService;
     _ticketService = ticketService;
     _propertyDataImporter = propertyDataImporter;
     _fileStorageService = fileStorageService;
 }
Example #43
0
        public PosViewModel(IRegionManager regionManager, IApplicationState applicationState, IApplicationStateSetter applicationStateSetter,
            ITicketService ticketService, IUserService userService, TicketExplorerViewModel ticketExplorerViewModel,
            MenuItemSelectorViewModel menuItemSelectorViewModel, MenuItemSelectorView menuItemSelectorView, TicketListViewModel ticketListViewModel)
        {
            _ticketService = ticketService;
            _userService = userService;
            _applicationState = applicationState;
            _applicationStateSetter = applicationStateSetter;
            _regionManager = regionManager;
            _menuItemSelectorView = menuItemSelectorView;
            _ticketListViewModel = ticketListViewModel;

            _menuItemSelectorViewModel = menuItemSelectorViewModel;
            _ticketExplorerViewModel = ticketExplorerViewModel;

            EventServiceFactory.EventService.GetEvent<GenericEvent<NavigationRequest>>().Subscribe(OnNavigationRequest);
            EventServiceFactory.EventService.GetEvent<GenericEvent<User>>().Subscribe(OnUserLoginEvent);
            EventServiceFactory.EventService.GetEvent<GenericEvent<WorkPeriod>>().Subscribe(OnWorkPeriodEvent);
            EventServiceFactory.EventService.GetEvent<GenericEvent<SelectedOrdersData>>().Subscribe(
                x =>
                {
                    if (x.Topic == EventTopicNames.SelectedOrdersChanged)
                    {
                        if (x.Value.SelectedOrders.Count() != 1)
                            DisplayMenuScreen();
                    }
                });

            EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe(
                 x =>
                 {
                     switch (x.Topic)
                     {
                         case EventTopicNames.ActivatePosView:
                             DisplayTickets();
                             DisplayMenuScreen();
                             break;
                         case EventTopicNames.ActivateTicket:
                             DisplaySingleTicket();
                             break;
                         case EventTopicNames.PaymentSubmitted:
                             DisplayMenuScreen();
                             break;
                     }
                 });

            EventServiceFactory.EventService.GetEvent<GenericEvent<Department>>().Subscribe(
                x =>
                {
                    if (x.Topic == EventTopicNames.ActivateOpenTickets)
                    {
                        DisplayOpenTickets();
                    }
                });
        }
Example #44
0
 public TicketListViewModel(ITicketService ticketService, ITicketServiceBase ticketServiceBase, IApplicationState applicationState)
 {
     _ticketService = ticketService;
     _ticketServiceBase = ticketServiceBase;
     _applicationState = applicationState;
     _tickets = new List<TicketButtonViewModel>();
     AddTicketCommand = new CaptionCommand<string>(string.Format(Resources.Add_f, Resources.Ticket).Replace(" ", "\r"), OnAddTicket, CanAddTicket);
     MergeTicketsCommand = new CaptionCommand<string>(Resources.MergeTickets.Replace(" ", "\r"), OnMergeTickets, CanMergeTickets);
     CloseCommand = new CaptionCommand<string>(Resources.Close.Replace(" ", "\r"), OnCloseCommand);
     _executeAutomationCommand = new CaptionCommand<AutomationCommandData>("", OnExecuteAutomationCommand, CanExecuteAutomationCommand);
 }
 public ResourceEditorViewModel(ICacheService cacheService, IAccountService accountService,IUserService userService,ITicketService ticketService)
 {
     _cacheService = cacheService;
     _accountService = accountService;
     _userService = userService;
     _ticketService = ticketService;
     SaveResourceCommand = new CaptionCommand<string>(Resources.Save, OnSaveResource, CanSelectResource);
     SelectResourceCommand = new CaptionCommand<string>(string.Format(Resources.Select_f, Resources.Resource).Replace(" ", "\r"), OnSelectResource, CanSelectResource);
     CreateAccountCommand = new CaptionCommand<string>(string.Format(Resources.Create_f, Resources.Account).Replace(" ", "\r"), OnCreateAccount, CanCreateAccount);
     EventServiceFactory.EventService.GetEvent<GenericEvent<EntityOperationRequest<Resource>>>().Subscribe(OnEditResource);
 }
 public AccountTicketsViewModel(ITicketService ticketService, IApplicationStateSetter applicationStateSetter, IApplicationState applicationState)
 {
     _ticketService = ticketService;
     _applicationState = applicationState;
     _applicationStateSetter = applicationStateSetter;
     OpenTicketCommand = new DelegateCommand<int?>(OnOpenTicket);
     MakePaymentCommand = new CaptionCommand<string>(Resources.Settle, OnMakePayment);
     MakeFastPaymentCommand = new CaptionCommand<string>("Fast", OnMakeFastPayment);
     CloseCommand = new CaptionCommand<string>(Resources.Close, OnClose);
     PaymentButtonGroup = new PaymentButtonGroupViewModel(MakeFastPaymentCommand, MakePaymentCommand, CloseCommand);
 }
        public TicketListViewModel(IApplicationState applicationState, IApplicationStateSetter applicationStateSetter,
            ITicketService ticketService, IAccountService accountService, IPrinterService printerService,
            IResourceService locationService, IUserService userService, IAutomationService automationService,
            ICacheService cacheService, TicketOrdersViewModel ticketOrdersViewModel, TicketTotalsViewModel totals)
        {
            _printerService = printerService;
            _ticketService = ticketService;
            _accountService = accountService;
            _locationService = locationService;
            _userService = userService;
            _applicationState = applicationState;
            _applicationStateSetter = applicationStateSetter;
            _automationService = automationService;
            _cacheService = cacheService;
            _ticketOrdersViewModel = ticketOrdersViewModel;
            _totals = totals;

            _selectedOrders = new ObservableCollection<Order>();

            PrintJobCommand = new CaptionCommand<PrintJob>(Resources.Print, OnPrintJobExecute, CanExecutePrintJob);
            SelectResourceCommand = new DelegateCommand<ResourceTemplate>(OnSelectResource);

            AddMenuItemCommand = new DelegateCommand<ScreenMenuItemData>(OnAddMenuItemCommandExecute);
            CloseTicketCommand = new CaptionCommand<string>(Resources.CloseTicket_r, OnCloseTicketExecute, CanCloseTicket);
            MakePaymentCommand = new CaptionCommand<string>(Resources.Settle, OnMakePaymentExecute, CanMakePayment);
            MakeFastPaymentCommand = new CaptionCommand<PaymentTemplate>("[FastPayment]", OnMakeFastPaymentExecute, CanMakeFastPayment);
            ShowAllOpenTickets = new CaptionCommand<string>(Resources.AllTickets_r, OnShowAllOpenTickets);
            IncQuantityCommand = new CaptionCommand<string>("+", OnIncQuantityCommand, CanIncQuantity);
            DecQuantityCommand = new CaptionCommand<string>("-", OnDecQuantityCommand, CanDecQuantity);
            IncSelectionQuantityCommand = new CaptionCommand<string>("(+)", OnIncSelectionQuantityCommand, CanIncSelectionQuantity);
            DecSelectionQuantityCommand = new CaptionCommand<string>("(-)", OnDecSelectionQuantityCommand, CanDecSelectionQuantity);
            ShowTicketTagsCommand = new CaptionCommand<TicketTagGroup>(Resources.Tag, OnShowTicketsTagExecute, CanExecuteShowTicketTags);
            ShowOrderTagsCommand = new CaptionCommand<OrderTagGroup>(Resources.Tag, OnShowOrderTagsExecute, CanShowOrderTagsExecute);
            CancelItemCommand = new CaptionCommand<string>(Resources.Cancel, OnCancelItemCommand, CanCancelSelectedItems);
            MoveOrdersCommand = new CaptionCommand<string>(Resources.MoveTicketLine, OnMoveOrders, CanMoveOrders);
            EditTicketNoteCommand = new CaptionCommand<string>(Resources.TicketNote, OnEditTicketNote, CanEditTicketNote);
            RemoveTicketLockCommand = new CaptionCommand<string>(Resources.ReleaseLock, OnRemoveTicketLock, CanRemoveTicketLock);
            ChangePriceCommand = new CaptionCommand<string>(Resources.ChangePrice, OnChangePrice, CanChangePrice);

            PaymentButtonGroup = new PaymentButtonGroupViewModel(MakeFastPaymentCommand, MakePaymentCommand, CloseTicketCommand);

            EventServiceFactory.EventService.GetEvent<GenericEvent<ScreenMenuItemData>>().Subscribe(OnMenuItemSelected);
            EventServiceFactory.EventService.GetEvent<GenericEvent<OrderViewModel>>().Subscribe(OnSelectedOrdersChanged);
            EventServiceFactory.EventService.GetEvent<GenericEvent<TicketTagData>>().Subscribe(OnTagSelected);
            EventServiceFactory.EventService.GetEvent<GenericEvent<EntityOperationRequest<Resource>>>().Subscribe(OnAccountSelectedForTicket);
            EventServiceFactory.EventService.GetEvent<GenericEvent<EntityOperationRequest<ResourceScreenItem>>>().Subscribe(OnResourceScreenItemSelected);
            EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe(OnRefreshTicket);
            EventServiceFactory.EventService.GetEvent<GenericEvent<Message>>().Subscribe(OnMessageReceived);
            EventServiceFactory.EventService.GetEvent<GenericEvent<PopupData>>().Subscribe(OnAccountSelectedFromPopup);
            EventServiceFactory.EventService.GetEvent<GenericEvent<OrderTagData>>().Subscribe(OnOrderTagEvent);
            EventServiceFactory.EventService.GetEvent<GenericEvent<MenuItemPortion>>().Subscribe(OnPortionSelected);
            EventServiceFactory.EventService.GetEvent<GenericIdEvent>().Subscribe(OnTicketIdPublished);
        }
        public WorkPeriodsViewModel(IWorkPeriodService workPeriodService, IApplicationState applicationState,
            IAutomationService ruleService, ITicketService ticketService)
        {
            _workPeriodService = workPeriodService;
            _applicationState = applicationState;
            _automationService = ruleService;
            _ticketService = ticketService;

            StartOfDayCommand = new CaptionCommand<string>(Resources.StartWorkPeriod, OnStartOfDayExecute, CanStartOfDayExecute);
            EndOfDayCommand = new CaptionCommand<string>(Resources.EndWorkPeriod, OnEndOfDayExecute, CanEndOfDayExecute);
            DisplayStartOfDayScreenCommand = new CaptionCommand<string>(Resources.StartWorkPeriod, OnDisplayStartOfDayScreenCommand, CanStartOfDayExecute);
            DisplayEndOfDayScreenCommand = new CaptionCommand<string>(Resources.EndWorkPeriod, OnDisplayEndOfDayScreenCommand, CanEndOfDayExecute);
            CancelCommand = new CaptionCommand<string>(Resources.Cancel, OnCancel);
        }
        public PaymentButtonViewModel(ICacheService cacheService, IApplicationState applicationState, ITicketService ticketService)
        {
            _cacheService = cacheService;
            _applicationState = applicationState;
            _ticketService = ticketService;

            CloseTicketCommand = new CaptionCommand<string>(Resources.CloseTicket_r, OnCloseTicketExecute, CanCloseTicket);
            MakePaymentCommand = new CaptionCommand<string>(Resources.Settle, OnMakePaymentExecute, CanMakePayment);
            MakeFastPaymentCommand = new CaptionCommand<PaymentTemplate>("[FastPayment]", OnMakeFastPaymentExecute, CanMakeFastPayment);

            PaymentButtonGroup = new PaymentButtonGroupViewModel(MakeFastPaymentCommand, MakePaymentCommand, CloseTicketCommand);
            SelectedTicket = Ticket.Empty;

            EventServiceFactory.EventService.GetEvent<GenericEvent<Department>>().Subscribe(OnDepartmentChanged);
        }
Example #50
0
        public PaymentEditor(IApplicationState applicationState, ITicketService ticketService, AccountBalances accountBalances)
        {
            _applicationState = applicationState;
            _ticketService = ticketService;
            _accountBalances = accountBalances;
            _selectedTicket = Ticket.Empty;

            EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe(x =>
            {
                if (SelectedTicket != Ticket.Empty && x.Topic == EventTopicNames.CloseTicketRequested)
                {
                    SelectedTicket = Ticket.Empty;
                }
            });
        }
        public TicketExplorerViewModel(ITicketService ticketService, IUserService userService, IApplicationState applicationState)
        {
            _ticketService = ticketService;
            _userService = userService;
            _applicationState = applicationState;

            ResetFilters();

            _timer = new Timer(250);
            _timer.Elapsed += TimerElapsed;

            CloseCommand = new CaptionCommand<string>(Resources.Close, OnCloseCommandExecuted);
            PreviousWorkPeriod = new CaptionCommand<string>("<<", OnExecutePreviousWorkPeriod);
            NextWorkPeriod = new CaptionCommand<string>(">>", OnExecuteNextWorkPeriod);
            RefreshDatesCommand = new CaptionCommand<string>(Resources.Refresh, OnRefreshDates);
        }
        public TicketExplorerViewModel(Widget widget, ITicketService ticketService, IUserService userService, ICacheService cacheService)
            : base(widget)
        {
            _ticketService = ticketService;
            _userService = userService;
            _cacheService = cacheService;

            ResetFilters();

            _timer = new Timer(250);
            _timer.Elapsed += TimerElapsed;

            CloseCommand = new CaptionCommand<string>(Resources.Close, OnCloseCommandExecuted);
            PreviousWorkPeriod = new CaptionCommand<string>("<<", OnExecutePreviousWorkPeriod);
            NextWorkPeriod = new CaptionCommand<string>(">>", OnExecuteNextWorkPeriod);
            RefreshDatesCommand = new CaptionCommand<string>(Resources.Refresh, OnRefreshDates);
        }
Example #53
0
        public PosViewModel(IRegionManager regionManager, IApplicationState applicationState, IApplicationStateSetter applicationStateSetter,
            ITicketService ticketService, ITicketServiceBase ticketServiceBase, IUserService userService, ICacheService cacheService, IMessagingService messagingService,
            TicketListViewModel ticketListViewModel, TicketTagListViewModel ticketTagListViewModel, MenuItemSelectorViewModel menuItemSelectorViewModel,
            MenuItemSelectorView menuItemSelectorView, TicketViewModel ticketViewModel, TicketOrdersViewModel ticketOrdersViewModel,
            TicketEntityListViewModel ticketEntityListViewModel, TicketTypeListViewModel ticketTypeListViewModel, AccountBalances accountBalances)
        {
            _ticketService = ticketService;
            _ticketServiceBase = ticketServiceBase;
            _userService = userService;
            _cacheService = cacheService;
            _messagingService = messagingService;
            _applicationState = applicationState;
            _applicationStateSetter = applicationStateSetter;
            _regionManager = regionManager;
            _menuItemSelectorView = menuItemSelectorView;
            _ticketViewModel = ticketViewModel;
            _ticketOrdersViewModel = ticketOrdersViewModel;
            _menuItemSelectorViewModel = menuItemSelectorViewModel;
            _ticketListViewModel = ticketListViewModel;
            _ticketTagListViewModel = ticketTagListViewModel;
            _ticketEntityListViewModel = ticketEntityListViewModel;
            _ticketTypeListViewModel = ticketTypeListViewModel;
            _accountBalances = accountBalances;

            EventServiceFactory.EventService.GetEvent<GenericEvent<Order>>().Subscribe(OnOrderEventReceived);
            EventServiceFactory.EventService.GetEvent<GenericEvent<Ticket>>().Subscribe(OnTicketEventReceived);
            EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe(OnTicketEvent);
            EventServiceFactory.EventService.GetEvent<GenericEvent<ScreenMenuItemData>>().Subscribe(OnMenuItemSelected);
            EventServiceFactory.EventService.GetEvent<GenericIdEvent>().Subscribe(OnTicketIdPublished);
            EventServiceFactory.EventService.GetEvent<GenericEvent<OperationRequest<Entity>>>().Subscribe(OnEntitySelectedForTicket);
            EventServiceFactory.EventService.GetEvent<GenericEvent<TicketTagGroup>>().Subscribe(OnTicketTagSelected);
            EventServiceFactory.EventService.GetEvent<GenericEvent<TicketStateData>>().Subscribe(OnTicketStateSelected);
            EventServiceFactory.EventService.GetEvent<GenericEvent<TicketType>>().Subscribe(OnTicketTypeChanged);

            EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe(
            x =>
            {
                if (x.Topic == EventTopicNames.ResetCache && _applicationState.CurrentTicketType != null)
                {
                    _menuItemSelectorViewModel.Reset();
                    _menuItemSelectorViewModel.UpdateCurrentScreenMenu(_applicationState.CurrentTicketType.GetScreenMenuId(_applicationState.CurrentTerminal));
                }
            });
        }
Example #54
0
        public OpenTicketsViewModel(IApplicationState applicationState, ITicketService ticketService)
        {
            _timer = new Timer(OnTimer, null, Timeout.Infinite, 1000);
            _applicationState = applicationState;
            _ticketService = ticketService;

            OpenTicketCommand = new DelegateCommand<int?>(OnOpenTicketExecute);

            EventServiceFactory.EventService.GetEvent<GenericEvent<Department>>().Subscribe(
                x =>
                {
                    if (x.Topic == EventTopicNames.ActivateOpenTickets)
                    {
                        _department = x.Value;
                        RaisePropertyChanged(() => OpenTicketListViewColumnCount);
                        UpdateOpenTickets(_department);
                    }
                });
        }