protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); UpdateDatabase.UpdateDates(); }
public LogHandler() { var logBookEntityModel = new LogBookEntityModel(); UpdateDatabase.Execute(); _writeService = new WriteService(logBookEntityModel); _readService = new ReadService(logBookEntityModel); }
public void TestCleanup() { _updateDatabase = null; _commandResult = null; _updatePackageAccessMock = null; _loggerMock = null; TryDeleteFile(); }
private void UpdateDB(List <RepairCategory> lst) { List <string> newL = new List <string>(); foreach (RepairCategory rc in lst) { newL.Add(rc.status); } UpdateDatabase.UpdateSortedListInDb(_context, _userGuid, newL); }
/// <summary> /// Update the type of tickets that are included. /// This is connected to the dropdown menu. /// </summary> /// <param name="s"></param> public void CollectTicketsToDisplay(string s) { _displayMap[s] = !_displayMap[s]; _includeTickets.Clear(); for (int i = 0; i < _displayMap.Count(); i++) { if (_displayMap.ElementAt(i).Value) { _includeTickets.Add(_displayMap.ElementAt(i).Key); } } UpdateDatabase.UpdateIncludeListInDb(_context, _userId, _includeTickets); }
public Action <IApplicationBuilder> Configure(Action <IApplicationBuilder> next) { Console.WriteLine("Starting DB Upodate"); try { UpdateDatabase.UpdateDatabaseIfRequired(_connectionString); } catch (Exception e) { Console.WriteLine($"Error updating db: {e.Message}"); Console.WriteLine($" Db Error inner exception: {e.InnerException?.Message}"); throw; } Console.WriteLine("DB Upodate complete"); return(next); }
public override void ProcessPerson(string pnr) { BrokerContext.Current = brokerContext; try { CprBroker.Engine.Local.Admin.LogFormattedSuccess("Converting person <{0}> from DPR", pnr); using (var dprDataContext = new DPRDataContext(OtherConnectionString)) { var pId = new PersonIdentifier() { CprNumber = pnr, UUID = UuidCache.GetUuid(pnr) }; var personInfo = PersonInfo.GetPersonInfo(dprDataContext, decimal.Parse(pnr)); var reg = personInfo.ToRegisteringType1(UuidCache.GetUuid, dprDataContext); UpdateDatabase.UpdatePersonRegistration(pId, reg); } } catch (Exception ex) { Admin.LogException(ex); throw ex; } }
public void TestInitialize() { TestCleanup(); _commandResult = new CommandResult(); _updatePackageAccessMock = new UpdatePackageAccessMock(); _updatePackageAccessMock.GetFilenameOnly = "UpdateDatabaseTest.zip"; _updatePackageMock = new UpdatePackageMock(); _updatePackageMock.PackageName = "UpdateDatabaseTest"; _updatePackageMock.Access = _updatePackageAccessMock; _loggerMock = new LoggerMock(); _runExternalCommandMock = new RunExternalCommandMock(); TryDeleteFile(); Directory.CreateDirectory(_updatePackageMock.PackageName); File.Copy(_updateDatabaseCommand, Path.Combine(_updatePackageMock.PackageName, _updateDatabaseCommand)); _updateDatabase = new UpdateDatabase(_updateDatabaseCommand, _updateDatabaseCommandArguments, _connectionString, _workFolder, _updatePackageMock, _runExternalCommandMock, _loggerMock); }
/// <summary> /// Instantiate the maps used to store tickets. /// Maps are sorted by the ticket status. /// </summary> private void InstantiateVars() { if (_results is null) { _results = new List <RepairTicket>(); } _ticketMap = BackParser.BuildTicketMap(_context, _userId, _ticketMap); _displayMap = BackParser.BuildStatusMap(_context, _userId, _displayMap); UserSettings usett = UpdateDatabase.GetCurrentUserSettings(_context, _userId); if (usett is not null) { string statusOrderStr = usett.ticketOrder; _statusOrder = statusOrderStr.Split(", "); _ticketsPerRow = usett.numTicketsPerStatus; } else { _statusOrder = _defaultStatusOrder; } SetStatuses(); }
static void Run(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (!(args.Length == 1 && args[0] == "debug")) { AppDomain.CurrentDomain.UnhandledException += ExceptionHandler; } string setting = "config.cfg"; bool excmode = false; bool setupmode = false; bool dbmode = false; bool trbmode = false; if (args.Length > 0) { if (args[0] == "exception") { excmode = true; } if (args[0] == "setup") { setupmode = true; } if (args[0] == "database") { dbmode = true; } if (args[0] == "troubleshoot") { trbmode = true; } } if (!File.Exists(setting)) { File.WriteAllText("doSetup", "true"); setupmode = true; File.WriteAllText(setting, @"# General Settings Title=Rotux Private Server Working Folder=..\..\..\..\.. # Images Background=null Header=null # MySQL Paths MySQL=\xampp\mysql\bin\mysql.exe MySQL Start=\xampp\mysql_start.bat MySQL Stop=\xampp\mysql_stop.bat # MySQL Settings MySQL File=server\bin\Debug\database.sql MySQL Host=127.0.0.1 MySQL Port=3306 MySQL Username=root MySQL Password= # Private Server Paths World Server=server\bin\Debug\wServer.exe Request Server=server\bin\Debug\server.exe # Client Paths Flash Player=client\flashplayer.exe Flash Download=https://fpdownload.macromedia.com/pub/flashplayer/updaters/24/flashplayer_24_sa.exe Client=client\client.swf"); } if (File.Exists("doSetup")) { setupmode = true; } if (excmode) { Application.Run(new ExceptionWindow(Base64Decode(args[1]))); } else { foreach (string s in args) { if (File.Exists(s)) { setting = s; } } if (setupmode) { Application.Run(new RotuxSetup(new Settings(setting))); } else if (dbmode) { var s = new Settings(setting); var x = Process.Start(new ProcessStartInfo() { FileName = s.data["MySQL Start"], CreateNoWindow = true, UseShellExecute = false }); Thread.Sleep(1); UpdateDatabase.LoadSQL(s); Thread.Sleep(1); x.Kill(); x = Process.Start(new ProcessStartInfo() { FileName = s.data["MySQL Stop"], CreateNoWindow = true, UseShellExecute = false }); } else if (trbmode) { Application.Run(new Troubleshoot()); } else { Application.Run(new Forms.MainMenu(new Settings(setting))); } } }
private void changerankbtn_Click(object sender, EventArgs e) { UpdateDatabase.RunQuery(s, string.Format("UPDATE rotmgprod.accounts SET `{2}`={0} WHERE `uuid` = '{1}'", Parse(value.Text), email.Text, key.Text).Split(';')); Close(); }
/// <summary> /// Called when tickets per row dropdown value is changed. /// </summary> /// <param name="i"></param> public void TicketsPerRowChange(int i) { UpdateDatabase.UpdateNumTicketsPerRow(_context, _userId, i); _ticketsPerRow = i; }
/// <summary> /// Called when num card dropdown value is changed. /// </summary> /// <param name="i"></param> public void NumCardsChange(int i) { UpdateDatabase.UpdateNumTickets(_context, _userId, i); _numCards = i; }
void UpdateDb() { UpdateDatabase.LoadSQL(s); }
public void DatabaseCreate() { MySQL.Start(); Thread.Sleep(150); UpdateDatabase.LoadSQL(s); }
public UpdateDatabaseCtr() { passwordHashAndSalt = new PasswordHashAndSalt(); updateDB = new UpdateDatabase(); sendTemperaryPasswordToCompany = new SendTemperaryPasswordToCompany(); }