public void Init() { storage = new Storage("Тестовое место хранения", StorageType.DistributionCenter) { Id = 1 }; user = new User(new Employee("Иван", "Иванов", "Иванович", new EmployeePost("Менеджер"), null), "Иванов Иван", "ivanov", "pa$$w0rd", new Team("Тестовая команда", null), null); economicAgent = new PhysicalPerson(new LegalForm("Легал форм", EconomicAgentType.PhysicalPerson)); accountOrganization = new AccountOrganization("Орг1 кор имя", "орг1 длин имя", economicAgent) { Id = 1 }; clientOrganization = new ClientOrganization("client org", "cllll", economicAgent) { Id = 3 }; storage.AddAccountOrganization(accountOrganization); deal = new Deal("Тестовая сделка", user) { Id = 2 }; client = new Client("клиент1", new ClientType("основной тип клиента"), ClientLoyalty.Follower, new ClientServiceProgram("программа 1"), new ClientRegion("Регион 1"), 10); deal.Contract = new ClientContract(accountOrganization, clientOrganization, "Договор 1", "1", DateTime.Now, DateTime.Now); client.AddDeal(deal); quota = new DealQuota("Тестовая квота", 20, 14, 20000.0M) { Id = 3 }; deal.AddQuota(quota); team = new Mock <Team>(); expenditureWaybill = new ExpenditureWaybill("123", DateTime.Today, storage, deal, team.Object, quota, false, user, DeliveryAddressType.ClientAddress, "", DateTime.Today, user); }
public void Init() { providerType = new ProviderType("Тестовый тип поставщика") { Id = 1 }; provider = new Provider("Поставщик", providerType, ProviderReliability.Medium, 5) { Id = 2 }; juridicalPerson = new JuridicalPerson(new LegalForm("ООО", EconomicAgentType.JuridicalPerson)) { Id = 3 }; providerOrganization = new ProviderOrganization("Юрик", "Юрик", juridicalPerson) { Id = 4 }; physicalPerson = new PhysicalPerson(new LegalForm("ИП", EconomicAgentType.PhysicalPerson)) { Id = 5 }; accountOrganization = new AccountOrganization("Физик", "Физик", physicalPerson) { Id = 6 }; contract = new ProviderContract(accountOrganization, providerOrganization, "Договор", "111", DateTime.Today, DateTime.Today) { Id = 7 }; }
public void Pay(double amount, EconomicAgent whom) { Pay(amount); whom.Receive(amount); }
public ProviderOrganization(string shortName, string fullName, EconomicAgent economicAgent) : base(shortName, fullName, economicAgent, OrganizationType.ProviderOrganization) { }
public void Init() { employee1 = new Employee("Работник 1 имя", "Работник 1 фамилия", "Работник 1 отчество", new EmployeePost("Работник 1 пост"), null); curator = new User(employee1, "Куратор", "log", "pas", new Team("Тестовая команда", null), null); team = new Team("123", curator); economicAgent = new PhysicalPerson(new LegalForm("Легал форм", EconomicAgentType.PhysicalPerson)); accountOrganization = new AccountOrganization("Орг1 кор имя", "орг1 длин имя", economicAgent) { Id = 1 }; accountOrganizationAnother = new AccountOrganization("Орг2 кор имя", "орг2 длин имя", economicAgent) { Id = 2 }; clientOrganization = new ClientOrganization("client org", "cllll", economicAgent) { Id = 3 }; client = new Client("клиент1", new ClientType("основной тип клиента"), ClientLoyalty.Follower, new ClientServiceProgram("программа 1"), new ClientRegion("Регион 1"), 10); deal = new Deal("Тестовая сделка", curator); client.AddDeal(deal); storage = new Storage("Склад 1", StorageType.ExtraStorage); storage.AddAccountOrganization(accountOrganization); storage.AddAccountOrganization(accountOrganizationAnother); storage2 = new Storage("Склад 2", StorageType.ExtraStorage); returnFromClientReason = new ReturnFromClientReason("Брак"); returnFromClientWaybill = new ReturnFromClientWaybill("142", DateTime.Today, accountOrganization, deal, team, storage, returnFromClientReason, curator, curator, DateTime.Now); valueAddedTax = new ValueAddedTax("18%", 18); ag = new ArticleGroup("Группа товаров", "Группа товаров"); art1 = new Article("Товар 1", ag, new MeasureUnit("шт.", "штуки", "123", 1), false); art2 = new Article("Товар 2", ag, new MeasureUnit("шт.", "штуки", "123", 1), false); art3 = new Article("Товар 3", ag, new MeasureUnit("шт.", "штуки", "123", 1), false); Prices = new List <ArticleAccountingPrice>(); Prices.Add(new ArticleAccountingPrice(art1, 10M)); Prices.Add(new ArticleAccountingPrice(art2, 13M)); Prices.Add(new ArticleAccountingPrice(art3, 15M)); deal1 = new Deal("Deal1", curator); deal2 = new Deal("Deal2", curator); quota1 = new DealQuota("qq", 1); quota2 = new DealQuota("qq", 2); deal1.AddQuota(quota1); deal2.AddQuota(quota2); deal1.Contract = new ClientContract(accountOrganization, clientOrganization, "Договор", "1", DateTime.Now, DateTime.Now); deal2.Contract = new ClientContract(accountOrganizationAnother, clientOrganization, "kk", "22", DateTime.Today, DateTime.Now); recRow1 = new ReceiptWaybillRow(art1, 5, 50, new ValueAddedTax("18%", 18)) { Id = Guid.NewGuid() }; recRow1_1 = new ReceiptWaybillRow(art1, 2, 30, new ValueAddedTax("18%", 18)) { Id = Guid.NewGuid() }; recRow2 = new ReceiptWaybillRow(art2, 7, 35, new ValueAddedTax("18%", 18)) { Id = Guid.NewGuid() }; recRow3 = new ReceiptWaybillRow(art3, 9, 90, new ValueAddedTax("18%", 18)) { Id = Guid.NewGuid() }; recRow1.PurchaseCost = 50 / 5; recRow1.PurchaseCost = 35 / 7; recRow1.PurchaseCost = 90 / 9; saleRow1 = new ExpenditureWaybillRow(recRow1, 3, valueAddedTax) { Id = Guid.NewGuid() }; saleRow1_1 = new ExpenditureWaybillRow(recRow1_1, 1, valueAddedTax) { Id = Guid.NewGuid() }; saleRow2 = new ExpenditureWaybillRow(recRow2, 4, valueAddedTax) { Id = Guid.NewGuid() }; saleRow3 = new ExpenditureWaybillRow(recRow3, 5, valueAddedTax) { Id = Guid.NewGuid() }; saleRowAnother1 = new ExpenditureWaybillRow(recRow1, 3, valueAddedTax) { Id = Guid.NewGuid() }; saleRowAnother2 = new ExpenditureWaybillRow(recRow2, 4, valueAddedTax) { Id = Guid.NewGuid() }; saleRowAnother3 = new ExpenditureWaybillRow(recRow3, 5, valueAddedTax) { Id = Guid.NewGuid() }; sale = new ExpenditureWaybill("1", DateTime.Today, storage, deal1, team, quota1, true, curator, DeliveryAddressType.ClientAddress, "", DateTime.Now, curator) { Id = Guid.NewGuid() }; saleAnother = new ExpenditureWaybill("1", DateTime.Today, storage, deal2, team, quota2, true, curator, DeliveryAddressType.ClientAddress, "", DateTime.Now, curator) { Id = Guid.NewGuid() }; sale.As <ExpenditureWaybill>().AddRow((ExpenditureWaybillRow)saleRow1); sale.As <ExpenditureWaybill>().AddRow((ExpenditureWaybillRow)saleRow2); sale.As <ExpenditureWaybill>().AddRow((ExpenditureWaybillRow)saleRow3); saleAnother.As <ExpenditureWaybill>().AddRow((ExpenditureWaybillRow)saleRowAnother1); saleAnother.As <ExpenditureWaybill>().AddRow((ExpenditureWaybillRow)saleRowAnother2); saleAnother.As <ExpenditureWaybill>().AddRow((ExpenditureWaybillRow)saleRowAnother3); sale.As <ExpenditureWaybill>().Accept(Prices, false, curator, DateTime.Now); saleAnother.As <ExpenditureWaybill>().Accept(Prices, false, curator, DateTime.Now); }
public ClientOrganization(string shortName, string fullName, EconomicAgent economicAgent) : base(shortName, fullName, economicAgent, OrganizationType.ClientOrganization) { }