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 void run() { Stopwatch stopwatch = new Stopwatch(); dataRoom01 = myKeeper.dataRoom; bool useSameExcel; bool closeAppAfterUse; int count = 0; double _progress; foreach (BatchProcessorUnit bu in items) { stopwatch.Start(); useSameExcel = (count != 0); //первый открывает инстанс экселя, остальные его используют, последний закрывает closeAppAfterUse = (count == items.Count - 1); myDataCluster = new ExcelStaticFileCluster(@"" + bu.path, @"" + bu.wbName, @"" + bu.wsName, bu.startAddRess, bu.endAddRess, bu.drrShift, useSameExcel, closeAppAfterUse); dataRoom01.actualCluster = myDataCluster; dataRoom01.connect(); if (dataRoom01.isConnected) { myKeeper.readItems(true); dataRoom01.disconnect(); } stopwatch.Stop(); timeArr.Add(stopwatch.ElapsedMilliseconds); stopwatch.Reset(); count += 1; status = string.Format("Processed files {0} of {1}", count, items.Count); _progress = (100 / items.Count) * count; //progress = Math.Round(_progress, ); progress = Convert.ToInt32(_progress); } status = fn.list2str(timeArr.Cast <Object>().ToList()); }