コード例 #1
0
        protected override void FillRequiredFields(BlackList obj)
        {
            base.FillRequiredFields(obj);

            obj.AsDynamic().BLACKLISTID   = TestDecimal;
            obj.AsDynamic().WORKERID_R    = _workerTest.CreateNew().GetKey();
            obj.AsDynamic().BLACKLISTDATE = DateTime.Now;
        }
コード例 #2
0
        protected override void FillRequiredFields(Worker2Group obj)
        {
            base.FillRequiredFields(obj);

            var group  = _workerGroupTest.CreateNew();
            var worker = _workerTest.CreateNew();

            obj.AsDynamic().WORKER2GROUPID            = TestDecimal;
            obj.AsDynamic().WORKER2GROUPWORKERGROUPID = group.GetKey();
            obj.AsDynamic().WORKER2GROUPWORKERID      = worker.GetKey();
        }
コード例 #3
0
        protected override void FillRequiredFields(Worker2Warehouse obj)
        {
            base.FillRequiredFields(obj);

            var group  = _workerGroupTest.CreateNew();
            var worker = _workerTest.CreateNew();
            var house  = _warehouseTest.CreateNew();

            obj.AsDynamic().WORKER2WAREHOUSEID            = TestDecimal;
            obj.AsDynamic().WORKER2WAREHOUSEWORKERGROUPID = group.GetKey();
            obj.AsDynamic().WORKER2WAREHOUSEWAREHOUSECODE = house.GetKey();
            obj.AsDynamic().WORKER2WAREHOUSEFROM          = DateTime.Now;
            obj.AsDynamic().WORKER2WAREHOUSETILL          = DateTime.Now;
        }
コード例 #4
0
ファイル: z_WorkingTest.cs プロジェクト: zaharvsb52/MyWmsPro
        protected override void FillRequiredFields(Working obj)
        {
            base.FillRequiredFields(obj);

            var work   = _workTest.CreateNew();
            var group  = _workerGroupTest.CreateNew();
            var worker = _workerTest.CreateNew();

            obj.AsDynamic().WORKINGID       = TestDecimal;
            obj.AsDynamic().WORKID_R        = work.GetKey();
            obj.AsDynamic().WORKERGROUPID_R = group.GetKey();
            obj.AsDynamic().WORKERID_R      = worker.GetKey();
            obj.AsDynamic().WORKINGFROM     = DateTime.Now;
            obj.AsDynamic().WORKINGMEASURE  = TestString;
            obj.AsDynamic().WORKINGDOC      = TestString;
            obj.AsDynamic().WORKINGERROR    = TestDecimal;
        }
コード例 #5
0
        protected override void FillRequiredFields(GlobalParamValue obj)
        {
            base.FillRequiredFields(obj);

            var gp = _globalParamTest.CreateNew(param =>
            {
                param.AsDynamic().GLOBALPARAMLOCKED   = 0;
                param.AsDynamic().GLOBALPARAMDATATYPE = 6;
                param.AsDynamic().GLOBALPARAMCOUNT    = 1;
                param.AsDynamic().GLOBALPARAM2ENTITY  = WorkerName;
            });

            var w = _workerTest.CreateNew();

            obj.AsDynamic().GPARAMID          = TestDecimal;
            obj.AsDynamic().GPARAMVALKEY      = TestString;
            obj.AsDynamic().GLOBALPARAMCODE_R = gp.GetKey();
            obj.AsDynamic().GPARAMVAL2ENTITY  = w.GetKey();
        }
コード例 #6
0
        public void DeleteByParentWorker()
        {
            // создаём мэнэджеры, тесты и сущности
            var _gpvMgr     = CreateManager();
            var _gpv        = CreateNew();
            var _gpvKey     = _gpv.GetKey();
            var _parentMgr  = CreateManager <Worker>();
            var _parentTest = new WorkerTest();
            var _parent     = _parentTest.CreateNew();
            var _parentKey  = _parent.GetKey();

            try
            {
                // привязываем GPV к сущности
                _gpv.AsDynamic().GPARAMVAL2ENTITY = "WORKER";
                _gpv.AsDynamic().GPARAMVALKEY     = _parentKey;

                // проверяем что правильно привязали
                _gpvMgr.Update(_gpv);
                var _oldGpv = _gpvMgr.Get(_gpvKey);
                _oldGpv.GetKey().Equals(_gpvKey);

                // удаляем родителя, проверяем что правильно удалили
                _parentMgr.Delete(_parent);
                var deleted = _parentMgr.Get(_parentKey);
                deleted.Should().BeNull("Не смогли удалить {0}", typeof(Worker));

                var _newGpv = _gpvMgr.Get(_gpvKey);
                _newGpv.Should().BeNull("Вложеная сущность должна удаляться при удалении основной");
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                ClearForSelf();
                _parentTest.ClearForSelf();
            }
        }
コード例 #7
0
        protected override void FillRequiredFields(BillTransactionW obj)
        {
            base.FillRequiredFields(obj);

            var mgr = IoC.Instance.Resolve <EventHeaderManager>();
            //var evs = (List<EventHeader>) mgr.GetAll();

            var biller          = _billBillerTest.CreateNew();
            var transactionType = _billTransactionTypeTest.CreateNew();
            //var mandant = _mandantTest.CreateNew();
            var worker   = _workerTest.CreateNew();
            var currency = _isoCurrencyTest.CreateNew();

            obj.AsDynamic().TRANSACTIONWID = TestDecimal;
            //obj.AsDynamic().EVENTHEADERID_R = evs[0].GetKey();
            obj.AsDynamic().EVENTHEADERID_R       = TestDecimal;
            obj.AsDynamic().BILLERCODE_R          = biller.GetKey();
            obj.AsDynamic().TRANSACTIONTYPECODE_R = transactionType.GetKey();
            obj.AsDynamic().MANDANTID             = 1;// mandant.GetKey();
            obj.AsDynamic().WORKERID_R            = worker.GetKey();
            obj.AsDynamic().TRANSACTIONWAMMOUNT   = TestDouble;
            obj.AsDynamic().CURRENCYCODE_R        = currency.GetKey();
        }