public async Task <IActionResult> Edit(int id, [Bind("IdLegalForm,FormName,DescripionL")] LegalForm legalForm) { if (id != legalForm.IdLegalForm) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(legalForm); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LegalFormExists(legalForm.IdLegalForm)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(legalForm)); }
public void Init() { clientType = new ClientType("Тестовый тип клиента") { Id = 1 }; serviceProgram = new ClientServiceProgram("Тестовая программа") { Id = 2 }; region = new ClientRegion("Тестовый регион") { Id = 3 }; legal = new LegalForm("ООО", EconomicAgentType.JuridicalPerson) { Id = 5 }; juridicalPerson = new JuridicalPerson(legal) { Id = 6 }; client = new Client("Тестовый клиент", clientType, ClientLoyalty.Customer, serviceProgram, region, 5) { Id = 4 }; clientOrganization = new ClientOrganization("Тестовая организация клиента", "Тестовая организация клиента", juridicalPerson) { Id = 7 }; var employee = new Employee("Иван", "Рюрикович", "Васильевич", new EmployeePost("Царь"), null); user = new User(employee, "И.В. Грозный", "ivanvas", "ivanvas", new Team("Тестовая команда", null), null); }
private async Task <LegalForm> GetFilledLegalForm(LegalForm parsedLegalForm) { LegalForm lf = null; if (!string.IsNullOrEmpty(parsedLegalForm.Name) && !string.IsNullOrEmpty(parsedLegalForm.Code)) { lf = await _ctx.LegalForms.FirstOrDefaultAsync(dsc => !dsc.IsDeleted && (dsc.Name == parsedLegalForm.Name || dsc.NameLanguage1 == parsedLegalForm.Name || dsc.NameLanguage2 == parsedLegalForm.Name) && dsc.Code == parsedLegalForm.Code); } else if (!string.IsNullOrEmpty(parsedLegalForm.Name)) { lf = await _ctx.LegalForms.FirstOrDefaultAsync(dsc => !dsc.IsDeleted && (dsc.Name == parsedLegalForm.Name || dsc.NameLanguage1 == parsedLegalForm.Name || dsc.NameLanguage2 == parsedLegalForm.Name)); } else if (!string.IsNullOrEmpty(parsedLegalForm.Code)) { lf = await _ctx.LegalForms.FirstOrDefaultAsync(dsc => !dsc.IsDeleted && dsc.Code == parsedLegalForm.Code); } if (lf == null) { throw new Exception($"Legal form by `{parsedLegalForm.Name}` name and {parsedLegalForm.Code} code not found"); } return(lf); }
public Estate(int id, Address address, LegalForm legalForm, Category category, BuildingType type) { this.id = id; this.address = address; this.legalForm = legalForm; this.category = category; this.type = type; }
public async Task <ActionResult> DeleteConfirmed(int id) { LegalForm legalForm = await db.LegalForms.FindAsync(id); db.LegalForms.Remove(legalForm); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public void Init() { storage = new Storage("Тестовое место хранения", StorageType.DistributionCenter) { Id = 1 }; writeoffReason = new WriteoffReason("Тестовая причина списания") { Id = 2 }; var juridicalLegalForm = new LegalForm("ООО", EconomicAgentType.JuridicalPerson) { Id = 3 }; var juridicalPerson = new JuridicalPerson(juridicalLegalForm) { Id = 4 }; var juridicalPerson2 = new JuridicalPerson(juridicalLegalForm) { Id = 15 }; accountOrganization = new AccountOrganization("Тестовое юридическое лицо", "Тестовое юридическое лицо", juridicalPerson) { Id = 5 }; var provider = new Provider("Тестовый поставщик", new ProviderType("Тестовый тип поставщика"), ProviderReliability.Medium, 5) { Id = 6 }; var providerOrganization = new ProviderOrganization("Организация поставщика", "Организация поставщика", juridicalPerson2); var articleGroup = new ArticleGroup("Тестовая группа", "Тестовая группа"); var measureUnit = new MeasureUnit("шт.", "Штука", "123", 0) { Id = 1 }; var customDeclarationNumber = new String('0', 25); article = new Article("Тестовый товар А", articleGroup, measureUnit, true); providerContract = new ProviderContract(accountOrganization, providerOrganization, "Договор", "4645", DateTime.Now, DateTime.Now); provider.AddProviderContract(providerContract); user = new User(new Employee("Иван", "Иванов", "Иванович", new EmployeePost("Менеджер"), null), "Иванов Иван", "ivanov", "pa$$w0rd", new Team("Тестовая команда", null), null); receiptWaybill = new ReceiptWaybill("123АБВ", DateTime.Today.AddDays(1), storage, accountOrganization, provider, 1234.5M, 0M, new ValueAddedTax("18%", 18), providerContract, customDeclarationNumber, user, user, DateTime.Now); receiptWaybillRow = new ReceiptWaybillRow(article, 100, 1234.5M, receiptWaybill.PendingValueAddedTax); receiptWaybill.AddRow(receiptWaybillRow); writeoffWaybill = new WriteoffWaybill("123", DateTime.Today, storage, accountOrganization, writeoffReason, user, user, DateTime.Now); priceLists = new List <ArticleAccountingPrice>() { new ArticleAccountingPrice(article, 10M) }; }
public void Init() { numberA = "98"; var legalForm = new LegalForm("ООО", EconomicAgentType.JuridicalPerson); juridicalPersonA = new JuridicalPerson(legalForm); juridicalPersonB = new JuridicalPerson(legalForm); juridicalPersonC = new JuridicalPerson(legalForm); juridicalPersonD = new JuridicalPerson(legalForm); senderOrganizationA = new AccountOrganization("Тестовое юридическое лицо A", "Тестовое юридическое лицо A", juridicalPersonA); senderOrganizationB = new AccountOrganization("Тестовое юридическое лицо B", "Тестовое юридическое лицо B", juridicalPersonB); receiverOrganizationC = new AccountOrganization("Тестовое юридическое лицо C", "Тестовое юридическое лицо C", juridicalPersonC); receiverOrganizationD = new AccountOrganization("Тестовое юридическое лицо D", "Тестовое юридическое лицо D", juridicalPersonD); storageA = new Storage("Тестовое хранилище A", StorageType.DistributionCenter) { Id = 1 }; storageB = new Storage("Тестовое хранилище B", StorageType.TradePoint) { Id = 2 }; articleGroup = new ArticleGroup("Тестовая группа", "Тестовая группа"); measureUnit = new MeasureUnit("шт.", "Штука", "123", 0) { Id = 1 }; articleA = new Article("Тестовый товар A", articleGroup, measureUnit, true); articleB = new Article("Тестовый товар B", articleGroup, measureUnit, true); articleC = new Article("Тестовый товар C", articleGroup, measureUnit, true); valueAddedTax = new ValueAddedTax("18%", 18); receiptWaybillRowA1 = new ReceiptWaybillRow(articleA, 300, 3000, new ValueAddedTax("18%", 18)); receiptWaybillRowA2 = new ReceiptWaybillRow(articleA, 400, 4000, new ValueAddedTax("18%", 18)); receiptWaybillRowB = new ReceiptWaybillRow(articleB, 20, 250, new ValueAddedTax("18%", 18)); receiptWaybillRowC = new ReceiptWaybillRow(articleC, 20, 250, new ValueAddedTax("18%", 18)); rowA1_1 = new MovementWaybillRow(receiptWaybillRowA1, 60, valueAddedTax); rowA1_2 = new MovementWaybillRow(receiptWaybillRowA1, 22, valueAddedTax); rowA2_1 = new MovementWaybillRow(receiptWaybillRowA2, 40, valueAddedTax); rowA2_2 = new MovementWaybillRow(receiptWaybillRowA2, 55, valueAddedTax); rowB = new MovementWaybillRow(receiptWaybillRowB, 15, valueAddedTax); rowC = new MovementWaybillRow(receiptWaybillRowC, 18, valueAddedTax); priceLists = new List <ArticleAccountingPrice>() { new ArticleAccountingPrice(articleA, 100), new ArticleAccountingPrice(articleB, 200), new ArticleAccountingPrice(articleC, 300) }; user = new User(new Employee("Иван", "Иванов", "Иванович", new EmployeePost("Менеджер"), null), "Иванов Иван", "ivanov", "pa$$w0rd", new Team("Тестовая команда", null), null); }
public async Task <ActionResult> Edit([Bind(Include = "LegalFormId,LegalFormDescription,LegalFormNotes")] LegalForm legalForm) { if (ModelState.IsValid) { db.Entry(legalForm).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(legalForm)); }
public async Task <IActionResult> Create([Bind("IdLegalForm,FormName,DescripionL")] LegalForm legalForm) { if (ModelState.IsValid) { _context.Add(legalForm); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(legalForm)); }
public void Init() { var juridicalLegalForm = new LegalForm("ООО", EconomicAgentType.JuridicalPerson); var physicalLegalForm = new LegalForm("ООО", EconomicAgentType.PhysicalPerson); juridicalPerson = new JuridicalPerson(juridicalLegalForm) { Id = 1, CashierName = "Кассиров В.В.", DirectorName = "Директоров В.В.", DirectorPost = "Главный директор", INN = "123456789", KPP = "2020202020", MainBookkeeperName = "Главбухова А.А.", OGRN = "12345", OKPO = "5431" }; physicalPerson = new PhysicalPerson(physicalLegalForm) { Id = 2, INN = "234567890", OGRNIP = "23456", OwnerName = "Физиков Ф.Ф.", Passport = new ValueObjects.PassportInfo { Series = "18 00", Number = "689689", IssuedBy = "Центральным РОВД г. Волгограда", IssueDate = DateTime.Parse("04.04.2001"), DepartmentCode = "342-001" } }; accountOrganization = new AccountOrganization("short_Name", "full_Name", juridicalPerson) { Id = 21 }; clientOrganization = new ClientOrganization("Короткое имя", "Длинное имя", physicalPerson) { Id = 22 }; providerOrganization = new ProviderOrganization("Краткое имя", "Полное имя", juridicalPerson) { Id = 23 }; provider = new Provider("Тестовый поставщик", new ProviderType("Тестовый тип поставщика"), ProviderReliability.Medium, 5); provider.AddContractorOrganization(providerOrganization); client = new Client("Тестовый клиент", new ClientType("Тестовый тип клиента"), ClientLoyalty.Follower, new ClientServiceProgram("Программа"), new ClientRegion("Волгоград"), (byte)3); }
public async Task <ActionResult> Create([Bind(Include = "LegalFormId,LegalFormDescription,LegalFormNotes")] LegalForm legalForm) { if (ModelState.IsValid) { db.LegalForms.Add(legalForm); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(legalForm)); }
// GET: LegalForms/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LegalForm legalForm = await db.LegalForms.FindAsync(id); if (legalForm == null) { return(HttpNotFound()); } return(View(legalForm)); }
public object Convert(LegalForm legalForm) { switch (legalForm) { case LegalForm.Ip: return(EnumValue("ЮридическоеФизическоеЛицо", "ФизическоеЛицо")); case LegalForm.Organization: return(EnumValue("ЮридическоеФизическоеЛицо", "ЮридическоеЛицо")); default: throw new InvalidEnumArgumentException(string.Format("unexpected value [{0}]", legalForm)); } }
public void addToList(Address address, LegalForm legalForm, Category category, BuildingType buildingType) { if (estates.Count == 0) { int id = 0; Estate estate = new Estate(id, address, legalForm, category, buildingType); estates.AddLast(estate); Console.WriteLine("Count == 0"); } else { int id = estates.Count; Estate estate = new Estate(id, address, legalForm, category, buildingType); estates.AddLast(estate); Console.WriteLine("Det blev else satsen istället king" + id); } }
public void Init() { // инициализация IoC IoCInitializer.Init(); var juridicalLegalForm = new LegalForm("ООО", EconomicAgentType.JuridicalPerson); var juridicalPerson1 = new JuridicalPerson(juridicalLegalForm) { Id = 1 }; accountOrganization = new AccountOrganization("Тестовая собственная организация", "Тестовая собственная организация", juridicalPerson1) { Id = 1 }; var juridicalPerson2 = new JuridicalPerson(juridicalLegalForm) { Id = 2 }; clientOrganization = new ClientOrganization("Тестовая организация клиента", "Тестовая организация клиента", juridicalPerson2) { Id = 2 }; clientContractRepository = Mock.Get(IoCContainer.Resolve <IClientContractRepository>()); dealRepository = Mock.Get(IoCContainer.Resolve <IDealRepository>()); dealIndicatorService = Mock.Get(IoCContainer.Resolve <IDealIndicatorService>()); expenditureWaybillIndicatorService = Mock.Get(IoCContainer.Resolve <IExpenditureWaybillIndicatorService>()); storageService = Mock.Get(IoCContainer.Resolve <IStorageService>()); clientContractIndicatorService = Mock.Get(IoCContainer.Resolve <IClientContractIndicatorService>()); taskRepository = Mock.Get(IoCContainer.Resolve <ITaskRepository>()); dealServiceMock = new Mock <DealService>(dealRepository.Object, clientContractRepository.Object, taskRepository.Object, dealIndicatorService.Object, expenditureWaybillIndicatorService.Object, storageService.Object, clientContractIndicatorService.Object); dealService = dealServiceMock.Object; user = new Mock <User>(); user.Setup(x => x.GetPermissionDistributionType(It.IsAny <Permission>())).Returns(PermissionDistributionType.All); clientContractIndicatorService.Setup(x => x.CalculateCashPaymentLimitExcessByPaymentsFromClient(It.IsAny <ClientContract>())).Returns(0); }
public static LegalForm ParseLegalForm(string prop, string value, LegalForm prev) { var result = prev ?? new LegalForm(); switch (prop) { case nameof(LegalForm.Code): result.Code = value; break; case nameof(LegalForm.Name): result.Name = value; break; default: throw UnsupportedPropertyOf <LegalForm>(prop); } return(result); }
private void PopulateFields(int index) { RealEstateObject obj = estateManager.GetAt(index); typeOfEstateCBox.Text = obj.TypeOfEstate; roomsTBox.Text = obj.NumberOfRooms.ToString(); priceTBox.Text = obj.Price.ToString(); LegalForm legalForm = obj.GetLegalForm(); switch (legalForm) { case LegalForm.Rental: rentalRBtn.PerformClick(); break; case LegalForm.Tenement: tenenmentRButton.PerformClick(); break; case LegalForm.Ownership: ownerShipRBtn.PerformClick(); break; } if (obj is Warehouse) { Warehouse wareHouse = (Warehouse)obj; landSizeTBox.Text = wareHouse.LandSizeInSquareMeters.ToString(); } if (obj is Apartment) { Apartment apartment = new Apartment(); apartment = (Apartment)obj; floorTBox.Text = apartment.Floor.ToString(); } streetTBox.Text = obj.Address.Street; cityTBox.Text = obj.Address.City; zipCodeTBox.Text = obj.Address.ZipCode; countryTBox.Text = obj.Address.Country; }
public void Init() { clientType = new ClientType("Тестовый тип клиента") { Id = 1 }; serviceProgram = new ClientServiceProgram("Тестовая программа") { Id = 2 }; region = new ClientRegion("Тестовый регион") { Id = 3 }; client = new Client("Тестовый клиент", clientType, ClientLoyalty.Customer, serviceProgram, region, 5) { Id = 4 }; user = new User(new Employee("Иван", "Иванов", "Иванович", new EmployeePost("Менеджер"), null), "Иванов Иван", "ivanov", "pa$$w0rd", new Team("Тестовая команда", null), null); var juridicalLegalForm = new LegalForm("ООО", EconomicAgentType.JuridicalPerson); juridicalPerson = new JuridicalPerson(juridicalLegalForm) { Id = 1 }; accountOrganization = new AccountOrganization("Тестовое юридическое лицо", "Тестовое юридическое лицо", juridicalPerson) { Id = 1 }; clientOrganization = new ClientOrganization("Тестовая организация клиента", "Тестовая организация клиента", new JuridicalPerson(juridicalLegalForm) { Id = 2 }) { Id = 3 }; contract = new ClientContract(accountOrganization, clientOrganization, "12", "1", DateTime.Now, DateTime.Now); }
public Apartment(LegalForm legalForm, Address address, string estateId) : base(estateId, legalForm, address) { }
public static void FillData(ApplicationContext context, UserManager <User> _userManager) { if (!context.TypeOfDocuments.Any()) { TypeOfDocument pasport = new TypeOfDocument { Name = "Паспорт" }; TypeOfDocument pasport1 = new TypeOfDocument { Name = "ВоенныйБилет" }; TypeOfDocument pasport2 = new TypeOfDocument { Name = "СвидетельствоОрождении" }; context.TypeOfDocuments.AddRange(pasport, pasport1, pasport2); context.SaveChanges(); } if (!context.Countries.Any()) { Country country = new Country { CountryName = "Кыргызстан" }; Country country1 = new Country { CountryName = "Таджикистан" }; Country country2 = new Country { CountryName = "Казахстан" }; context.Countries.AddRange(country, country1, country2); context.SaveChanges(); } if (!context.LegalForms.Any()) { LegalForm legalForm = new LegalForm { LegalFormName = "ОсОО" }; LegalForm legalForm1 = new LegalForm { LegalFormName = "ОАО" }; LegalForm legalForm2 = new LegalForm { LegalFormName = "ЗАО" }; context.LegalForms.AddRange(legalForm, legalForm1, legalForm2); context.SaveChanges(); } if (!context.PropertyTypes.Any()) { PropertyType propertyType = new PropertyType { PropertyTypeName = "Государственная" }; PropertyType propertyType1 = new PropertyType { PropertyTypeName = "Частная" }; PropertyType propertyType2 = new PropertyType { PropertyTypeName = "Смешанная" }; context.PropertyTypes.AddRange(propertyType, propertyType1, propertyType2); context.SaveChanges(); } if (!context.Residencies.Any()) { Residency residency = new Residency { ResidencyName = "Резидент" }; Residency residency1 = new Residency { ResidencyName = "НеРезидент" }; context.Residencies.AddRange(residency, residency1); context.SaveChanges(); } if (!context.TaxInspections.Any()) { TaxInspection taxInspection = new TaxInspection { TaxInspectionName = "Ленинский" }; TaxInspection taxInspection1 = new TaxInspection { TaxInspectionName = "Свердловский" }; TaxInspection taxInspection2 = new TaxInspection { TaxInspectionName = "Октябрьский" }; context.TaxInspections.AddRange(taxInspection, taxInspection1, taxInspection2); context.SaveChanges(); } if (!context.TransactionTypes.Any()) { List <TransactionType> transactions = new List <TransactionType>(); transactions.Add(TransactionType.Create(TransactionTypesEnum.Debit)); transactions.Add(TransactionType.Create(TransactionTypesEnum.Credit)); context.TransactionTypes.AddRange(transactions); context.SaveChanges(); } if (!context.ExchangeRateTypes.Any()) { ExchangeRateType exchangeRateType = ExchangeRateType.Create(ExchangeRateTypesEnum.NBKR); ExchangeRateType exchangeRateType1 = ExchangeRateType.Create(ExchangeRateTypesEnum.Market); context.ExchangeRateTypes.AddRange(exchangeRateType, exchangeRateType1); context.SaveChanges(); } if (!context.TransferStates.Any()) { context.AddRange( TransferState.Create(TransferStatesEnum.Confirmed), TransferState.Create(TransferStatesEnum.NotConfirmed), TransferState.Create(TransferStatesEnum.Canceled), TransferState.Create(TransferStatesEnum.BalanceNotEnough), TransferState.Create(TransferStatesEnum.AccountIsLocked)); context.SaveChanges(); } if (!context.TypeOfTransfers.Any()) { context.AddRange( TypeOfTransfer.Create(TypeOfTransfersEnum.InnerTransfer), TypeOfTransfer.Create(TypeOfTransfersEnum.InterBankTransfer), TypeOfTransfer.Create(TypeOfTransfersEnum.Conversion)); context.SaveChanges(); } if (!context.Currencies.Any()) { context.Currencies.Add ( new Currency { Code = "123", Name = "SOM", IsNativeCurrency = true } ); context.SaveChanges(); } if (!context.OurBank.Any()) { Currency currency = context.Currencies.FirstOrDefault(n => n.IsNativeCurrency == true); Account bankAccount = new Account { Locked = false, CurrencyId = currency.Id, Number = "1234567890123456" }; context.Accounts.Add(bankAccount); context.SaveChanges(); BankInfo bank = new BankInfo { BankName = "OurBank", Email = "*****@*****.**" }; context.BankInfos.Add(bank); OurBank ourBank = new OurBank { BIK = "123", AccountId = bankAccount.Id, BankInfoId = bank.Id }; context.OurBank.Add(ourBank); context.SaveChanges(); } if (!context.IntervalTypes.Any()) { List <IntervalType> intervalTypes = new List <IntervalType>(); intervalTypes.Add(IntervalType.Create(IntervalTypesEnum.OnceADay)); intervalTypes.Add(IntervalType.Create(IntervalTypesEnum.OnceAWeek)); intervalTypes.Add(IntervalType.Create(IntervalTypesEnum.OnceInTwoWeeks)); intervalTypes.Add(IntervalType.Create(IntervalTypesEnum.OnceAMonth)); intervalTypes.Add(IntervalType.Create(IntervalTypesEnum.OnceAQuarter)); intervalTypes.Add(IntervalType.Create(IntervalTypesEnum.OnceAHalfYear)); intervalTypes.Add(IntervalType.Create(IntervalTypesEnum.OnceAYear)); context.IntervalTypes.AddRange(intervalTypes); context.SaveChanges(); } if (!context.Roles.Any()) { context.Roles.AddRange ( new IdentityRole { Name = "admin", NormalizedName = "ADMIN" }, new IdentityRole { Name = "user", NormalizedName = "USER" } ); context.SaveChanges(); } if (context.Users.FirstOrDefault(u => u.UserName == "Admin") == null) { var result = _userManager.CreateAsync(new User { UserName = "******", Email = "*****@*****.**", IsTwoFactorOn = false, IsPasswordChanged = true, }, "Admin123@"); if (result.Result.Succeeded) { User user = context.Users.FirstOrDefault(u => u.UserName == "Admin"); IdentityRole role = context.Roles.FirstOrDefault(r => r.Name == "Admin"); context.UserRoles.Add(new IdentityUserRole <string> { RoleId = role.Id, UserId = user.Id }); context.SaveChanges(); } } if (!context.AddressTypes.Any()) { List <AddressType> addressTypes = new List <AddressType> { AddressType.Create(AddressTypesEnum.FactAddress), AddressType.Create(AddressTypesEnum.LegalAddress), AddressType.Create(AddressTypesEnum.BirthAddress) }; context.AddRange(addressTypes); context.SaveChanges(); //List<Address> adresses = context.Addresses.ToList(); //AddressType factaddress = // context.AddressTypes.FirstOrDefault(a => a.TypeName == AddressTypesEnum.FactAddress.ToString()); //AddressType legaladdress = // context.AddressTypes.FirstOrDefault(a => a.TypeName == AddressTypesEnum.LegalAddress.ToString()); //AddressType birthaddress = // context.AddressTypes.FirstOrDefault(a => a.TypeName == AddressTypesEnum.BirthAddress.ToString()); //foreach (Address address in adresses) //{ // switch (address.TypeOfAddress) // { // case "factaddress": address.AddressType = factaddress; // break; // case "legaladdress": address.AddressType = legaladdress; // break; // case "birthaddress": address.AddressType = birthaddress; // break; // } //} //context.UpdateRange(adresses); //context.SaveChanges(); } }
public Villa(LegalForm legalForm, Address address, string estateId) : base(estateId, legalForm, address) { }
public void Init() { // инициализация IoC IoCInitializer.Init(); receiptWaybillRepository = Mock.Get(IoCContainer.Resolve <IReceiptWaybillRepository>()); articleRepository = Mock.Get(IoCContainer.Resolve <IArticleRepository>()); storageRepository = Mock.Get(IoCContainer.Resolve <IStorageRepository>()); movementWaybillRepository = Mock.Get(IoCContainer.Resolve <IMovementWaybillRepository>()); changeOwnerWaybillRepository = Mock.Get(IoCContainer.Resolve <IChangeOwnerWaybillRepository>()); writeoffWaybillRepository = Mock.Get(IoCContainer.Resolve <IWriteoffWaybillRepository>()); expenditureWaybillRepository = Mock.Get(IoCContainer.Resolve <IExpenditureWaybillRepository>()); returnFromClientWaybillRepository = Mock.Get(IoCContainer.Resolve <IReturnFromClientWaybillRepository>()); waybillRowArticleMovementRepository = Mock.Get(IoCContainer.Resolve <IWaybillRowArticleMovementRepository>()); var incomingWaybillRowService = new IncomingWaybillRowService(receiptWaybillRepository.Object, movementWaybillRepository.Object, changeOwnerWaybillRepository.Object, returnFromClientWaybillRepository.Object); var outgoingWaybillRowService = new OutgoingWaybillRowService(movementWaybillRepository.Object, IoCContainer.Resolve <IWriteoffWaybillRepository>(), IoCContainer.Resolve <IExpenditureWaybillRepository>(), changeOwnerWaybillRepository.Object, waybillRowArticleMovementRepository.Object); var articleMovementService = new ArticleMovementService(waybillRowArticleMovementRepository.Object, receiptWaybillRepository.Object, movementWaybillRepository.Object, changeOwnerWaybillRepository.Object, returnFromClientWaybillRepository.Object, Mock.Get(IoCContainer.Resolve <IWriteoffWaybillRepository>()).Object, Mock.Get(IoCContainer.Resolve <IExpenditureWaybillRepository>()).Object, incomingWaybillRowService, outgoingWaybillRowService); articleAvailabilityService = new ArticleAvailabilityService(receiptWaybillRepository.Object, movementWaybillRepository.Object, changeOwnerWaybillRepository.Object, writeoffWaybillRepository.Object, expenditureWaybillRepository.Object, returnFromClientWaybillRepository.Object, articleRepository.Object, storageRepository.Object, IoCContainer.Resolve <IIncomingAcceptedArticleAvailabilityIndicatorService>(), IoCContainer.Resolve <IOutgoingAcceptedFromExactArticleAvailabilityIndicatorService>(), IoCContainer.Resolve <IOutgoingAcceptedFromIncomingAcceptedArticleAvailabilityIndicatorService>(), IoCContainer.Resolve <IExactArticleAvailabilityIndicatorService>(), incomingWaybillRowService); var juridicalLegalForm = new LegalForm("ООО", EconomicAgentType.JuridicalPerson); var physicalLegalForm = new LegalForm("ИП", EconomicAgentType.PhysicalPerson); juridicalPerson = new JuridicalPerson(juridicalLegalForm) { Id = 1 }; physicalPerson = new PhysicalPerson(physicalLegalForm) { Id = 2 }; accountOrganization = new AccountOrganization("Тестовое юридическое лицо", "Тестовое юридическое лицо", juridicalPerson) { Id = 1 }; providerOrganization = new ProviderOrganization("Тестовое физическое лицо", "Тестовое физическое лицо", physicalPerson) { Id = 2 }; provider = new Provider("Тестовый поставщик", new ProviderType("Тестовый тип поставщика"), ProviderReliability.Medium, 5); provider.AddContractorOrganization(providerOrganization); providerContract = new ProviderContract(accountOrganization, providerOrganization, "ABC", "123", DateTime.Now, DateTime.Today); provider.AddProviderContract(providerContract); articleGroup = new ArticleGroup("Тестовая группа", "Тестовая группа"); measureUnit = new MeasureUnit("шт.", "Штука", "123", 0) { Id = 1 }; storageG = new Storage("G", StorageType.DistributionCenter) { Id = 1 }; storageM = new Storage("M", StorageType.DistributionCenter) { Id = 2 }; storageN = new Storage("N", StorageType.DistributionCenter) { Id = 3 }; articleA = new Article("A", articleGroup, measureUnit, false) { Id = 101 }; articleB = new Article("B", articleGroup, measureUnit, false) { Id = 102 }; articleC = new Article("C", articleGroup, measureUnit, false) { Id = 103 }; valueAddedTax = new ValueAddedTax("18%", 18); priceLists = new List <ArticleAccountingPrice>() { new ArticleAccountingPrice(articleA, 100), new ArticleAccountingPrice(articleB, 200), new ArticleAccountingPrice(articleC, 300) }; }
public void Init() { receiptWaybillRepository = Mock.Get(IoCContainer.Resolve <IReceiptWaybillRepository>()); productionOrderRepository = Mock.Get(IoCContainer.Resolve <IProductionOrderRepository>()); productionOrderBatchRepository = Mock.Get(IoCContainer.Resolve <IProductionOrderBatchRepository>()); defaultProductionOrderStageRepository = Mock.Get(IoCContainer.Resolve <IDefaultProductionOrderStageRepository>()); taskRepository = Mock.Get(IoCContainer.Resolve <ITaskRepository>()); articleAccountingPriceIndicatorService = Mock.Get(IoCContainer.Resolve <IArticleAccountingPriceIndicatorService>()); productionOrderService_accessor = new Mock <ProductionOrderService_Accessor>(productionOrderRepository.Object, productionOrderBatchRepository.Object, receiptWaybillRepository.Object, taskRepository.Object, defaultProductionOrderStageRepository.Object); productionOrderService = new Mock <ProductionOrderService>(productionOrderRepository.Object, productionOrderBatchRepository.Object, receiptWaybillRepository.Object, taskRepository.Object, defaultProductionOrderStageRepository.Object); var juridicalLegalForm = new LegalForm("ООО", EconomicAgentType.JuridicalPerson); var providerType = new ProviderType("Тестовый тип поставщика"); var articleGroup = new ArticleGroup("Бытовая техника", "Бытовая техника"); var measureUnit = new MeasureUnit("шт", "штука", "123", 0); article1 = new Article("Пылесос", articleGroup, measureUnit, true) { Id = 1 }; article2 = new Article("Пылесос2", articleGroup, measureUnit, true) { Id = 2 }; article3 = new Article("Пылесос3", articleGroup, measureUnit, true) { Id = 3 }; priceLists = new List <ArticleAccountingPrice>() { new ArticleAccountingPrice(article1, 100M), new ArticleAccountingPrice(article2, 150M), new ArticleAccountingPrice(article3, 200M) }; var provider = new Provider("Нейтральная организация", providerType, ProviderReliability.Medium, 5); var providerOrganization = new ProviderOrganization("Тестовое физическое лицо", "Тестовое физическое лицо", new JuridicalPerson(juridicalLegalForm)) { Id = 1 }; var accountOrganization = new AccountOrganization(@"ООО ""Юридическое лицо""", @"ООО ""Юридическое лицо""", new JuridicalPerson(juridicalLegalForm)) { Id = 2 }; provider.AddContractorOrganization(providerOrganization); var providerContract = new ProviderContract(accountOrganization, providerOrganization, "ABC", "123", DateTime.Now, DateTime.Today); provider.AddProviderContract(providerContract); role = new Role("Администратор"); role.AddPermissionDistribution(new PermissionDistribution(Permission.ReceiptWaybill_Delete_Row_Delete, PermissionDistributionType.All)); user = new User(new Employee("Иван", "Иванов", "Иванович", new EmployeePost("Менеджер"), null), "Иванов Иван", "ivanov", "pa$$w0rd", new Team("Тестовая команда", null), null); user.AddRole(role); storage = new Storage("МХ", StorageType.TradePoint); storage.AddAccountOrganization(accountOrganization); producer = new Producer("producer", "organization", 5, user, false); var producerContract = new ProducerContract(accountOrganization, producer.Organization, "ABC", "123", DateTime.Now, DateTime.Today); currency = new Currency("755", "EUR", "Евро"); var stage1 = new ProductionOrderBatchStage_Accessor("1", ProductionOrderBatchStageType.Calculation, 1, false) { IsDefault = true }; var stage2 = new ProductionOrderBatchStage_Accessor("2", ProductionOrderBatchStageType.Closed, 0, false) { IsDefault = true }; var stage3 = new ProductionOrderBatchStage_Accessor("3", ProductionOrderBatchStageType.Closed, 0, false) { IsDefault = true }; var currentDateTime = DateTimeUtils.GetCurrentDateTime(); productionOrder = new ProductionOrder("ЗАКАЗ", producer, currency, (ProductionOrderBatchStage)stage1.Target, (ProductionOrderBatchStage)stage2.Target, (ProductionOrderBatchStage)stage3.Target, ProductionOrderArticleTransportingPrimeCostCalculationType.Weight, true, true, true, true, true, false, false, user, currentDateTime) { Storage = storage }; productionOrder.AddContract(producerContract); productionOrderBatch = productionOrder.Batches.FirstOrDefault(); manufacturer = new Manufacturer("Изготовитель"); producer.AddManufacturer(manufacturer); productionOrderBatchRow1 = new ProductionOrderBatchRow(article1, currency, 5M, 10M, 1.0M, new Country("Страна1", "686"), manufacturer) { Id = Guid.NewGuid() }; productionOrderBatchRow2 = new ProductionOrderBatchRow(article2, currency, 25M, 5M, 2.0M, new Country("Страна2", "686"), manufacturer) { Id = Guid.NewGuid() }; productionOrderBatchRow3 = new ProductionOrderBatchRow(article3, currency, 100M, 2M, 1.5M, new Country("Страна3", "686"), manufacturer) { Id = Guid.NewGuid() }; productionOrderBatch.AddRow(productionOrderBatchRow1); productionOrderBatch.AddRow(productionOrderBatchRow2); productionOrderBatch.AddRow(productionOrderBatchRow3); var customDeclarationNumber = new String('0', 25); receiptWaybill_accessor = new ReceiptWaybill_Accessor(productionOrderBatch, "999999", DateTime.Today, new ValueAddedTax("10%", 10), customDeclarationNumber, user, user, DateTime.Now); receiptWaybill = (ReceiptWaybill)receiptWaybill_accessor.Target; receiptWaybillRow1 = new ReceiptWaybillRow(article1, 10M, 0M, receiptWaybill.PendingValueAddedTax) { Id = Guid.NewGuid() }; receiptWaybill.AddRow(receiptWaybillRow1); productionOrderBatch.Rows.Where(x => x.Article == article1).FirstOrDefault().ReceiptWaybillRow = receiptWaybillRow1; receiptWaybillRow2 = new ReceiptWaybillRow(article2, 5M, 0M, receiptWaybill.PendingValueAddedTax) { Id = Guid.NewGuid() }; receiptWaybill.AddRow(receiptWaybillRow2); productionOrderBatch.Rows.Where(x => x.Article == article2).FirstOrDefault().ReceiptWaybillRow = receiptWaybillRow2; receiptWaybillRow3 = new ReceiptWaybillRow(article3, 2M, 0M, receiptWaybill.PendingValueAddedTax) { Id = Guid.NewGuid() }; receiptWaybill.AddRow(receiptWaybillRow3); productionOrderBatch.Rows.Where(x => x.Article == article3).FirstOrDefault().ReceiptWaybillRow = receiptWaybillRow3; receiptWaybillList = new List <ReceiptWaybill> { receiptWaybill }; receiptWaybillRepository.Setup(x => x.Delete(It.IsAny <ReceiptWaybill>())).Callback <ReceiptWaybill>(waybill => receiptWaybillList.Remove(waybill)); receiptWaybill.Accept(priceLists, user, DateTime.Now); receiptWaybillRow1.ReceiptedCount = receiptWaybillRow1.PendingCount; receiptWaybillRow1.ProviderCount = receiptWaybillRow1.PendingCount; receiptWaybillRow1.ProviderSum = 0M; receiptWaybillRow2.ReceiptedCount = receiptWaybillRow2.PendingCount; receiptWaybillRow2.ProviderCount = receiptWaybillRow2.PendingCount; receiptWaybillRow2.ProviderSum = 0M; receiptWaybillRow3.ReceiptedCount = receiptWaybillRow3.PendingCount; receiptWaybillRow3.ProviderCount = receiptWaybillRow3.PendingCount; receiptWaybillRow3.ProviderSum = 0M; }
public Task <LegalForm> Add(LegalForm legalForm) { throw new System.NotImplementedException(); }
public Task Update(LegalForm legalForm) { throw new System.NotImplementedException(); }
public Residential(string estateId, LegalForm legalForm, Address address) : base(estateId, legalForm, address) { }
public Warehouse(LegalForm legalForm, Address address, string estateId) : base(estateId, legalForm, address) { }
public void Init() { // инициализация IoC IoCInitializer.Init(); receiptWaybillRepository = Mock.Get(IoCContainer.Resolve <IReceiptWaybillRepository>()); receiptWaybillService = new ReceiptWaybillService(IoCContainer.Resolve <IArticleRepository>(), receiptWaybillRepository.Object, IoCContainer.Resolve <IMovementWaybillRepository>(), IoCContainer.Resolve <IExpenditureWaybillRepository>(), IoCContainer.Resolve <IStorageRepository>(), IoCContainer.Resolve <IUserRepository>(), IoCContainer.Resolve <IChangeOwnerWaybillRepository>(), IoCContainer.Resolve <IWriteoffWaybillRepository>(), IoCContainer.Resolve <IStorageService>(), IoCContainer.Resolve <IAccountOrganizationService>(), IoCContainer.Resolve <IProviderService>(), IoCContainer.Resolve <IProviderContractService>(), IoCContainer.Resolve <IValueAddedTaxService>(), IoCContainer.Resolve <IArticleMovementService>(), IoCContainer.Resolve <IArticlePriceService>(), IoCContainer.Resolve <IExactArticleAvailabilityIndicatorService>(), IoCContainer.Resolve <IIncomingAcceptedArticleAvailabilityIndicatorService>(), IoCContainer.Resolve <IArticleAccountingPriceIndicatorService>(), IoCContainer.Resolve <IArticleMovementOperationCountService>(), IoCContainer.Resolve <IOutgoingAcceptedFromExactArticleAvailabilityIndicatorService>(), IoCContainer.Resolve <IOutgoingAcceptedFromIncomingAcceptedArticleAvailabilityIndicatorService>(), IoCContainer.Resolve <IArticleMovementFactualFinancialIndicatorService>(), IoCContainer.Resolve <IFactualFinancialArticleMovementService>(), IoCContainer.Resolve <IAcceptedSaleIndicatorService>(), IoCContainer.Resolve <IShippedSaleIndicatorService>(), IoCContainer.Resolve <IReceiptedReturnFromClientIndicatorService>(), IoCContainer.Resolve <IAcceptedReturnFromClientIndicatorService>(), IoCContainer.Resolve <IReturnFromClientBySaleAcceptanceDateIndicatorService>(), IoCContainer.Resolve <IReturnFromClientBySaleShippingDateIndicatorService>(), IoCContainer.Resolve <IArticleRevaluationService>(), IoCContainer.Resolve <IArticlePurchaseService>(), IoCContainer.Resolve <IAcceptedPurchaseIndicatorService>(), IoCContainer.Resolve <IApprovedPurchaseIndicatorService>(), IoCContainer.Resolve <IArticleAvailabilityService>() ); var juridicalLegalForm = new LegalForm("ООО", EconomicAgentType.JuridicalPerson); var providerType = new ProviderType("Тестовый тип поставщика"); var articleGroup = new ArticleGroup("Бытовая техника", "Бытовая техника"); var measureUnit = new MeasureUnit("шт", "штука", "123", 0); var article = new Article("Пылесос", articleGroup, measureUnit, true) { Id = 1 }; priceLists = new List <ArticleAccountingPrice>() { new ArticleAccountingPrice(article, 100M) }; var provider = new Provider("Нейтральная организация", providerType, ProviderReliability.Medium, 5); var providerOrganization = new ProviderOrganization("Тестовое физическое лицо", "Тестовое физическое лицо", new JuridicalPerson(juridicalLegalForm)) { Id = 1 }; var accountOrganization = new AccountOrganization(@"ООО ""Юридическое лицо""", @"ООО ""Юридическое лицо""", new JuridicalPerson(juridicalLegalForm)) { Id = 2 }; provider.AddContractorOrganization(providerOrganization); var providerContract = new ProviderContract(accountOrganization, providerOrganization, "ABC", "123", DateTime.Now, DateTime.Today); provider.AddProviderContract(providerContract); role = new Role("Администратор"); role.AddPermissionDistribution(new PermissionDistribution(Permission.ReceiptWaybill_Delete_Row_Delete, PermissionDistributionType.All)); user = new User(new Employee("Иван", "Иванов", "Иванович", new EmployeePost("Менеджер"), null), "Иванов Иван", "ivanov", "pa$$w0rd", new Team("Тестовая команда", null), null); user.AddRole(role); createdBy = new User(new Employee("Олег", "Олегов", "Олегович", new EmployeePost("Менеджер"), null), "Олегов Олег", "olegov", "pa$$w0rd", new Team("Тестовая команда", null), null); createdBy.AddRole(role); acceptedBy = new User(new Employee("Петр", "Петров", "Петрович", new EmployeePost("Менеджер"), null), "Петров Петр", "petrov", "pa$$w0rd", new Team("Тестовая команда", null), null); acceptedBy.AddRole(role); receiptedBy = new User(new Employee("Николай", "Николаев", "Николаевия", new EmployeePost("Менеджер"), null), "Николаев Николай", "nikolaev", "pa$$w0rd", new Team("Тестовая команда", null), null); receiptedBy.AddRole(role); var customDeclarationNumber = new String('0', 25); receiptWaybill = new ReceiptWaybill("999999", DateTime.Today, new Storage("Третий склад", StorageType.DistributionCenter), accountOrganization, provider, 50, 0M, new ValueAddedTax("10%", 10), providerContract, customDeclarationNumber, user, createdBy, DateTime.Now); receiptWaybillRow = new ReceiptWaybillRow(article, 5, 50M, receiptWaybill.PendingValueAddedTax); receiptWaybill.AddRow(receiptWaybillRow); receiptWaybillList = new List <ReceiptWaybill> { receiptWaybill }; receiptWaybillRepository.Setup(x => x.Delete(It.IsAny <ReceiptWaybill>())).Callback <ReceiptWaybill>(waybill => receiptWaybillList.Remove(waybill)); }
public Commercial(string estateId, LegalForm legalForm, Address address) : base(estateId, legalForm, address) { }
public Estate(string estateId, LegalForm legalForm, Address address) { EstateId = estateId; LegalForm = legalForm; Address = address; }