示例#1
0
 private void buttonNoSale_Click(object sender, RoutedEventArgs e)
 {
     RegisterContextMenu.IsOpen = false;
     RegisterNoSale.Add(RegisterManager.ActiveRegisterDrawer.Id,
                        SessionManager.ActiveEmployee.Id);
     RegisterManager.OpenCashDrawer();
 }
        public RuntimeProcess(DisassembledFileBase file, ITerminal terminal)
        {
            // intialize this so that we're signaled. this will allow the run task
            // to be initialized to not wait until the user actually commands us to pause
            m_RunTimer = new Stopwatch();
            m_ProcCtrl = new ChildProcControl();
            m_InstructionAddrToBreakpointMap = new Dictionary <int, bool>();
            m_ExecutionState = PrgmExecutionState.Stopped;
            m_Terminal       = terminal;
            m_RegMgr         = new RegisterManager(file.TextSegment.StartingSegmentAddress, CommonConstants.DEFAULT_STACK_ADDRESS);

            m_DataSegment = new RuntimeDataSegmentAccessor(file.DataSegment);

            m_Ctx = new Interpreter.ExecutionContext(this, terminal, m_DataSegment, m_RegMgr, file.TextSegment);

            // initialize the instruction breakpoint map.
            // this will give us a positive performance boost when we execute the program
            // since we will not be creating new boolean entries in the hash table.
            int endingTxtSegmentAddr = file.TextSegment.StartingSegmentAddress + file.TextSegment.SegmentSize;

            for (int instructionAddr = file.TextSegment.StartingSegmentAddress;
                 instructionAddr < endingTxtSegmentAddr;
                 instructionAddr += sizeof(int))
            {
                m_InstructionAddrToBreakpointMap.Add(instructionAddr, false);
            }
        }
示例#3
0
        public void TestInitialize()
        {
            _mockSpiDevice = new MockSpiDevice();
            var mockSpiComm = new MockSpiComm(_mockSpiDevice);

            _registerManager = new RegisterManager(mockSpiComm);
        }
示例#4
0
        private void buttonDock_Click(object sender, RoutedEventArgs e)
        {
            RegisterContextMenu.IsOpen = false;
            int            registerSubId  = 0;
            RegisterDrawer registerDrawer =
                RegisterDrawer.GetFloating(SessionManager.ActiveEmployee.Id);

            if (registerDrawer == null)
            {
                PosDialogWindow.ShowDialog(
                    Types.Strings.RegisterMenuNotFloating, Types.Strings.Error);
                return;
            }
            if (registerSubId == 0)
            {
                DeviceManager.OpenCashDrawer1();
            }
            else if (registerSubId == 1)
            {
                DeviceManager.OpenCashDrawer2();
            }
            RegisterManager.DockRegisterDrawer(registerDrawer, registerSubId);
            OrderEntryCommands.SetupNoOrderCommands();
            PosDialogWindow.ShowDialog(
                Types.Strings.RegisterMenuDrawerIsNowDocked, Types.Strings.Notification);
            OrderEntryCommands.UpdateTicketDetailCommands();
        }
示例#5
0
        private void buttonDrop_Click(object sender, RoutedEventArgs e)
        {
            RegisterContextMenu.IsOpen = false;
            double?amount = PosDialogWindow.PromptCurrency(Types.Strings.RegisterMenuDropAmount, null);

            if (amount.HasValue && (amount.Value > 0))
            {
                double total = RegisterManager.ActiveRegisterDrawer.CurrentAmount;
                total = RegisterDrop.GetAll(RegisterManager.ActiveRegisterDrawer.Id)
                        .Aggregate(total, (current, drop) => current - drop.Amount);
                if (amount.Value < total)
                {
                    RegisterDrop.Add(RegisterManager.ActiveRegisterDrawer.Id,
                                     SessionManager.ActiveEmployee.Id, amount.Value, DateTime.Now);
                    RegisterManager.ActiveRegisterDrawer.RemoveFromCurrentAmount(amount.Value);
                    RegisterManager.OpenCashDrawer();
                }
                else
                {
                    PosDialogWindow.ShowDialog(
                        Types.Strings.RegisterMenuCantDropThatMuch,
                        Types.Strings.RegisterMenuInvalidAmount);
                }
            }
        }
        public ActionResult Index(RegisterDetails RegisterDetails)
        {
            ActionResult actionResult = new ActionResult();

            try
            {
                RegisterManager.MapRegisterDetail(RegisterDetails);
                if (RegisterManager.Validate())
                {
                    if (PortalSettings.UserRegistration != (int)Globals.PortalRegistrationType.NoRegistration)
                    {
                        actionResult = RegisterManager.CreateUser(RegisterDetails);
                    }
                    else
                    {
                        actionResult.AddError("Registration_NotAllowed", "User registration is not allowed.");
                    }
                }
                else
                {
                    if (RegisterManager.CreateStatus != UserCreateStatus.AddUser)
                    {
                        actionResult.AddError("Registration_Failed", UserController.GetUserCreateStatus(RegisterManager.CreateStatus));
                    }
                }
            }
            catch (Exception ex)
            {
                actionResult.AddError("Register_Error", ex.Message);
            }
            return(actionResult);
        }
        public async Task <HttpResponseMessage> Register(RegisterBindingModel model, string userRole, string userName)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }

            registerManager = new RegisterManager();

            switch (userRole)
            {
            case "Trainee":
                var traineeResult = await registerManager.RegisterTraineeUser(model.Email, model.Password, userName);

                return(Request.CreateResponse(HttpStatusCode.OK, traineeResult));

            case "Trainer":
                var trainerResult = await registerManager.RegisterTrainerUser(model.Email, model.Password, userName);

                return(Request.CreateResponse(HttpStatusCode.OK, trainerResult));

            case "Gym":
                var gymResult = await registerManager.RegisterGymUser(model.Email, model.Password, userName);

                return(Request.CreateResponse(HttpStatusCode.OK, gymResult));
            }

            return(Request.CreateResponse(HttpStatusCode.OK));
        }
