Example #1
0
        public List <vw_CaseDefectsData> GetDefectsByCaseID(int CaseID)
        {
            List <vw_CaseDefectsData> DefectsList = new List <vw_CaseDefectsData>();

            DefectsList.AddRange(DefentantsComponent.GetDefendantsByCaseID(CaseID));
            DefectsList.AddRange(VictimsComponent.GetVictimsByCaseID(CaseID));
            return(DefectsList);
        }
Example #2
0
        public List <vw_CaseDefectsData> GetDefectsByCaseID(int CaseID, int SessionID)
        {
            List <vw_CaseDefectsData> DefectsList = new List <vw_CaseDefectsData>();

            DefectsList.AddRange(DefentantsComponent.GetDefendantsByCaseID(CaseID, SessionID));
            DefectsList.AddRange(VictimsComponent.GetVictimsByCaseID(CaseID, SessionID));

            DefectsList = DefectsList.GroupBy(e => new { e.PersonID, e.DefectType }).Select(e => e.OrderBy(d => d.PersonID).ThenBy(c => c.DefectType).LastOrDefault()).Distinct().ToList();
            return(DefectsList);
        }
Example #3
0
        internal bool DeleteCaseDefects(int caseID)
        {
            var Defendants = DefentantsComponent.GetDefendantsByCaseID(caseID);

            foreach (var Defendant in Defendants)
            {
                if (DefentantsComponent.DeleteDefendant(caseID, Defendant.ID) == DeleteDefectStatus.NotDeleted)
                {
                    return(false);
                }
            }
            var Victims = VictimsComponent.GetVictimsByCaseID(caseID);

            foreach (var Victim in Victims)
            {
                if (VictimsComponent.DeleteVictim(caseID, Victim.ID) == DeleteDefectStatus.NotDeleted)
                {
                    return(false);
                }
            }
            return(true);
        }