public ApproveByJudgeStatus ApproveSessionByJudge(int SessionID, int CaseID) { try { if (!DefSessionLogComp.IsPresenceSaved(SessionID) || !VictimsSessionLogComp.IsPresenceSaved(SessionID)) { return(ApproveByJudgeStatus.Failed_DefectsPresence); } if (!DecisionsComp.IsDecisionSaved(SessionID)) { return(ApproveByJudgeStatus.Failed_Decision); } if (!SessionsComp.IsSessionMinutesSaved(SessionID)) { return(ApproveByJudgeStatus.Failed_Decision); } if (!AttachementComp.IsAttachementsSaved(CaseID)) { return(ApproveByJudgeStatus.Failed_Decision); } SessionsComp.ApproveSessionByJudge(SessionID); // update case status after approve in table cases return(ApproveByJudgeStatus.SessionApprovedSuccessfully); } catch (Exception ex) { HandleException(ex); return(ApproveByJudgeStatus.Failed); } }
public ApproveByJudgeStatus SendSessionToJudge(int SessionID, int CaseID) { try { if (!AttachementComp.IsAttachementsSaved(CaseID)) { return(ApproveByJudgeStatus.Failed_Attachements); } if (!DefSessionLogComp.IsPresenceSaved(SessionID) || !VictimsSessionLogComp.IsPresenceSaved(SessionID)) { return(ApproveByJudgeStatus.Failed_DefectsPresence); } if (!SessionsComp.IsSessionMinutesSaved(SessionID)) { return(ApproveByJudgeStatus.Failed_Session); } if (!DecisionsComp.IsDecisionSaved(SessionID)) { return(ApproveByJudgeStatus.Failed_Decision); } SessionsComp.SendSessionToJudge(SessionID); return(ApproveByJudgeStatus.SessionSentSuccessfully); } catch (Exception ex) { HandleException(ex); return(ApproveByJudgeStatus.Failed); } }
public vw_CaseData GetCaseData(int CaseID) { vw_CaseData CaseFulldata = new vw_CaseData(); CaseFulldata.CaseBasicData = CaseComponent.GetCaseData(CaseID); CaseFulldata.Defendants = DefendantsComp.GetDefendantsByCaseID(CaseID); CaseFulldata.Victims = VictimsComp.GetVictimsByCaseID(CaseID); CaseFulldata.CaseDecision = DecisionsComp.GetCaseDecisions(CaseID); CaseFulldata.CaseSessions = SessionsComp.GetSessionDataByCaseID(CaseID); CaseFulldata.OrderOfAssignment = OrderOfAssignmentComponent.GetOrderByID(CaseID); // CaseFulldata.CaseDescription = DescComponent .GetCaseDescriptionByCaseID (CaseID); List <vw_Documents> Doc = AttachComponent.GetDocuments(CaseID, null, null).ToList(); List <vw_CaseDocuments> Documents = new List <vw_CaseDocuments>(); foreach (vw_Documents d in Doc) { Documents.Add(new vw_CaseDocuments { DocumentID_Guid = d.ID, DocumentName = d.DocumentTitle }); } CaseFulldata.Documents = Documents; return(CaseFulldata); }
public AddWitnessStatus AddNewWitness(vw_PersonData WitnessData, int CaseID, int SessionID, byte[] FileData, int UserID, SystemUserTypes UserType) { if (UserType == SystemUserTypes.Secretary) { // check if person is not from the circuit members if (CM.IsPersonIsCircuitMember((int)WitnessData.ID, CaseID)) { return(AddWitnessStatus.IsCircuitMemeber); } // check if the session is not sent to judge if (SessionsComp.IsSentToJudge(SessionID)) { return(AddWitnessStatus.IsSentToJudge); } } // check if the person is not a victim if (VictimsComponent.IsPersonInCase(WitnessData.ID, CaseID)) { return(AddWitnessStatus.IsVictim); } // check if the person is not a defendant if (DefentantsComponent.IsPersonInCase(WitnessData.ID, CaseID)) { return(AddWitnessStatus.IsDefendant); } // Check if person didn't connected to the case before if (WitnessesComponent.IsConnectedToTheCase((int)WitnessData.ID, CaseID)) { return(AddWitnessStatus.SavedBefore); } //ToDo: check if the person is not a lawyer in the case long PersonID = WitnessData.ID; // if the person isn't in the database , add it if (WitnessData.ID == 0) { PersonComp.AddPerson(WitnessData, out PersonID); } try { WitnessesComponent.AddNewWitness((int)PersonID, CaseID, FileData, UserID); return(AddWitnessStatus.AddedSuccessfully); } catch (Exception e) { HandleException(e); return(AddWitnessStatus.FailedToAdd); } }
public SaveMinutesOfSessionStatus SaveMinutesOfSession(vw_MinutesOfSession MinutesOfSession) { if (SessionsComp.IsAppprovedByJudge(MinutesOfSession.SessionID)) { return(SaveMinutesOfSessionStatus.SessionApprovedByJudge); } if (SessionsComp.IsSentToJudge(MinutesOfSession.SessionID)) { return(SaveMinutesOfSessionStatus.SessionSentToJudge); } else { try { SessionsComp.SaveMinutesOfSession(MinutesOfSession); return(SaveMinutesOfSessionStatus.Succeeded); } catch (Exception ex) { HandleException(ex); return(SaveMinutesOfSessionStatus.Failed); } } }
public List <vw_KeyValueDate> GetSentToJudgeSessionDates(int JudgeID) { return(SessionsComp.GetSentToJudgeSessionDates(JudgeID)); }
public List <vw_RollCases> GetSessionsToApprove(int JudgeID, int RollID) { return(SessionsComp.GetSessionsToApprove(JudgeID, RollID)); }
public void ReturnSessionToSecretary(int SessionID) { SessionsComp.ReturnSessionToSecretary(SessionID); }
public List <int> GetRollIDs(List <int> CaseIDs) { return(SessionsComp.GetRollIDs(CaseIDs)); }
public bool IsSessionSentToJudge(int SessionID) { return(SessionsComp.IsSentToJudge(SessionID)); }
public bool IsSessionMinutesSaved(int SessionID) { return(SessionsComp.IsSessionMinutesSaved(SessionID)); }
public IQueryable <vw_KeyValueDate> SessionByCicuit(int circuit) { return(SessionsComp.GetSessionByCircuit(circuit)); }
public string GetMinutesOfSession(int SessionID) { return(SessionsComp.GetMinutesOfSession(SessionID)); }
public vw_SessionData GetSessionData(int SessionID) { return(SessionsComp.GetSessionData(SessionID)); }
///////// check ApprovedByJudge from CaseSessions in case of editing Decision public SaveDecisionStatus SaveDecision(vw_CaseDecision DecisionData) { try { // From SessionID get CaseID & RollID to set old rollID DecisionData.RollID = SessionsComp.GetRollID(DecisionData.CaseSessionID); DecisionData.OldCircuitID = SessionsComp.GetCircuitID(DecisionData.CaseSessionID); // check RollStatusID from CircuitRolls before Saving data if (!RollsComp.IsRollOpened((int)DecisionData.RollID)) { return(SaveDecisionStatus.RollNotOpenedYet); } if (SessionsComp.IsSentToJudge(DecisionData.CaseSessionID)) { return(SaveDecisionStatus.SessionSentToJudge); } if (RollsComp.IsApprovedByJudge((int)DecisionData.RollID)) { return(SaveDecisionStatus.SentToJudge); } DeleteIfSavedBefore(DecisionData); // override saved before decision if (DecisionData.DecisionLevel == DecisionLevels.Post || (DecisionData.DecisionLevel == DecisionLevels.Decision && DecisionData.DecisionType == DecisionTypes.L3_Postponed)) { //check if new roll exist, if not create it DecisionData.RollID = SetNewRollID((int)DecisionData.CycleRollID, (int)DecisionData.OldCircuitID, (DateTime)DecisionData.NextSessionDate); vw_SessionData SessionData; SessionData = new vw_SessionData { CaseID = DecisionData.CaseID, RollID = (int)DecisionData.RollID, DoneByDefaultCircuit = true, ApprovedByJudge = false, RollIndex = 0 }; // add session for the created roll SessionsComp.AddSession(SessionData); } // Save Decision DecisionsComp.SaveDecision(DecisionData); Event(new CaseDessionSaved { CaseID = DecisionData.CaseID, DecisionLevel = DecisionData.DecisionLevel, ReservedForJudgement = DecisionData.ReservedForJudgement, DecisionType = DecisionData.DecisionType }); if (DecisionData.DecisionLevel == DecisionLevels.Final) { foreach (vw_DefendantsDecisionData Def in DecisionData.DefendantsListJudges) { if (Def.DecisionType == (int)DecisionTypes.L1_Guilty) { Def.IsGuilty = true; } else if (Def.DecisionType == (int)DecisionTypes.L1_NotGuilty) { Def.IsGuilty = false; } Def.SessionDessionId = DecisionData.CaseSessionID; DefentantsComp.AddDefendantDecision(Def); } } return(SaveDecisionStatus.Saved); } catch (DbEntityValidationException ex) { HandleException(ex); return(SaveDecisionStatus.Failed_To_Save); } }
public List <vw_KeyValueDate> GetCycleSessionDates(int SessionID) { int CircuitID = SessionsComp.GetCircuitID(SessionID); return(RollsComp.GetCircuitRolls(CircuitID).Where(x => x.Date > DateTime.Now).ToList()); }