示例#8
0
        public static void Main(string[] args)
        {
            bool_0 = true;
            DateTime now = DateTime.Now;

            Output.InitializeStream(true, OutputLevel.DebugInformation);
            Output.WriteLine("Initializing BoomBang game environment...");
            ConfigManager.Initialize(Constants.DataFileDirectory + @"\server-main.cfg");
            Output.SetVerbosityLevel((OutputLevel)ConfigManager.GetValue("output.verbositylevel"));
            foreach (string str in args)
            {
                Output.WriteLine("Command line argument: " + str);
                Input.ProcessInput(str.Split(new char[] { ' ' }));
            }
            try
            {
                Output.WriteLine("Initializing MySQL manager...");
                SqlDatabaseManager.Initialize();
                Output.WriteLine("Setting up server listener on port " + ((int)ConfigManager.GetValue("net.bind.port")) + "...");
                boomBangTcpListener_0 = new BoomBangTcpListener(new IPEndPoint(IPAddress.Any, (int)ConfigManager.GetValue("net.bind.port")), (int)ConfigManager.GetValue("net.backlog"), new OnNewConnectionCallback(SessionManager.HandleIncomingConnection));
                using (SqlDatabaseClient client = SqlDatabaseManager.GetClient())
                {
                    Output.WriteLine("Resetting database counters and statistics...");
                    smethod_0(client);
                    Output.WriteLine("Initializing game components and workers...");
                    DataRouter.Initialize();
                    GlobalHandler.Initialize();
                    SessionManager.Initialize();
                    CharacterInfoLoader.Initialize();
                    UserCredentialsAuthenticator.Initialize();
                    RegisterManager.Initialize();
                    Class1.smethod_0();
                    LaptopHandler.Initialize();
                    CatalogManager.Initialize(client);
                    FlowerPowerManager.Initialize();
                    NewsCacheManager.Initialize(client);
                    Navigator.Initialize(client);
                    SpaceManager.Initialize(client);
                    SpaceInfoLoader.Initialize();
                    SpaceHandler.Initialize();
                    GameHandler.Initialize();
                    CrossdomainPolicy.Initialize(@"Data\crossdomain.xml");
                    WordFilterManager.Initialize(client);
                    AdvertisementManager.Initialize();
                    ContestHandler.Initialize();
                    SilverCoinsWorker.Initialize();
                    ModerationBanManager.Initialize(client);
                }
            }
            catch (Exception exception)
            {
                HandleFatalError("Could not initialize BoomBang game environment: " + exception.Message + "\nStack trace: " + exception.StackTrace);
                return;
            }
            TimeSpan span = (TimeSpan)(DateTime.Now - now);

            Output.WriteLine("The server has initialized successfully (" + Math.Round(span.TotalSeconds, 2) + " seconds). Ready for connections.", OutputLevel.Notification);
            Output.WriteLine("Pulsa ENTER e introduce un comando. Ten una guía de comandos escribiendo HELP", OutputLevel.Notification);
            Console.Beep();
        }
 public RadioConfiguration(Radio radio)
 {
     _radio        = radio;
     _payloadWidth = Constants.MaxPayloadWidth;
     Registers     = new RegisterManager(_radio);
     Registers.LoadRegisters();
 }
