protected override void FillRequiredFields(Partner2Group obj) { base.FillRequiredFields(obj); var pg = _partnerGroupTest.CreateNew(); var p = _partnerTest.CreateNew(); obj.AsDynamic().PARTNER2GROUPID = TestDecimal; obj.AsDynamic().PARTNER2GROUPPARTNERGROUPID = pg.GetKey(); obj.AsDynamic().PARTNER2GROUPPARTNERID = p.GetKey(); }
protected override void FillRequiredFields(SKU2Partner obj) { base.FillRequiredFields(obj); var p = _partnerTest.CreateNew(); var s = _skuTest.CreateNew(); obj.AsDynamic().SKU2PARTNERID = TestDecimal; obj.AsDynamic().SKU2PARTNERSKUID = s.GetKey(); obj.AsDynamic().SKU2PARTNERPARTNERID = p.GetKey(); obj.AsDynamic().SKU2PARTNERARTNAME = TestString; obj.AsDynamic().SKU2PARTNERARTDESC = TestString; }
protected override void FillRequiredFields(BPBatchSelect obj) { base.FillRequiredFields(obj); var b = _bpBatchTest.CreateNew(); var p = _partnerTest.CreateNew(); obj.AsDynamic().BATCHSELECTID = TestDecimal; obj.AsDynamic().BATCHCODE_R = b.GetKey(); obj.AsDynamic().PRIORITY = TestDouble; obj.AsDynamic().PARTNERID_R = p.GetKey(); obj.AsDynamic().BATCHSELECTSKUCRITBATCH = TestString; }
protected override void FillRequiredFields(EventHeader obj) { base.FillRequiredFields(obj); var partner = _partnerTest.CreateNew(); var billOperation = _billOperationTest.CreateNew(); var eventKind = _eventKindTest.CreateNew(); obj.AsDynamic().EVENTHEADERID = TestDecimal; obj.AsDynamic().PARTNERID_R = partner.GetKey(); obj.AsDynamic().OPERATIONCODE_R = billOperation.GetKey(); obj.AsDynamic().EVENTKINDCODE_R = eventKind.GetKey(); obj.AsDynamic().PROCESSCODE_R = "TEGetInfo"; obj.AsDynamic().EVENTHEADERINSTANCE = TestString; obj.AsDynamic().EVENTHEADERSTARTTIME = DateTime.Now; }
protected override void FillRequiredFields(Employee obj) { base.FillRequiredFields(obj); var partner = _partnerTest.CreateNew(); obj.AsDynamic().EMPLOYEEID = TestDecimal; obj.AsDynamic().PARTNERID_R = partner.GetKey(); obj.AsDynamic().EMPLOYEELASTNAME = TestString; obj.AsDynamic().EMPLOYEENAME = TestString; obj.AsDynamic().EMPLOYEEMIDDLENAME = TestString; obj.AsDynamic().EMPLOYEEMOBILE = TestString; obj.AsDynamic().EMPLOYEEPHONEWORK = TestString; obj.AsDynamic().EMPLOYEEPHONEINTERNAL = TestString; obj.AsDynamic().EMPLOYEEEMAIL = TestString; obj.AsDynamic().EMPLOYEEOFFICIALCAPACITY = TestString; }
public void DeleteByParentPartner() { // создаём мэнэджеры, тесты и сущности var _gpvMgr = CreateManager(); var _gpv = CreateNew(); var _gpvKey = _gpv.GetKey(); var _parentTest = new PartnerTest(); var _parentMgr = CreateManager <Partner>(); var _parent = _parentTest.CreateNew(); var _parentKey = _parent.GetKey(); try { // привязываем GPV к сущности _gpv.AsDynamic().GPARAMVAL2ENTITY = "PARTNER"; _gpv.AsDynamic().GPARAMVALKEY = _parent.GetKey(); // проверяем что правильно привязали _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(); } }