Пример #1
0
        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);
            }
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
            }
        }
Пример #5
0
 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);
         }
     }
 }
Пример #6
0
 public List <vw_KeyValueDate> GetSentToJudgeSessionDates(int JudgeID)
 {
     return(SessionsComp.GetSentToJudgeSessionDates(JudgeID));
 }
Пример #7
0
 public List <vw_RollCases> GetSessionsToApprove(int JudgeID, int RollID)
 {
     return(SessionsComp.GetSessionsToApprove(JudgeID, RollID));
 }
Пример #8
0
 public void ReturnSessionToSecretary(int SessionID)
 {
     SessionsComp.ReturnSessionToSecretary(SessionID);
 }
Пример #9
0
 public List <int> GetRollIDs(List <int> CaseIDs)
 {
     return(SessionsComp.GetRollIDs(CaseIDs));
 }
Пример #10
0
 public bool IsSessionSentToJudge(int SessionID)
 {
     return(SessionsComp.IsSentToJudge(SessionID));
 }
Пример #11
0
 public bool IsSessionMinutesSaved(int SessionID)
 {
     return(SessionsComp.IsSessionMinutesSaved(SessionID));
 }
Пример #12
0
 public IQueryable <vw_KeyValueDate> SessionByCicuit(int circuit)
 {
     return(SessionsComp.GetSessionByCircuit(circuit));
 }
Пример #13
0
 public string GetMinutesOfSession(int SessionID)
 {
     return(SessionsComp.GetMinutesOfSession(SessionID));
 }
Пример #14
0
 public vw_SessionData GetSessionData(int SessionID)
 {
     return(SessionsComp.GetSessionData(SessionID));
 }
Пример #15
0
        ///////// 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);
            }
        }
Пример #16
0
        public List <vw_KeyValueDate> GetCycleSessionDates(int SessionID)
        {
            int CircuitID = SessionsComp.GetCircuitID(SessionID);

            return(RollsComp.GetCircuitRolls(CircuitID).Where(x => x.Date > DateTime.Now).ToList());
        }