示例#10
0
        protected override bool SetValid()
        {
            bool      flag    = RegisterManager.CheckRegFile("DKST");
            FpManager manager = new FpManager();

            return((((int)TaxCardFactory.CreateTaxCard().TaxMode == 2) && manager.IsSWDK()) & flag);
        }
        public void ForgetPassword(RegisterModel registerModel)
        {
            string          email           = registerModel.email;
            RegisterManager registerManager = new RegisterManager();

            registerManager.ForgetPassword(email);
        }
        private void ConfigureServices(ServiceProvider serviceProvider)
        {
            InitClientServices();

            ConfigureEventBus(serviceProvider);

            RegisterManager.ConfigureAuxServices(serviceProvider);
        }
示例#13
0
 private void method_1()
 {
     try
     {
         RegFileSetupResult result = RegisterManager.SetupRegFile(this.taxCard_0);
         if ((result != null) && ((result.NormalRegFiles.Count + result.OutOfDateRegFiles.Count) >= 1))
         {
             DateTime cardClock = this.taxCard_0.GetCardClock();
             DateTime time2     = new DateTime(cardClock.Year, cardClock.Month, cardClock.Day);
             foreach (RegFileInfo info in result.NormalRegFiles)
             {
                 string s = "";
                 foreach (char ch in info.FileContent.StopDate)
                 {
                     s = s + ch;
                 }
                 DateTime time3 = DateTime.ParseExact(s, "yyyyMMdd", null);
                 if (this.bool_1 && (time3 < time2))
                 {
                     this.list_1.Add(this.method_4(info.VerFlag));
                 }
                 else if (this.bool_0 && (time2.AddDays((double)this.int_0) >= time3))
                 {
                     Dictionary <string, string> item = new Dictionary <string, string>();
                     item.Add("MC", this.method_4(info.VerFlag));
                     TimeSpan span = (TimeSpan)(time3 - time2);
                     item.Add("DAYS", span.Days.ToString());
                     this.list_0.Add(item);
                 }
             }
             foreach (RegFileInfo info2 in result.OutOfDateRegFiles)
             {
                 string str2 = "";
                 foreach (char ch2 in info2.FileContent.StopDate)
                 {
                     str2 = str2 + ch2;
                 }
                 DateTime time5 = DateTime.ParseExact(str2, "yyyyMMdd", null);
                 if (this.bool_1 && (time5 < time2))
                 {
                     this.list_1.Add(this.method_4(info2.VerFlag));
                 }
                 else if (this.bool_0 && (DateTime.Now.AddDays((double)this.int_0) >= time5))
                 {
                     Dictionary <string, string> dictionary2 = new Dictionary <string, string>();
                     dictionary2.Add("MC", this.method_4(info2.VerFlag));
                     TimeSpan span2 = (TimeSpan)(time5 - time2);
                     dictionary2.Add("DAYS", span2.Days.ToString());
                     this.list_0.Add(dictionary2);
                 }
             }
         }
     }
     catch (Exception exception)
     {
         this.ilog_0.Error("classifyRegFile异常:" + exception.ToString());
     }
 }
示例#14
0
 private bool CheckData()
 {
     if (!RegisterManager.CheckRegFile("JS"))
     {
         MessageManager.ShowMsgBox("INP-111001", "提示", new string[] { "注册文件校验失败!" });
         return(false);
     }
     return(true);
 }
 public static string loadProfileDetails()
 {
     string data = "";
     JavaScriptSerializer jss = new JavaScriptSerializer();
     Guid UserID = new Guid(HttpContext.Current.Session["UserID"].ToString());
     RegistrationModel.GetRegisterDetails objRegisterModel = RegisterManager.GetProfileDetailsByUserID(UserID);
     data = jss.Serialize(objRegisterModel);
     return data;
 }
示例#16
0
 private void RegisterPlayerServices()
 {
     Container.Register <HumanPlayer>(new PerContainerLifetime());
     Container.Register <IBotPlayer, BotPlayer>(new PerContainerLifetime());
     Container.Register <IHumanActorTaskSource, HumanActorTaskSource>(new PerContainerLifetime());
     Container.Register <MonsterBotActorTaskSource>(new PerContainerLifetime());
     RegisterManager.RegisterBot(Container);
     RegisterManager.ConfigureAuxServices(Container);
 }
示例#17
0
        public void FindLargestValueEver_WithTestFile_Returns1()
        {
            string filename = @"Input\testb.txt";

            int expected = 10;

            int actual = RegisterManager.FindLargestValueEver(filename);

            Assert.AreEqual(expected, actual);
        }
