static void Main(string[] args) { Console.WriteLine("Amme, Mookambike"); Console.WriteLine("Om Mookambikayaye Namaha"); DbSetup.SetUp(); }
static void Main(string[] args) { var logger = new Log4NetLogger(typeof(Program)); DbSetup.Run("FileWatcher"); var host = HostFactory.New(x => { x.BeforeInstall(() => { DbSetup.Run("FileWatcher"); }); x.Service <FileWatcherService>(nq => { nq.ConstructUsing(name => new FileWatcherService()); nq.WhenStarted((tc, hostControl) => tc.Start()); nq.WhenStopped((tc, hostControl) => tc.Stop()); }); x.RunAsNetworkService(); x.SetDescription("File Watching Service monitors a directory and add files that require processing to the queue"); x.SetDisplayName("File Watching Service"); x.SetServiceName("FileWatchingService"); x.StartAutomatically(); x.EnableServiceRecovery(action => action.RestartService(1)); }); var exitcode = host.Run(); if (exitcode != TopshelfExitCode.Ok) { logger.Error($"Exited with error code {exitcode}"); } }
private void DesktopPanel_Shown(object sender, EventArgs e) { string sPath = Application.StartupPath + "\\config.cfg"; if (!File.Exists(sPath)) { DbSetup frmDb = new DbSetup(); if (frmDb.ShowDialog() != DialogResult.OK) { Application.Exit(); return; } } string sConnectionString = ErpCore.Util.DESEncrypt.DesDecrypt(File.ReadAllText(sPath)); Program.Ctx.ConnectionString = sConnectionString; LoginForm frm = new LoginForm(); if (frm.ShowDialog() != DialogResult.OK) { Application.Exit(); return; } LoadDesktop(); LoadDesktopGroup(); //LoadList(); rdDefault.Checked = true; DesktopGroup_rdButton_Click(rdDefault, null); }
private void SelSystemForm_Load(object sender, EventArgs e) { string sPath = Application.StartupPath + "\\config.cfg"; if (!File.Exists(sPath)) { DbSetup frmDb = new DbSetup(); if (frmDb.ShowDialog() != DialogResult.OK) { Application.Exit(); return; } } string sConnectionString = ErpCore.Util.DESEncrypt.DesDecrypt(File.ReadAllText(sPath)); Program.Ctx.ConnectionString = sConnectionString; LoginForm frm = new LoginForm(); if (frm.ShowDialog() != DialogResult.OK) { Application.Exit(); return; } LoadList(); }
private SetupView ViewModelFromDataModel(DbSetup dbSetup) { return(new SetupView { Id = dbSetup.Id, Name = dbSetup.Name }); }
private DbSetup DataModelFromViewModel(SetupView setupView, DbSetup existingDbModel = null) { DbSetup dbSetup = existingDbModel; if (setupView.Id == 0) { dbSetup = DbSetup.BuildNew(); } dbSetup.Name = setupView.Name; return(dbSetup); }
void Awake() { dataUI = FindObjectOfType <DataUIController>(); if (dataUI != null) { dataUI.HideComponents(); } DbCommands.SetConnectionString("URI=file:" + Application.dataPath + DB_PATH); dbSetup = new DbSetup(); dbSetup.CreateTables(); }
public PostResponse <DbSetup> CreateDB(DbSetup r) { PostResponse <DbSetup> response = new PostResponse <DbSetup>(); SessionHelper.ClearSession(); SessionHelper.Set("AccountId", "0"); //To be checked as it is a strange behavior ( simulated from old code) Dictionary <string, string> headers = SessionHelper.GetAuthorizationHeadersForUser(); var accountRecord = _accountRepository.ChildAddOrUpdate <DbSetup>(r, headers); response = base.CreateServiceResponse <PostResponse <DbSetup> >(accountRecord); if (accountRecord != null) { response.recordId = accountRecord.recordId; } return(response); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { DbSetup.Init(services, Configuration); DatasourceDI.Setup(services); services.AddScoped <BusinessDaysCalculator>(); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_3_0); services.AddControllers(); services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo { Title = "Calculator Api", Version = "v1" }); var filePath = Path.Combine(System.AppContext.BaseDirectory, "PublicHoliday.Calculator.xml"); c.IncludeXmlComments(filePath); }); }
protected void SetupDb() { contextMock = new Mock <ManagemAntsDbContext>(); var database = new DbSetup(); contextMock.Setup(s => s.Set <User>()).Returns(database.UsersSet); contextMock.Setup(s => s.Users).Returns(database.UsersSet); contextMock.Setup(s => s.Set <Project>()).Returns(database.ProjectsSet); contextMock.Setup(s => s.Projects).Returns(database.ProjectsSet); contextMock.Setup(s => s.Set <Task>()).Returns(database.TasksSet); contextMock.Setup(s => s.Tasks).Returns(database.TasksSet); contextMock.Setup(s => s.Set <ProjectsHasUser>()).Returns(database.ProjectHasUsersSet); contextMock.Setup(s => s.ProjectsHasUsers).Returns(database.ProjectHasUsersSet); contextMock.Setup(s => s.Set <UsersHasTask>()).Returns(database.UsersHasTasksSet); contextMock.Setup(s => s.UsersHasTasks).Returns(database.UsersHasTasksSet); _refFixture = new Fixtures(); }
public static void Main(string[] args) { var logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); try { var host = CreateWebHostBuilder(args).Build(); DbSetup.EnsureMigrationAndSeeding(host, logger); host.Run(); } catch (Exception exception) { //NLog: catch setup errors logger.Error(exception, "Stopped program because of exception"); throw; } finally { NLog.LogManager.Shutdown(); } }
public PostResponse <DbSetup> CreateDB(DbSetup r) { PostResponse <DbSetup> response = new PostResponse <DbSetup>(); SessionHelper.ClearSession(); SessionHelper.Set("AccountId", "0"); SessionHelper.Set("UserId", "0"); Dictionary <string, string> headers = SessionHelper.GetAuthorizationHeadersForUser(); var accountRecord = _accountRepository.ChildAddOrUpdate <DbSetup>(r, headers); response = base.CreateServiceResponse <PostResponse <DbSetup> >(accountRecord); SessionHelper.ClearSession(); SessionHelper.Set("AccountId", r.accountId); SessionHelper.Set("UserId", "0"); if (accountRecord != null) { response.recordId = accountRecord.recordId; } return(response); }
private async void OverlayForm_Load(object sender, EventArgs e) { var setting = Settings.Default.PathToDatabase; if (string.IsNullOrEmpty(setting)) { setting = Directory.GetCurrentDirectory() + "/FileOverwatch.db"; Settings.Default.PathToDatabase = setting; Settings.Default.Save(); } var process = Process.Start(Directory.GetCurrentDirectory() + "/DatabaseCreator/DatabaseCreator.exe", setting); process?.WaitForExit(); TvOrganization.Items.Clear(); DbSetup.ChangeDataBasePath(setting); var db = new DataBase(); var organizations = await db.Organizations.Where(d => !d.Deleted).AsNoTracking().ToListAsync(); TvOrganization.ShowGroups = false; TvOrganization.AddObjects(organizations); }
private void btnDbSetup_Click(object sender, RoutedEventArgs e) { DbSetup dbsetup = new DbSetup(); var res = dbsetup.ShowDialog(); }
static PersisterTests() { DbSetup.Setup(); }
static IntegrationTests() { DbSetup.Setup(); }
static InstallerTests() { DbSetup.Setup(); }
static IncomingWhenNotEnabledTests() { DbSetup.Setup(); }
public QuestionServiceTest() { this.dbSetup = new DbSetup(); Mapper.Initialize(config => config.AddProfile <AutoMapperProfile>()); }
public RepositoryController(DbSetup context) { _context = context; }
static OutgoingWhenNotEnabledTests() { DbSetup.Setup(); }
public TechController(DbSetup context) { _context = context; }
/// <summary> /// Creates instance of live database tests. /// </summary> /// <param name="setup">Database setup, <see cref="TestDatabaseSetup"/>.</param> protected LiveDatabaseTests(TDatabaseSetup setup) { DbSetup = setup ?? throw new ArgumentNullException(nameof(setup)); Session = DbSetup.GetSessionFactory().OpenSession(); Session.BeginTransaction(); }
public FixtureInit(string uri) { _simulator = new HttpSimulator().SimulateRequest(new Uri(uri)); _setup = new DbSetup(); }