Ejemplo n.º 1
0
        static void CreateBaseConfig()
        {
            logger.Info("Настройка параметров базы...");

            // Настройка ORM
            var db = FluentNHibernate.Cfg.Db.MySQLConfiguration.Standard
                     .ConnectionString(QSMain.ConnectionString)
                     .ShowSql()
                     .FormatSql();

            OrmConfig.ConfigureOrm(db, new System.Reflection.Assembly[] {
                System.Reflection.Assembly.GetAssembly(typeof(MainClass)),
                System.Reflection.Assembly.GetAssembly(typeof(UserBase)),
            });

            OrmMain.AddObjectDescription <CarBrand>().DefaultTableView().SearchColumn("Наименование", i => i.Name).OrderAsc(i => i.Name).End();
            OrmMain.AddObjectDescription <CarModel>().Dialog <CarModelDlg>();
            OrmMain.AddObjectDescription <StoreItem>().Dialog <StoreItemDlg>();

            JournalsColumnsConfigs.RegisterColumns();
        }
Ejemplo n.º 2
0
        static void CreateBaseConfig()
        {
            logger.Info("Настройка параметров базы...");

            // Настройка ORM
            var db = FluentNHibernate.Cfg.Db.MySQLConfiguration.Standard
                     .Dialect <MySQL57ExtendedDialect>()
                     .ConnectionString(QSProjectsLib.QSMain.ConnectionString)
                     .AdoNetBatchSize(100)
                     .ShowSql()
                     .FormatSql();

            OrmConfig.ConfigureOrm(db, new System.Reflection.Assembly[] {
                System.Reflection.Assembly.GetAssembly(typeof(MainClass)),
                System.Reflection.Assembly.GetAssembly(typeof(MeasurementUnits)),
                System.Reflection.Assembly.GetAssembly(typeof(UserBase)),
                System.Reflection.Assembly.GetAssembly(typeof(HistoryMain)),
            });

                        #if DEBUG
            NLog.LogManager.Configuration.RemoveRuleByName("HideNhibernate");
                        #endif

            //Настраиваем классы сущностей
            OrmMain.AddObjectDescription(MeasurementUnitsOrmMapping.GetOrmMapping());
            //Спецодежда
            OrmMain.AddObjectDescription <RegulationDoc>().Dialog <RegulationDocDlg>().DefaultTableView().SearchColumn("Документ", i => i.Title).OrderAsc(i => i.Name).End();
            //Общее
            OrmMain.AddObjectDescription <UserBase>().DefaultTableView().Column("Имя", e => e.Name).End();
            OrmMain.AddObjectDescription <UserSettings>();
            //Склад
            OrmMain.AddObjectDescription <Income>().Dialog <Dialogs.Stock.IncomeDocDlg>();

            NotifyConfiguration.Enable();
            BuisnessLogicGlobalEventHandler.Init(new GtkQuestionDialogsInteractive());
            JournalsColumnsConfigs.RegisterColumns();
        }
Ejemplo n.º 3
0
 static void ConfigureJournalColumnsConfigs()
 {
     JournalsColumnsConfigs.RegisterColumns();
 }