Beispiel #1
0
        public void ConvertFrom(LegalEntity legalEntity, LegalEntityView legalEntityView)
        {
            legalEntityView.LegalEntityPK = legalEntity.LegalEntityPK;
            legalEntityView.Name          = legalEntity.Name;
            legalEntityView.ShortName     = legalEntity.ShortName;
            legalEntityView.OIB           = legalEntity.OIB;
            legalEntityView.MB            = legalEntity.MB;
            legalEntityView.MBS           = legalEntity.MBS;

            legalEntityView.FormFK = legalEntity.FormFK;

            legalEntityView.Company = legalEntity.Company;
            legalEntityView.Active  = legalEntity.Active;

            legalEntityView.Deleted = legalEntity.Deleted;
        }
Beispiel #2
0
        public void BindDDLs(LegalEntityView legalEntityView, ObjectContext db)
        {
            //forms ddl
            IFormsRepository formsRepository = new FormsRepository(db);

            legalEntityView.Forms = new SelectList(formsRepository.GetValid().OrderBy("Name ASC").ToList(), "FormPK", "Name");

            //activities ddl
            IActivitiesRepository activitiesRepository = new ActivitiesRepository(db);
            var activities = activitiesRepository.GetValid().OrderBy("Name ASC").ToList();

            //regional offices ddl
            IRegionalOfficesRepository regionalOfficesRepository = new RegionalOfficesRepository(db);

            legalEntityView.RegionalOffices = new SelectList(regionalOfficesRepository.GetValid().OrderBy("Name ASC").ToList(), "RegionalOfficePK", "Name");
        }
Beispiel #3
0
        public static LegalEntityView GetLegalEntityReport(ObjectContext db, int legalEntityPK)
        {
            ILegalEntitiesRepository legalEntitiesRepository = new LegalEntitiesRepository(db);
            LegalEntity legalEntity = legalEntitiesRepository.GetLegalEntityByPK(legalEntityPK);

            LegalEntityView legalEntityView = new LegalEntityView
            {
                LegalEntityPK = legalEntity.LegalEntityPK,
                Name          = legalEntity.Name,
                ShortName     = legalEntity.ShortName,
                OIB           = legalEntity.OIB,
                MB            = legalEntity.MB,
                MBS           = legalEntity.MBS,
                FormName      = legalEntity.FormFK != null ? legalEntity.Form.Name : null,

                Active  = legalEntity.Active,
                Deleted = legalEntity.Deleted
            };

            return(legalEntityView);
        }