Ejemplo n.º 1
0
        private void HistoryManagerFrm_Load(object sender, EventArgs e)
        {
            // эта форма должна показывать все операции по этому объекту и давать делать Undo последней операции
            // TODO ведь удаление отмена этих изменений влияет на остальные объекты и как именно

            if (startMsg == null)
            {
                return;
            }

            //берем объект, который отвечает за хранение истории по типу объектов
            HistorySaver hs = HistorySaver.getInstance(RIFDC_App.mainDataRoom);

            IKeeper HistoryManagerDataSource = hs.getMyHistoryIKeeperObject(startMsg.targetObject);

            HistoryManagerDFC = new DataFormComponent(HistoryManagerDataSource, this, Lib.FrmCrudModeEnum.GridAndFieldsOnTheFly);

            //грид
            //инициализация грида
            RIFDC_DataGridView grd0 = new RIFDC_DataGridView(dgObjectHistory, HistoryManagerDataSource,
                                                             HistorySaver.HistorySaverUnit.MyControlFormats.HistorySaverUnitControlFormat.getMyInstance(HistoryManagerDataSource.sampleObject));

            //маппинг грида
            HistoryManagerDFC.crudOperator.addGridBasedControlMapping(grd0);

            HistoryManagerDFC.fillTheForm();
        }
Ejemplo n.º 2
0
        public RIFDC_DataGridView(
            Control c,
            IKeeper _dataSource,
            Lib.IControlFormat myFormat = null,
            DataGridEditabilityMode _editabilityMode = DataGridEditabilityMode.NotEditableAtAll) : base(c, _dataSource)
        {
            dgr = (DataGridView)targetControl;

            if (myFormat != null)
            {
                foreach (Lib.IControlFormatLine line in myFormat.lines)
                {
                    addDataColumn(line.fieldClassName, line.colWidth, line.caption);
                }
            }
            editabilityMode = _editabilityMode;

            //форматирование грида

            dgr.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            // dgr.MultiSelect = false;
            // dgr.AllowUserToAddRows = false;
            // dgr.AllowUserToResizeRows = false;
            // dgr.AllowUserToDeleteRows = false;
            // dgr.RowHeadersVisible = false;
        }
Ejemplo n.º 3
0
 public PerformanceCore(INewKeeper newKeeper, IKeeper keeper, ICalculator calculator,
                        IBindedItemsCore bindedItemsCore)
 {
     _newKeeper       = newKeeper;
     _keeper          = keeper;
     _calculator      = calculator;
     _bindedItemsCore = bindedItemsCore;
 }
Ejemplo n.º 4
0
 public DirectiveCore(INewKeeper newKeeper, INewLoader newLoader, IKeeper keeper,
                      ILoader loader, IItemsRelationsDataAccess itemsRelationsDataAccess)
 {
     _newKeeper = newKeeper;
     _newLoader = newLoader;
     _keeper    = keeper;
     _loader    = loader;
     _itemsRelationsDataAccess = itemsRelationsDataAccess;
 }
Ejemplo n.º 5
0
 static void FilterAndKeep(List <Pawn> listPawn, IKeeper <Pawn> bag)
 {
     foreach (var pawn in listPawn)
     {
         if (pawn.GetNewField() > 5)
         {
             bag.Keep(pawn);
         }
     }
 }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        public Engine(IKeeper keeper, IHarvester harvester, ASafeLog log)
        {
            Log = log.Safe();
            Now = DateTime.UtcNow;

            Keeper    = keeper;
            Harvester = harvester;

            if (Keeper == null)
            {
                throw new NoConnectionEngineAlert(Log);
            }

            if (Harvester == null)
            {
                throw new NoHarvesterEngineAlert(Log);
            }
        }         // constructor
Ejemplo n.º 8
0
        private void doSelectWorkingField()
        {
            //tbValue.Text = "";

            //Delegate[] delegAry = tbValue.TextChanged.GetInvocationList();

            keeper  = RIFDC_App.iKeeperSampleHolder.getIKeeperByEntityType(startMsg.targetKeeper.sampleObject.entityName);
            dfc     = new DataFormComponent(keeper, this, Lib.FrmCrudModeEnum.GridAndFieldsOnTheFly);
            dfc.tag = "сардина-1";
            RemoveEventHandlerOfType("TextChanged", tbValue);
            RemoveEventHandlerOfType("Leave", tbValue);

            dfc.addRecordBasedControlMapping(new RIFDC_TextBox(tbValue), fn.toStringNullConvertion(cbxSetValueParameter.SelectedValue));

            keeper.clear();
            keeper.createNewObject_inserted();
            dfc.fillTheForm();
            //keeper.currentRecord.index = 0;
        }
