Example #1
0
        public void ConvertTo(LegalEntityOwnerView legalEntityOwnerView, LegalEntityOwner legalEntityOwner)
        {
            legalEntityOwner.LegalEntityOwnerPK = legalEntityOwnerView.LegalEntityOwnerPK;

            legalEntityOwner.LegalEntityFK = legalEntityOwnerView.LegalEntityFK;

            string[] tmpOwnerTypes = legalEntityOwnerView.OwnerStringFK.Split('|');
            legalEntityOwner.OwnerType = tmpOwnerTypes[0].Trim();
            legalEntityOwner.OwnerFK   = Convert.ToInt32(tmpOwnerTypes[1]);

            legalEntityOwner.AdditionalFactorFK    = legalEntityOwnerView.AdditionalFactorFK;
            legalEntityOwner.FulfilledFactorFK     = legalEntityOwnerView.FulfilledFactorFK;
            legalEntityOwner.BussinesShareBurdenFK = legalEntityOwnerView.BussinesShareBurdenFK;
            legalEntityOwner.ChangeTypeFK          = legalEntityOwnerView.ChangeTypeFK;

            legalEntityOwner.BusinessShareAmount        = legalEntityOwnerView.BusinessShareAmount;
            legalEntityOwner.NominalBussinesShareAmount = legalEntityOwnerView.NominalBussinesShareAmount;
            legalEntityOwner.PaidBussinesShareAmount    = legalEntityOwnerView.PaidBussinesShareAmount;

            legalEntityOwner.NumberOfVotes = legalEntityOwnerView.NumberOfVotes;
            legalEntityOwner.EntryDate     = legalEntityOwnerView.EntryDate;

            legalEntityOwner.ChangeDate = legalEntityOwnerView.ChangeDate;

            legalEntityOwner.Deleted = legalEntityOwnerView.Deleted;
        }
Example #2
0
        public void BindDLLs(LegalEntityOwnerView legalEntityOwnerView, ObjectContext db)
        {
            //Owners ddl
            IPhysicalEntitiesRepository physicalEntitesRepository = new PhysicalEntitiesRepository(db);
            ILegalEntitiesRepository    legalEntitiesRepository   = new LegalEntitiesRepository(db);

            List <DDLHelper> owners = LegalEntityOwnerView.GetOwnersSelect(physicalEntitesRepository.GetValid(), legalEntitiesRepository.GetValidOwners()).OrderBy("Text ASC").ToList();

            legalEntityOwnerView.Owners = new SelectList(owners, "Value", "Text");

            //AdditionalFactors ddl
            IAdditionalFactorsRepository additionalFactorsRepository = new AdditionalFactorsRepository(db);

            legalEntityOwnerView.AdditionalFactors = new SelectList(additionalFactorsRepository.GetValid().OrderBy("Name ASC").ToList(), "AdditionalFactorPK", "Name");

            //FulfilledFactors ddl
            IFulfilledFactorsRepository fulfilledFactorsRepository = new FulfilledFactorsRepository(db);

            legalEntityOwnerView.FulfilledFactors = new SelectList(fulfilledFactorsRepository.GetValid().OrderBy("Name ASC").ToList(), "FulfilledFactorPK", "Name");

            //BussinesShareBurdens ddl
            IBussinesShareBurdensRepository bussinesShareBurdensRepository = new BussinesShareBurdensRepository(db);

            legalEntityOwnerView.BussinesShareBurdens = new SelectList(bussinesShareBurdensRepository.GetValid().OrderBy("Name ASC").ToList(), "BussinesShareBurdenPK", "Name");

            //ChangeTypes ddl
            IChangeTypesRepository changeTypesRepository = new ChangeTypesRepository(db);

            legalEntityOwnerView.ChangeTypes = new SelectList(changeTypesRepository.GetValid().OrderBy("Name ASC").ToList(), "ChangeTypePK", "Name");
        }
Example #3
0
        public void ConvertFrom(LegalEntityOwner legalEntityOwner, LegalEntityOwnerView legalEntityOwnerView, ObjectContext db)
        {
            legalEntityOwnerView.LegalEntityOwnerPK = legalEntityOwner.LegalEntityOwnerPK;

            legalEntityOwnerView.LegalEntityFK = legalEntityOwner.LegalEntityFK;

            legalEntityOwnerView.OwnerStringFK = legalEntityOwner.OwnerType.Trim() + "|" + legalEntityOwner.OwnerFK.ToString();

            legalEntityOwnerView.AdditionalFactorFK    = legalEntityOwner.AdditionalFactorFK;
            legalEntityOwnerView.FulfilledFactorFK     = legalEntityOwner.FulfilledFactorFK;
            legalEntityOwnerView.BussinesShareBurdenFK = legalEntityOwner.BussinesShareBurdenFK;
            legalEntityOwnerView.ChangeTypeFK          = legalEntityOwner.ChangeTypeFK;

            legalEntityOwnerView.BusinessShareAmount        = legalEntityOwner.BusinessShareAmount;
            legalEntityOwnerView.NominalBussinesShareAmount = legalEntityOwner.NominalBussinesShareAmount;
            legalEntityOwnerView.PaidBussinesShareAmount    = legalEntityOwner.PaidBussinesShareAmount;

            legalEntityOwnerView.NumberOfVotes = legalEntityOwner.NumberOfVotes;

            legalEntityOwnerView.EntryDate = legalEntityOwner.EntryDate;

            legalEntityOwnerView.Deleted = legalEntityOwner.Deleted;

            ILegalEntitiesRepository legalEntitiesRepository = new LegalEntitiesRepository(db);
            LegalEntity legalEntity = legalEntitiesRepository.GetLegalEntityByPK((int)legalEntityOwnerView.LegalEntityFK);

            legalEntityOwnerView.LegalEntityName = legalEntity.Name + " (" + legalEntity.OIB + ")";
        }
Example #4
0
        public static IQueryable <LegalEntityOwner> GetLegalEntityOwnersForLegalEntity(int legalEntityFK, List <LegalEntityOwner> coList, IQueryable <LegalEntityOwner> legalEntityOwnersTable)
        {
            List <LegalEntityOwner> filteredCoList = new List <LegalEntityOwner>();

            foreach (var co in coList)
            {
                LegalEntityOwnerView.Fill(filteredCoList, legalEntityOwnersTable.ToList(), co);
            }

            legalEntityOwnersTable = filteredCoList.AsQueryable();

            return(legalEntityOwnersTable);
        }