示例#18
0
        public AccountsController(RegisterManager manager, AccountManager accountManager)
        {
            _manager        = manager;
            _accountManager = accountManager;

            _serializerSettings = new JsonSerializerSettings
            {
                Formatting = Formatting.Indented
            };
        }
        public AccountAppService(
            IAbpSession abpSession,
            LoginManager loginManager,
            RegisterManager userManager)
        {
            _AbpSession = abpSession;

            _LoginManager = loginManager;

            _UserManager = userManager;
        }
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(this);
 }
示例#21
0
        private void buttonDeposit_Click(object sender, RoutedEventArgs e)
        {
            RegisterContextMenu.IsOpen = false;
            double?amount = PosDialogWindow.PromptCurrency(Types.Strings.RegisterMenuDepositAmount, null);

            if (amount.HasValue && (amount.Value > 0))
            {
                RegisterDeposit.Add(RegisterManager.ActiveRegisterDrawer.Id,
                                    SessionManager.ActiveEmployee.Id, amount.Value);
                RegisterManager.ActiveRegisterDrawer.AddToCurrentAmount(amount.Value);
                RegisterManager.OpenCashDrawer();
            }
        }
示例#22
0
        public override string ToString()
        {
            if (_geomPoints.Count == 1)
            {
                return
                    ($"{RegisterManager.L("SelectedPointCoords")}: ({_geomPoints[0].Point.X:0.##}, {_geomPoints[0].Point.Y:0.##}, {_geomPoints[0].Point.Z:0.##})");
            }
            var d = GetArea();

            return(!double.IsNaN(d)
                ? $"{RegisterManager.L("Length")}: {GetLenght():0.##} {RegisterManager.L("Meter")}, {RegisterManager.L("Area")}: {d:0.##} {RegisterManager.L("SquareMeter")}"
                : $"{RegisterManager.L("Length")}: {GetLenght():0.##} {RegisterManager.L("Meter")}");
        }
        public void Begin()
        {
            RegisterManager registers = Configuration.Registers;

            ChipEnable(false);

            // Set 1500uS (minimum for 32B payload in ESB@250KBPS) timeouts, to make testing a little easier
            // WARNING: If this is ever lowered, either 250KBS mode with AA is broken or maximum packet
            // sizes must never be used. See documentation for a more complete explanation.
            Configuration.AutoRetransmitDelay = AutoRetransmitDelays.Delay4000uS;
            Configuration.AutoRetransmitCount = 15;

            // Disable auto acknowledgement
            EnableAutoAcknowledgementRegister autoAckRegister = registers.EnableAutoAcknowledgementRegister;

            autoAckRegister.EN_AA = false;
            autoAckRegister.Save();

            // Attempt to set DataRate to 250Kbps to determine if this is a plus model
            Configuration.DataRate    = DataRates.DataRate250Kbps;
            Configuration.IsPlusModel = Configuration.DataRate == DataRates.DataRate250Kbps;

            // Restore our default PA level
            Configuration.PowerLevel = PowerLevels.Max;

            // Initialize CRC and request 2-byte (16bit) CRC
            Configuration.CrcEncodingScheme = CrcEncodingSchemes.DualBytes;
            Configuration.CrcEnabled        = true;

            // Disable dynamic payload lengths
            Configuration.DynamicPayloadLengthEnabled = false;

            // Set up default configuration.  Callers can always change it later.
            // This channel should be universally safe and not bleed over into adjacent spectrum.
            Configuration.Channel = 76;

            // Then set the data rate to the slowest (and most reliable) speed supported by all hardware.
            Configuration.DataRate = DataRates.DataRate1Mbps;

            // Reset current status
            // Notice reset and flush is the last thing we do
            StatusRegister statusRegister = registers.StatusRegister;

            statusRegister.RX_DR  = false;
            statusRegister.TX_DS  = false;
            statusRegister.MAX_RT = false;
            statusRegister.Save();

            TransmitPipe.FlushBuffer();
            ReceivePipes.FlushBuffer();
        }
