예제 #1
0
        public ActionResult CustIndex(string id)
        {
            Result res = TerminalContext.CustGet(id);

            if (!res.Succeed)
            {
                ViewBag.Result = res.Desc;
            }
            return(View(res.Data));
        }
예제 #2
0
        public ActionResult CustSearch(CustSearchViewModel model)
        {
            Result res = TerminalContext.CustSearch(model);

            if (!res.Succeed)
            {
                ViewBag.Result = res.Desc;
            }
            return(View(res.Data));
        }
예제 #3
0
        public ActionResult SysConfigIndex()
        {
            Result res = TerminalContext.SysConfigList();

            if (!res.Succeed)
            {
                ViewBag.Result = res.Desc;
            }
            return(View((SysConfigViewModel)res.Data));
        }
예제 #4
0
        public ActionResult Schedule(string id)
        {
            Result res = TerminalContext.CustGet(id);

            if (!res.Succeed)
            {
                ViewBag.Result = res.Desc;
            }
            return(View());
            //return View(res.Data);
        }
예제 #5
0
        public ActionResult SysConfigUpdate(LeXPro.Models.SysConfig CurrentSysConfig)
        {
            SysConfigViewModel model = new SysConfigViewModel();

            Result res = TerminalContext.SysConfigUpdate(CurrentSysConfig);

            if (res.Succeed)
            {
                model = (SysConfigViewModel)res.Data;
                model.SetCurrent(CurrentSysConfig.config_key);
                model.DisplayMode = "EditOnly";
                ViewBag.Result    = "Successfully updated";
            }
            else
            {
                ViewBag.Result = res.Desc;
            }
            return(View("SysConfigIndex", model));
        }
예제 #6
0
        public ActionResult SysConfigEdit(string id)
        {
            if (Session["Message"] != null)
            {
                ViewBag.Result     = Session["Message"];
                Session["Message"] = null;
            }
            SysConfigViewModel model = new SysConfigViewModel();
            Result             res   = TerminalContext.SysConfigList();

            if (!res.Succeed)
            {
                ViewBag.Result = res.Desc;
            }
            else
            {
                model = (SysConfigViewModel)res.Data;
                model.SetCurrent(id);
                model.DisplayMode = "EditOnly";
            }
            return(View("SysConfigIndex", model));
        }
 public BreakLogEntryRepository(TerminalContext context) : base(context, context.BreakLogEntries)
 {
     _terminalContext = context;
 }
 public EFRepository(TerminalContext context)
 {
     _db    = context;
     _dbSet = _db.Set <TEntity>();
 }
예제 #9
0
        public async void Start()
        {
            _cancellationTokenSource            = new CancellationTokenSource();
            _terminalContext                    = _scope.Resolve <TerminalContext>();
            _terminalContext.AuthServer         = TestTask.AuthorizationAddress;
            _terminalContext.TerminalServer     = TestTask.ServiceAddress;
            _terminalContext.TenantAlias        = TestTask.TenantAlias;
            _terminalContext.StoreId            = TestTask.StoreId;
            _terminalContext.TerminalId         = TestTask.TerminalId;
            _terminalContext.TerminalToken      = TestTask.TerminalToken;
            _terminalContext.EmployeeLogin      = TestTask.EmployeeLogin;
            _terminalContext.EmployeePassword   = TestTask.EmployeePassword;
            _terminalContext.ClientIsRegistered = TestTask.ClientIsRegistered;

            ApiConfig config = (ApiConfig)_scope.Resolve <IAPIConfig>();

            config.TerminalId             = TestTask.TerminalId.ToString();
            config.Token                  = TestTask.TerminalToken.ToString();
            config.Tenant                 = TestTask.TenantAlias;
            config.AuthorizationAddress   = TestTask.AuthorizationAddress;
            config.TerminalServiceAddress = TestTask.ServiceAddress;
            config.OrderServiceAddress    = TestTask.ServiceAddress.ToLowerInvariant().Replace("/terminalservice.svc", "/orderservice.svc");
            config.ApiVersion             = "6.0.0";

            var api = _scope.Resolve <TerminalApiWrapper>();

            api.MaxInterval = TestTask.MaxInterval;
            api.MinInterval = TestTask.MinInterval;


            while (true)
            {
                try
                {
                    if (_terminalContext.ClientIsRegistered)
                    {
                        var registerScenario = _scope.ResolveKeyed <RegisterTerminalScenario>(typeof(RegisterTerminalScenario).FullName);
                        await registerScenario.StartAsync();

                        _terminalContext.ClientIsRegistered = true;
                    }
                    var loginScenario = _scope.ResolveKeyed <EmployeeLoginScenario>(typeof(EmployeeLoginScenario).FullName);
                    await loginScenario.StartAsync();

                    var initScenario = _scope.ResolveKeyed <LoadFullMenuScenario>(typeof(LoadFullMenuScenario).FullName);
                    await initScenario.StartAsync();

                    break;
                }
                catch (Exception exception)
                {
                    api.ReportItems.Add(new ReportItem()
                    {
                        MethodName       = "EmployeeLoginScenario",
                        Created          = DateTime.UtcNow,
                        ExceptionMessage = exception.ToString()
                    });
                    await Task.Delay(10000);
                }
            }
            var endTime = TestTask.Start + TestTask.Duration;

            while (endTime > DateTime.UtcNow)
            {
                foreach (string scenarioTypeName in TestTask.Scenarios)
                {
                    try
                    {
                        IScenario scenario = _scope.ResolveKeyed <IScenario>(scenarioTypeName);
                        await scenario.StartAsync();
                    }
                    catch (Exception exception)
                    {
                        api.ReportItems.Add(new ReportItem()
                        {
                            MethodName       = scenarioTypeName,
                            Created          = DateTime.UtcNow,
                            ExceptionMessage = exception.ToString()
                        });
                    }
                    OnReported();
                    if (!_run)
                    {
                        break;
                    }
                }
            }
            OnFinished();
        }
예제 #10
0
 public MenuAvailabilityHelper(TerminalContext context)
 {
     _context = context;
 }
예제 #11
0
 public TerminalCategoryRepository(TerminalContext context) : base(context, context.TerminalCategories)
 {
 }
 public TicketCategoryRepository(TerminalContext context) : base(context, context.TicketCategories)
 {
     _terminalContext = context;
 }
 public TerminalRepository(TerminalContext context) : base(context, context.Terminals)
 {
     _terminalContext = context;
 }
 public RepositoryConta(TerminalContext context)
     : base(context)
 {
 }
예제 #15
0
 public RepositoryLancamento(TerminalContext context)
     : base(context)
 {
 }
예제 #16
0
 public EFUnitOfWork(TerminalContext context)
 {
     _context = context;
 }