Ejemplo n.º 9
0
        public DownloadAndSaveAction(
            IHarvester harvester,
            IKeeper keeper,
            int customerID,
            decimal explicitMonthlyPayment,
            bool isTryOut,
            DateTime now,
            ASafeLog log
            ) : base(3, 5000, log)
        {
            this.now                    = now;
            this.harvester              = harvester;
            this.keeper                 = keeper;
            this.customerID             = customerID;
            this.explicitMonthlyPayment = explicitMonthlyPayment;
            this.isTryOut               = isTryOut;

            Result = null;
        }         // constructor
Ejemplo n.º 10
0
        public static void Main()
        {
            var largeAnimals = new ILargeAnimal[]
            {
                new Lion(new DateTime(2010, 4, 28)),
                new Lion(new DateTime(2012, 5, 11)),
                new Zebra(new DateTime(2008, 12, 1))
            };
            var smallAnimals = new ISmallAnimal[] {
                new Rabbit(new DateTime(2014, 1, 1)),
                new GuineaFowl(new DateTime(2015, 1, 2))
            };
            var animals = largeAnimals.Union <IAnimal>(smallAnimals).ToList();

            var largeAnimalKeeper = new Keeper <ILargeAnimal>(largeAnimals);
            var smallAnimalKeeper = new Keeper <ISmallAnimal>(smallAnimals);

            var keepers = new IKeeper[]
            {
                largeAnimalKeeper,
                smallAnimalKeeper
            };

            var babyRabbit = new Rabbit(DateTime.Today);

            smallAnimalKeeper.StartLookingAfter(babyRabbit);

            var feedingScheduler  = FeedingScheduler.Instance;
            var groomingScheduler = GroomingScheduler.Instance;

            var timer = new ZooTimer();

            new Thread(timer.Run).Start();

            timer.Tick += () => feedingScheduler.AssignFeedingJobs(keepers, animals);
            timer.Tick += () => groomingScheduler.AssignGroomingJobs(keepers, animals);
            timer.Tick += () => animals.ForEach(Console.WriteLine);
        }
Ejemplo n.º 11
0
        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));
        }
Ejemplo n.º 12
0
        List <long> timeArr = new List <long>(); //время обработки каждого файла

        public ExcelStaticFilesBatchProcessor(IKeeper _myKeeper, System.Windows.Forms.ProgressBar _myProgressBar, System.Windows.Forms.Label _myStatusLabel)
        {
            myKeeper      = _myKeeper;
            myProgressBar = _myProgressBar;
            myStatusLabel = _myStatusLabel;
        }
Ejemplo n.º 13
0
 public void registerIKeeper(IKeeper keeper)
 {
     iKeepers.Add(keeper);
 }
Ejemplo n.º 14
0
 public RIFDC_ComboBox(Control c, IKeeper _dataSource, bool _allowNull = false) : base(c)
 {
     data      = new RowContainingDataObject(_dataSource);
     allowNull = _allowNull;
 }
Ejemplo n.º 15
0
 public static void ActualizeBlobKeeper(IKeeper <Blob, double, double, AForge.Point> blobKeeper, IEnumerable <Blob> blobs) => blobKeeper.ActualizeData(blobs);
Ejemplo n.º 16
0
 public RowContainingDataObject(IKeeper _dataSource)
 {
     dataSource = _dataSource;
 }
Ejemplo n.º 17
0
 public MappedGridBasedControl(Control c, IKeeper _dataSource) : base(c)
 {
     data = new RowContainingDataObject(_dataSource);
 }
Ejemplo n.º 18
0
 public NonRoutineJobDataAccess(ILoader loader, IKeeper keeper)
 {
     _loader = loader;
     _keeper = keeper;
 }
Ejemplo n.º 19
0
 public List <IUniversalRowDataContainer> makeGroupQuery(IKeeper keeper, Lib.GroupQueryTypeEnum groupQueryType, Relations.Relation targetRelation, string targetField)
 {
     return(null);
 }
Ejemplo n.º 20
0
 public static void RefreshBlobKeeper(IKeeper <Blob, double, double, AForge.Point> blobKeeper, IEnumerable <Blob> blobs) => blobKeeper.Refresh(blobs);
Ejemplo n.º 21
0
 public List <IUniversalRowDataContainer> makeGroupQuery(IKeeper keeper, Lib.GroupQueryTypeEnum groupQueryType, Relations.Relation targetRelation, string targetField)
 {
     return(actualCluster.makeGroupQuery(keeper, groupQueryType, targetRelation, targetField));
 }