示例#24
0
        /// <summary>
        /// Creates an instance of the file interpreter.
        /// </summary>
        /// <param name="terminal">The terminal implementation that will be used for I/O.</param>
        public ExecutionContext(IRuntimeEnvironment environment,
                                ITerminal terminal,
                                IDataSegmentAccessor dataSegment,
                                RegisterManager regMgr,
                                TextSegmentAccessor textSegment)
        {
            m_Environment    = environment;
            m_Terminal       = terminal;
            m_InterpreterFac = new InterpreterFactory(environment, terminal);

            m_Ctx = new RuntimeContext(environment, dataSegment, regMgr);

            m_TextSegment = textSegment;
        }
        public MockedRegisterManager()
        {
            var spiDevice   = new MockSpiDevice();
            var mockSpiComm = new MockSpiComm(spiDevice);

            RegisterManager = new RegisterManager(mockSpiComm);

            spiDevice.WriteAction = buffer =>
            {
                bool isWriting = (buffer[0] & 0x80) == 0x80;
                byte address   = (byte)(buffer[0] & 0x7F);
                if (isWriting)
                {
                    if (buffer.Length != 2)
                    {
                        Assert.Fail($"Expecting 2 bytes when writing register, got {buffer.Length}.");
                    }

                    _registerValues[address] = buffer[1];
                }
                else
                {
                    if (buffer.Length != 1)
                    {
                        Assert.Fail($"Expecting 1 byte when reading register, got {buffer.Length}.");
                    }

                    byte value;
                    if (!_registerValues.TryGetValue(address, out value))
                    {
                        Assert.Fail($"Failed to read uninitialized register byte at address 0x{address:X2}.");
                    }

                    _spiOutBuffer = value;
                }
            };

            spiDevice.ReadAction = buffer =>
            {
                if (_spiOutBuffer == null)
                {
                    Assert.Fail("SPI reading not initialized.");
                }
                else
                {
                    buffer[0]     = _spiOutBuffer.Value;
                    _spiOutBuffer = null;
                }
            };
        }
示例#26
0
 private void buttonFloat_Click(object sender, RoutedEventArgs e)
 {
     RegisterContextMenu.IsOpen = false;
     if (PosDialogWindow.ShowDialog(
             Types.Strings.RegisterMenuConfirmFloat,
             Types.Strings.Confirmation, DialogButtons.YesNo) == DialogButton.Yes)
     {
         RegisterManager.OpenCashDrawer();
         RegisterManager.FloatActiveRegisterDrawer();
         OrderEntryCommands.SetupNoOrderCommands();
         PosDialogWindow.ShowDialog(
             Types.Strings.RegisterMenuNotifyFloat, Types.Strings.Notification);
     }
     OrderEntryCommands.UpdateTicketDetailCommands();
 }
示例#27
0
        private void SetupNewRegFiles(List <string> regFiles)
        {
            RegFileSetupResult    fileSetup       = RegisterManager.SetupRegFile(regFiles, base.TaxCardInstance);
            List <RegFileWrapper> regFileWrappers = this.GetRegFileWrappers(fileSetup);

            this.tvRegVersion.BeginUpdate();
            foreach (RegFileWrapper wrapper in regFileWrappers)
            {
                this.AddRegFileNode(wrapper);
            }
            this.tvRegVersion.EndUpdate();
            this.tvRegVersion.ExpandAll();
            this.TipSetupResult(fileSetup);
            UpdateVersionInfo(fileSetup);
        }
示例#28
0
 private void Register()
 {
     result = RegisterManager.IsValidSerial(Serial);
     if (result)
     {
         Settings settings = _service.Get();
         settings.Serial = Serial;
         _service.Update(settings);
         _navigationContext.NavigationService.Journal.GoBack();
     }
     else
     {
         Color = "E";
     }
 }
示例#29
0
文件: VM.cs 项目: 20chan/X86Sharp
 public VM()
 {
     Registers             = new RegisterManager(this);
     Segments              = new SegmentManager(this);
     Eflags                = new EflagsManager(this);
     Instructions          = new InstructionManager(this);
     Memory                = new MemoryManager(this);
     _instructionsFromType = new Dictionary <InstructionType, Delegate>();
     _instructions0args    = new Dictionary <uint, InstructionCallback0args>();
     _instructions1arg     = new Dictionary <uint, InstructionCallback1arg>();
     _instructions2args    = new Dictionary <uint, InstructionCallback2args>();
     _instructions3args    = new Dictionary <uint, InstructionCallback3args>();
     Reset();
     LoadInstructions();
 }
示例#30
0
        public ActionResult Register(string username, string password, string Email)
        {
            RegisterManager r = new RegisterManager();

            if (r.CheckUsername(username) == false && r.CheckPassword(username, password) == true)
            {
                using SqlConnection conn = new SqlConnection(ConfigClass.connectionString);
                using SqlCommand query   = new SqlCommand($"insert into [dbo].[user] (id, username, password, email) values ('{r.GetId()}', '{username}', '{password}', '{Email}')", conn);
                conn.Open();

                query.ExecuteNonQuery();
                conn.Close();
            }
            return(RedirectToAction("Index", "Home"));
        }