private void CoffeePointsFrm_Load(object sender, EventArgs e) { ItemKeeper <CoffeePoint> coffeePointsDataSource = ItemKeeper <CoffeePoint> .getInstance(CoffeePointsApp.mainDataRoom); dfc = new DataFormComponent(coffeePointsDataSource, this, Lib.FrmCrudModeEnum.GridAndFieldsOnTheFly); //маппинг контролов //грид RIFDC_DataGridView grd0 = new RIFDC_DataGridView( dgCoffeePoints, coffeePointsDataSource, CoffeePoint.MyControlFormats.ShortCoffeePointGridFormat.getMyInstance(coffeePointsDataSource.sampleObject), DataGridEditabilityMode.NotEditableAtAll); dfc.addGridBasedControlMapping(grd0); //поля dfc.addRecordBasedControlMapping(new RIFDC_TextBox(tbId), "id"); dfc.addRecordBasedControlMapping(new RIFDC_TextBox(tbCoffeePointName), "name"); dfc.addRecordBasedControlMapping(new RIFDC_MaskedTextBox(tbLastVisitDate), "lastVisitDate"); dfc.addRecordBasedControlMapping(new RIFDC_TextBox(tbBigLattePrice), "bigLattePrice"); dfc.addRecordBasedControlMapping(new RIFDC_TextBox(tbComment), "description"); dfc.addRecordBasedControlMapping(new RIFDC_TextBox(tbAlias), "alias"); dfc.addRecordBasedControlMapping(new RIFDC_MaskedTextBox(tbLastVisitDate2), "lastVisitDate2"); dfc.addRecordBasedControlMapping(new RIFDC_TextBox(tbBigLattePrice2), "bigLattePrice2"); dfc.addRecordBasedControlMapping(new RIFDC_TextBox(tbComment2), "description2"); dfc.searchControl = new DFCSearchControl(dfc, Lib.FiltrationTypeEnum.Local, tbSearch, btnSearch, btnCancelSearch); //кнопки dfc.addButtonMapping(new RIFDC_Button(btnAddNewRecord, FormBtnTypeEnum.btnAddNew)); dfc.addButtonMapping(new RIFDC_Button(btnDelete, FormBtnTypeEnum.btnDelete)); dfc.addButtonMapping(new RIFDC_Button(btnSave, FormBtnTypeEnum.btnSelectAll)); dfc.addButtonMapping(new RIFDC_Button(btnPrevious, FormBtnTypeEnum.btnRecordMovePrevRecord)); dfc.addButtonMapping(new RIFDC_Button(btnNext, FormBtnTypeEnum.btnRecordMoveNextRecord)); dfc.addButtonMapping(new RIFDC_Button(btnReload, FormBtnTypeEnum.btnReloadDataFormComponent)); //dfc.addButtonMapping(new RIFDC_Button(btnGroupOperations, FormBtnTypeEnum.btnOpenGroupOperationsForm)); dfc.addButtonMapping(new RIFDC_Button(btnHistory, FormBtnTypeEnum.btnOpenHistoryForm)); dfc.crudOperator.addButtonMapping(new RIFDC_Button(btnToggleSpecLineMultiSelect, FormBtnTypeEnum.btnToggleMultiSelectionMode)); dfc.crudOperator.addButtonMapping(new RIFDC_Button(btnSpecLineSelectAll, FormBtnTypeEnum.btnSelectAll)); dfc.crudOperator.addButtonMapping(new RIFDC_Button(btnSpecLineSelectNone, FormBtnTypeEnum.btnSelectNone)); //запуск dfc.readItems(); dfc.fillTheForm(); }
public IKeeper getMyHistoryIKeeperObject(IKeepable t) { IKeeper myHistoryIKeeperObject = ItemKeeper <HistorySaver.HistorySaverUnit> .getInstance(dataRoom); Lib.Filter myFilter = new Lib.Filter(); myFilter.addNewFilteringRule( myHistoryIKeeperObject.sampleObject.getFieldInfoByFieldClassName("objectId"), Lib.RIFDC_DataCompareOperatorEnum.equal, t.id, Lib.Filter.FilteringRuleTypeEnum.ParentFormFilteringRule); myHistoryIKeeperObject.filtration.applyGlobalFilter(myFilter); myHistoryIKeeperObject.readItems(); return(myHistoryIKeeperObject); }
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.ObjectOperationResult doDeleteHistory(IKeepable t) { // полностью удалить историю по объекту if (t == null) { return(Lib.ObjectOperationResult.sayNo("Object is null")); } if (t.id == "") { return(Lib.ObjectOperationResult.sayNo("Object has no id")); } IKeeper HistoryManagerDataSource = ItemKeeper <HistorySaver.HistorySaverUnit> .getInstance(RIFDC_App.mainDataRoom); Lib.Filter myFilter = new Lib.Filter(); myFilter.addNewFilteringRule( HistoryManagerDataSource.sampleObject.getFieldInfoByFieldClassName("objectId"), Lib.RIFDC_DataCompareOperatorEnum.equal, t.id, Lib.Filter.FilteringRuleTypeEnum.NotSpecified); return(HistoryManagerDataSource.deleteFiteredPackege(myFilter)); }
private HistorySaver(IDataRoom _dataRoom, IKeepable _sampleObject = null) { dataRoom = _dataRoom; items = ItemKeeper <HistorySaverUnit> .getInstance(dataRoom); }