public static void init() { cls_mysql.connectionData.server = "37.140.192.97"; //cls_mysql.connectionData.port = "3306"; cls_mysql.connectionData.dbName = "u1325524_rifdcdemo"; cls_mysql.connectionData.dbUser = "******"; cls_mysql.connectionData.dbPassword = "******"; RIFDC_App.mainDataRoom = mainDataRoom; RIFDC_App.currentUserId = "user01"; #region localCnn /* * cls_mysql.connectionData.server = "127.0.0.1"; * //cls_mysql.connectionData.port = "3306"; * cls_mysql.connectionData.dbName = "coffeepoints2"; * cls_mysql.connectionData.dbUser = "******"; * cls_mysql.connectionData.dbPassword = ""; */ #endregion mainDataRoom.actualCluster = cls_mysql; Lib.DbOperationResult or = mainDataRoom.connect(); if (!or.success) { fn.mb_info("Ошибка подключения, программа остановлена"); return; } //сохраняем Ikeeper этого типа, поскольку тут дженерики ItemKeeper<Class> в рантайме не создашь RIFDC_App.iKeeperSampleHolder.registerIKeeper(ItemKeeper <CoffeePoint> .getInstance()); MainAppFrm frm = new MainAppFrm(); frm.WindowState = FormWindowState.Maximized; frm.ShowDialog(); mainDataRoom.disconnect(); }
public Lib.DbOperationResult connect() { Lib.DbOperationResult cr = new Lib.DbOperationResult(); bool success = false; try { Lib.CommonOperationResult _tmp = myFile.open(); cr.msg = _tmp.msg; success = _tmp.success; } catch (Exception e) { success = false; cr.msg = e.Message; } cr.success = success; return(cr); }