Esempio n. 1
0
 public AccountOrganization(string shortName, string fullName, EconomicAgent economicAgent) :
     base(shortName, fullName, economicAgent, OrganizationType.AccountOrganization)
 {
     storages        = new HashedSet <Storage>();
     contracts       = new HashedSet <Contract>();
     documentNumbers = new HashedSet <AccountOrganizationDocumentNumbers>();
     SalesOwnArticle = false;
 }
Esempio n. 2
0
        protected internal Organization(string shortName, string fullName, EconomicAgent economicAgent, OrganizationType type)
        {
            ShortName     = shortName;
            FullName      = fullName;
            EconomicAgent = economicAgent;
            Type          = type;

            Address             = String.Empty;
            Comment             = String.Empty;
            CreationDate        = DateTime.Now;
            russianBankAccounts = new HashedSet <RussianBankAccount>();
            foreignBankAccounts = new HashedSet <ForeignBankAccount>();
        }
Esempio n. 3
0
        /// <summary>
        /// Получение полного текстового описания организации в виде Организация, адрес, телефон, ИНН, р/с, банк
        /// </summary>
        /// <returns>Описание организации</returns>
        public virtual string GetFullInfo()
        {
            var sb = new StringBuilder();

            sb.Append(FullName);

            var INN = EconomicAgent.Type == EconomicAgentType.JuridicalPerson ?
                      EconomicAgent.As <JuridicalPerson>().INN : EconomicAgent.As <PhysicalPerson>().INN;

            if (!String.IsNullOrEmpty(Address))
            {
                sb.Append(String.Format(", {0}", Address));
            }
            if (!String.IsNullOrEmpty(Phone))
            {
                sb.Append(String.Format(", тел.: {0}", Phone));
            }

            sb.Append(String.Format(", ИНН: {0}", INN));

            var bankAccounts = RussianBankAccounts.Where(x => x.IsMaster);

            if (bankAccounts.Count() > 1)
            {
                throw new Exception("Невозможно определить основной расчетный счет организации, так как ей назначено более одного основного расчетного счета.");
            }

            if (bankAccounts.Count() == 1)
            {
                var bankAccount = bankAccounts.Single().As <RussianBankAccount>();
                var bank        = bankAccount.Bank.As <RussianBank>();

                sb.Append(String.Format(", р/с {0} в банке {1}, {2}, БИК {3}, корр/с {4} ", bankAccount.Number, bankAccount.Bank.Name, bankAccount.Bank.Address, bank.BIC, bank.CorAccount));
            }

            return(sb.ToString());
        }
Esempio n. 4
0
 protected internal ContractorOrganization(string shortName, string fullName, EconomicAgent economicAgent, OrganizationType type)
     : base(shortName, fullName, economicAgent, type)
 {
     contractors = new HashedSet <Contractor>();
     contracts   = new HashedSet <Contract>();
 }