예제 #1
0
        private void DataPortal_Delete(int id)
        {
            var dal = new Dal.Cases();

            using (BypassPropertyChecks)
            {
                dal.Delete(id);
            }
        }
예제 #2
0
        private void GetRaceEthnicityList(int id, Dal.Cases dal)
        {
            RaceEthnicityList.Clear();
            var raceEthnicityList = dal.GetRaceEthnicity(id);

            if (raceEthnicityList != null)
            {
                RaceEthnicityList.AddRange(raceEthnicityList);
            }
        }
예제 #3
0
        private void GetVulnerabilityList(int id, Dal.Cases dal)
        {
            VulnerabilityList.Clear();
            var vulnerabilityList = dal.GetVulnerabilities(id);

            if (vulnerabilityList != null)
            {
                VulnerabilityList.AddRange(vulnerabilityList);
            }
        }
예제 #4
0
        private void GetCaseLawEnforcementList(int id, Dal.Cases dal)
        {
            CaseLawEnforcementList.Clear();
            var caseLawEnforcementList = dal.GetCaseLawEnforcementList(id);

            if (caseLawEnforcementList != null)
            {
                CaseLawEnforcementList.AddRange(caseLawEnforcementList.Select(r => new NameValueListBase <int, bool> .NameValuePair(r.AgencyId, r.Denial)));
            }
        }
예제 #5
0
        private void DataPortal_Fetch()
        {
            var dal = new Dal.Cases();

            IsReadOnly = false;
            foreach (var item in dal.Get())
            {
                Add(DataPortal.FetchChild <CaseInfo>(item));
            }
            IsReadOnly = true;
        }
예제 #6
0
        protected override void DataPortal_Update()
        {
            var dal = new Dal.Cases();

            using (BypassPropertyChecks)
            {
                var data = new Dal.CaseDal();
                Csla.Data.DataMapper.Map(this, data, ignoreList);
                dal.Update(data, RaceEthnicityList, VulnerabilityList, CaseLawEnforcementList.Select(r => new Dal.CaseLawEnforcementDal {
                    AgencyId = r.Key, Denial = r.Value
                }).ToList());
            }
        }
예제 #7
0
        private void DataPortal_Fetch(int id)
        {
            var dal  = new Dal.Cases();
            var data = dal.Get(id);

            using (BypassPropertyChecks)
            {
                Csla.Data.DataMapper.Map(data, this);
                GetRaceEthnicityList(id, dal);
                GetVulnerabilityList(id, dal);
                GetCaseLawEnforcementList(id, dal);
            }

            var cdal = new Dal.Counties();
            var c    = cdal.Get(CountyId);

            if (c != null)
            {
                County = c.Name;
            }
            else
            {
                County = "n/a";
            }

            var sdal = new Dal.Schools();
            var s    = sdal.Get(SchoolId);

            if (s != null)
            {
                School = s.Name;
            }
            else
            {
                School = "n/a";
            }
        }