public void CaseLifecycleTransfer(DWCourt court) { try { IEnumerable <DWCaseLifecycle> dw = SelectCaseLifecycleTransfer(DWConstants.DWTransfer.TransferRowCounts, court); while (dw.Any()) { foreach (var current in dw) { bool insertRow = CaseLifecycleInsertUpdate(current); if (insertRow) { var main = repo.GetById <CaseLifecycle>(current.Id); main.DateTransferedDW = DateTime.Now; repo.Update <CaseLifecycle>(main); } } dwRepo.SaveChanges(); repo.SaveChanges(); // ts.Complete(); //} dw = SelectCaseLifecycleTransfer(DWConstants.DWTransfer.TransferRowCounts, court); } } catch (Exception ex) { var e = ex; throw; } }
public void CaseSelectionProtocolLawunitTransfer(DWCourt court) { IEnumerable <DWCaseSelectionProtocolLawunit> dw = SelectCaseSelectionProtokolLawUnit(DWConstants.DWTransfer.TransferRowCounts, court); while (dw.Any()) { foreach (var current in dw) { bool insertRow = CaseSelectionProtocolLawUnitInsertUpdate(current, court); if (insertRow) { var main = repo.GetById <CaseSelectionProtokolLawUnit>(current.Id); main.DateTransferedDW = DateTime.Now; repo.Update <CaseSelectionProtokolLawUnit>(main); } } dwRepo.SaveChanges(); repo.SaveChanges(); // ts.Complete(); //} dw = SelectCaseSelectionProtokolLawUnit(DWConstants.DWTransfer.TransferRowCounts, court); } }
public void CaseTransfer(DWCourt court) { IEnumerable <DWCase> dwcases = SelectCasesForTransfer(DWConstants.DWTransfer.TransferRowCounts, court); while (dwcases.Any()) { //using (TransactionScope ts = new TransactionScope()) foreach (var current_case in dwcases) { bool insertRow = CaseInsertUpdate(court, current_case); if (insertRow) { var main_case = repo.GetById <Case>(current_case.CaseId); main_case.DateTransferedDW = DateTime.Now; repo.Update <Case>(main_case); } } dwRepo.SaveChanges(); repo.SaveChanges(); // ts.Complete(); //} dwcases = SelectCasesForTransfer(DWConstants.DWTransfer.TransferRowCounts, court); } }
public void DocumentDecisionTransfer(DWCourt court) { IEnumerable <DWDocumentDecision> dwDocumentsDecisions = SelectDocumentDecisionTransfer(DWConstants.DWTransfer.TransferRowCounts, court); while (dwDocumentsDecisions.Any()) { foreach (var current in dwDocumentsDecisions) { bool insertRow = DocumentDecisionInsertUpdate(current, court); if (insertRow) { var main = repo.GetById <DocumentDecision>(current.Id); main.DateTransferedDW = DateTime.Now; repo.Update <DocumentDecision>(main); } } dwRepo.SaveChanges(); repo.SaveChanges(); // ts.Complete(); //} dwDocumentsDecisions = SelectDocumentDecisionTransfer(DWConstants.DWTransfer.TransferRowCounts, court); } }
public DWCourt GetCourtData(int?courtId) { DWCourt court = new DWCourt(); court = repo.AllReadonly <Court>() .Where(x => x.Id == courtId) .Select(x => new DWCourt() { CourtId = x.Id, CourtName = x.Label, CourtTypeId = x.CourtTypeId, CourtTypeName = x.CourtType.Label, ParentCourtId = x.ParentCourtId, ParentCourtName = x.ParentCourt.Label, CourtRegionId = x.CourtRegionId, CourtRegionName = x.CourtRegion.Label, EcliCode = x.EcliCode, EISPPCode = x.EISPPCode, CityCode = x.CityCode, CityName = x.CityName }).FirstOrDefault(); return(court); }
public void DocumentDecisionTransfer(DWCourt court) { serviceErrorLog.LogError((court.CourtId ?? 0), court.CourtName, "DocumentDecisionTransfer", 0, "Стартирал"); IEnumerable <DWDocumentDecision> dwDocumentsDecisions = SelectDocumentDecisionTransfer(DWConstants.DWTransfer.TransferRowCounts, court); bool insertRow = true; while (dwDocumentsDecisions.Any() && insertRow) { foreach (var current in dwDocumentsDecisions) { insertRow = DocumentDecisionInsertUpdate(current, court); if (insertRow) { var updResult = repo.ExecuteProc <UpdateDateTransferedVM>($"{UpdateDateTransferedVM.ProcedureName}({current.Id},'{UpdateDateTransferedVM.Tables.DocumentDecision}')"); //var main = repo.GetById<DocumentDecision>(current.Id); //main.DateTransferedDW = DateTime.Now; //repo.Update<DocumentDecision>(main); } } dwRepo.SaveChanges(); //repo.SaveChanges(); // ts.Complete(); //} dwDocumentsDecisions = SelectDocumentDecisionTransfer(DWConstants.DWTransfer.TransferRowCounts, court); } }
public void CaseLifecycleTransfer(DWCourt court) { try { serviceErrorLog.LogError((court.CourtId ?? 0), court.CourtName, "CaseLifecycleTransfer", 0, "Стартирал"); IEnumerable <DWCaseLifecycle> dw = SelectCaseLifecycleTransfer(DWConstants.DWTransfer.TransferRowCounts, court); bool insertRow = true; while (dw.Any() && insertRow) { foreach (var current in dw) { insertRow = CaseLifecycleInsertUpdate(current); if (insertRow) { var updResult = repo.ExecuteProc <UpdateDateTransferedVM>($"{UpdateDateTransferedVM.ProcedureName}({current.Id},'{UpdateDateTransferedVM.Tables.CaseLifecycle}')"); //var main = repo.GetById<CaseLifecycle>(current.Id); //main.DateTransferedDW = DateTime.Now; //repo.Update<CaseLifecycle>(main); } } dwRepo.SaveChanges(); //repo.SaveChanges(); // ts.Complete(); //} dw = SelectCaseLifecycleTransfer(DWConstants.DWTransfer.TransferRowCounts, court); } } catch (Exception ex) { //serviceErrorLog.LogError((current.CourtId ?? 0), current.CourtName, "case_lifecycle", current.CaseId, ex.Message); } }
public void CaseTransfer(DWCourt court) { serviceErrorLog.LogError((court.CourtId ?? 0), court.CourtName, "CaseTransfer", 0, "Стартирал"); IEnumerable <DWCase> dwcases = SelectCasesForTransfer(DWConstants.DWTransfer.TransferRowCounts, court); bool insertRow = true; while (dwcases.Any() && insertRow) { //using (TransactionScope ts = new TransactionScope()) foreach (var current_case in dwcases) { insertRow = CaseInsertUpdate(court, current_case); if (insertRow) { var updResult = repo.ExecuteProc <UpdateDateTransferedVM>($"{UpdateDateTransferedVM.ProcedureName}({current_case.CaseId},'{UpdateDateTransferedVM.Tables.Case}')"); //var main_case = repo.GetById<Case>(current_case.CaseId); //main_case.DateTransferedDW = DateTime.Now; //repo.Update<Case>(main_case); } } dwRepo.SaveChanges(); //repo.SaveChanges(); // ts.Complete(); //} dwcases = SelectCasesForTransfer(DWConstants.DWTransfer.TransferRowCounts, court); } }
public void SessionTransfer(DWCourt court) { serviceErrorLog.LogError((court.CourtId ?? 0), court.CourtName, "SessionTransfer", 0, "Стартирал"); IEnumerable <DWCaseSession> dwcasesSessions = SelectCasesSessionForTransfer(DWConstants.DWTransfer.TransferRowCounts, court); bool insertRow = true; while (dwcasesSessions.Any() && insertRow) { List <int> updateList = new List <int>(); foreach (var current_session in dwcasesSessions) { insertRow = SessionInsertUpdate(current_session, court); if (insertRow) { updateList.Add(current_session.Id); } } dwRepo.SaveChanges(); UpdateCaseSession(updateList, dwcasesSessions); dwcasesSessions = SelectCasesSessionForTransfer(DWConstants.DWTransfer.TransferRowCounts, court); } }
public IEnumerable <DWCaseSessionLawUnit> SelectCaseSessionLawUnitTransfer(DWCourt court, long sessionId) { IEnumerable <DWCaseSessionLawUnit> result = null; result = repo.AllReadonly <CaseLawUnit>() .Where(x => x.CaseSessionId == sessionId) .Where(x => x.DateTo == null) .Select(x => new DWCaseSessionLawUnit() { Id = x.Id, CaseId = x.CaseId, CaseSessionId = x.CaseSessionId, LawUnitId = x.LawUnitId, LawUnitFullName = x.LawUnit.FullName, JudgeRoleId = x.JudgeRoleId, JudgeRoleName = x.JudgeRole.Label, CourtDepartmentId = x.CourtDepartmentId, CourtDepartmentName = x.CourtDepartment.Label, CourtDutyId = x.CourtDutyId, CourtDutyName = x.CourtDuty.Label, CourtGroupId = x.CourtGroupId, CourtGroupName = x.CourtGroup.Label, JudgeDepartmentRoleId = x.JudgeDepartmentRoleId, JudgeDepartmentRoleName = x.JudgeDepartmentRole.Label, DateFrom = x.DateFrom, DateTo = x.DateTo, DateFromStr = x.DateFrom.ToString("dd.MM.yyyy"), //DateToStr = x.DateTo.Value.ToString("dd.MM.yyyy"), DateToStr = x.DateTo.HasValue ? x.DateTo.Value.ToString("dd.MM.yyyy") : "", Description = x.Description, CourtId = court.CourtId, CourtName = court.CourtName, CourtTypeId = court.CourtTypeId, CourtTypeName = court.CourtTypeName, ParentCourtId = court.ParentCourtId, ParentCourtName = court.ParentCourtName, CourtRegionId = court.CourtRegionId, CourtRegionName = court.CourtRegionName, EcliCode = court.EcliCode, EISPPCode = court.EISPPCode, CityCode = court.CityCode, CityName = court.CityName, DateExpired = x.CaseSession.DateExpired, DateExpiredStr = x.CaseSession.DateExpired.HasValue ? x.CaseSession.DateExpired.Value.ToString("dd.MM.yyyy") : "", } ); return(result); }
public void CaseLawUnitTransfer(DWCourt court, long CaseId) { IEnumerable <DWCaseLawUnit> dw = SelectCaseLawUnitTransfer(court, CaseId); foreach (var current in dw) { bool insertRow = CaseLawUnitInsertUpdate(current); } }
public void DocumentLinkTransfer(DWCourt court, long documenId) { IEnumerable <DWDocumentLink> dwDocumentLink = SelectDocumentLinkTransfer(documenId, court); foreach (var current in dwDocumentLink) { bool insertRow = DocumentLinkInsertUpdate(current); } // dwRepo.SaveChanges(); }
public void DocumentDecisionCaseTransfer(DWCourt court, long decisionId) { IEnumerable <DWDocumentDecisionCase> dwDocumentsDecisionCase = SelectDocumentDecisionCaseTransfer(decisionId, court); foreach (var current in dwDocumentsDecisionCase) { bool insertRow = DocumentDecisionCaseInsertUpdate(current); } // dwRepo.SaveChanges(); }
public void CaseSessionResultTransfer(DWCourt court, long SessionId) { IEnumerable <DWCaseSessionResult> dwcaseSessionResults = SelectCaseSessionResultTransfer(SessionId, court); foreach (var current in dwcaseSessionResults) { bool insertRow = CaseSessionResultInsertUpdate(current); } // dwRepo.SaveChanges(); }
public void DocumentInstitutionCaseInfoTransfer(DWCourt court, long documenId) { IEnumerable <DWDocumentInstitutionCaseInfo> dwDocumentsInstitutionCseInfo = SelectDocumentInstitutionCaseInfoTransfer(documenId, court); foreach (var current in dwDocumentsInstitutionCseInfo) { bool insertRow = DocumentInstitutionCaseInfoInsertUpdate(current); } //dwRepo.SaveChanges(); }
public DWCaseSession CaseSessionLawUnitTransfer(DWCourt court, DWCaseSession session) { IEnumerable <DWCaseSessionLawUnit> dw = SelectCaseSessionLawUnitTransfer(court, session.Id); DWCaseSession lu_session = new DWCaseSession(); int JudgeReporterId = 0; string JudgeReporterName = ""; string JudgeReporterStaff = ""; string SessionFullJudgeStaff = ""; string SessionJudgeStaff = ""; string SessionJuriStaff = ""; foreach (var current in dw) { bool insertRow = CaseSessionLawUnitInsertUpdate(current); if (current.DateTo == null) { if (current.JudgeRoleId == NomenclatureConstants.JudgeRole.JudgeReporter) { JudgeReporterId = current.LawUnitId; JudgeReporterName = current.LawUnitFullName; SessionFullJudgeStaff = SessionFullJudgeStaff + $"{current.LawUnitFullName}({current.JudgeRoleName}); "; } if (current.JudgeRoleId != NomenclatureConstants.JudgeRole.JudgeReporter && NomenclatureConstants.JudgeRole.JudgeRolesList.Contains(current.JudgeRoleId)) { SessionJudgeStaff = SessionJudgeStaff + $"{current.LawUnitFullName}({current.JudgeRoleName}); "; } if (NomenclatureConstants.JudgeRole.JuriRolesList.Contains(current.JudgeRoleId)) { SessionJuriStaff = SessionJuriStaff + $"{current.LawUnitFullName}({current.JudgeRoleName}); "; } } } lu_session.JudgeReporterId = JudgeReporterId; lu_session.JudgeReporterName = JudgeReporterName; lu_session.SessionJudgeStaff = SessionJudgeStaff; SessionFullJudgeStaff = SessionFullJudgeStaff + SessionJudgeStaff; lu_session.SessionFullJudgeStaff = SessionFullJudgeStaff; lu_session.SessionJuriStaff = SessionJuriStaff; lu_session.SessionFullStaff = SessionFullJudgeStaff + SessionJuriStaff; return(lu_session); }
public void SessionTransfer(DWCourt court) { IEnumerable <DWCaseSession> dwcasesSessions = SelectCasesSessionForTransfer(DWConstants.DWTransfer.TransferRowCounts, court); while (dwcasesSessions.Any()) { List <int> updateList = new List <int>(); foreach (var current_session in dwcasesSessions) { bool insertRow = SessionInsertUpdate(current_session, court); if (insertRow) { updateList.Add(current_session.Id); } } dwRepo.SaveChanges(); UpdateCaseSession(updateList, dwcasesSessions); dwcasesSessions = SelectCasesSessionForTransfer(DWConstants.DWTransfer.TransferRowCounts, court); } }
public void CaseSelectionProtocolLawunitTransfer(DWCourt court) { serviceErrorLog.LogError((court.CourtId ?? 0), court.CourtName, "CaseSelectionProtocolLawunitTransfer", 0, "Стартирал"); IEnumerable<DWCaseSelectionProtocolLawunit> dw = SelectCaseSelectionProtokolLawUnit(DWConstants.DWTransfer.TransferRowCounts, court); bool insertRow = true; while (dw.Any() && insertRow) { foreach (var current in dw) { insertRow = CaseSelectionProtocolLawUnitInsertUpdate(current, court); if (insertRow) { var updResult = repo.ExecuteProc<UpdateDateTransferedVM>($"{UpdateDateTransferedVM.ProcedureName}({current.Id},'{UpdateDateTransferedVM.Tables.CaseSelectionProtocolLawunit}')"); //var main = repo.GetById<CaseSelectionProtokolLawUnit>(current.Id); //main.DateTransferedDW = DateTime.Now; //repo.Update<CaseSelectionProtokolLawUnit>(main); } } dwRepo.SaveChanges(); //repo.SaveChanges(); // ts.Complete(); //} dw = SelectCaseSelectionProtokolLawUnit(DWConstants.DWTransfer.TransferRowCounts, court); } }
public void CasePersonTransfer(DWCourt court) { IEnumerable <DWCasePerson> dw = SelectCasePersonTransfer(DWConstants.DWTransfer.TransferRowCounts, court); while (dw.Any()) { foreach (var current in dw) { bool insertRow = CasePersonInsertUpdate(court, current); if (insertRow) { var main = repo.GetById <CasePerson>(current.Id); main.DateTransferedDW = DateTime.Now; repo.Update <CasePerson>(main); } } dwRepo.SaveChanges(); repo.SaveChanges(); dw = SelectCasePersonTransfer(DWConstants.DWTransfer.TransferRowCounts, court); } }
public bool CaseSelectionProtocolInsertUpdate(DWCaseSelectionProtocol current, DWCourt court) { bool result = false; try { DWCaseSelectionProtocol saved = dwRepo.All <DWCaseSelectionProtocol>().Where(x => x.Id == current.Id).FirstOrDefault(); if (saved == null) { current.DateTransferedDW = DateTime.Now; dwRepo.Add <DWCaseSelectionProtocol>(current); result = true; } else { saved.Id = current.Id; saved.CaseId = current.CaseId; saved.CompartmentID = current.CompartmentID; saved.CompartmentName = current.CompartmentName; saved.CaseLawUnitDismisalId = current.CaseLawUnitDismisalId; saved.CourtDutyId = current.CourtDutyId; saved.CourtDutyName = current.CourtDutyName; saved.CourtGroupName = current.CourtGroupName; saved.SelectionDate = current.SelectionDate; saved.JudgeRoleId = current.JudgeRoleId; saved.JudgeRoleName = current.JudgeRoleName; saved.SelectionModeId = current.SelectionModeId; saved.SelectionModeName = current.SelectionModeName; saved.SpecialityId = current.SpecialityId; saved.SpecialityName = current.SpecialityName; saved.IncludeCompartmentJudges = current.IncludeCompartmentJudges; saved.Description = current.Description; saved.SelectedLawUnitId = current.SelectedLawUnitId; saved.SelectedLawUnitName = current.SelectedLawUnitName; saved.SelectionProtokolStateId = current.SelectionProtokolStateId; saved.SelectionProtokolStateName = current.SelectionProtokolStateName; saved.DateTransferedDW = DateTime.Now; saved.DateWrt = current.DateWrt; saved.UserId = current.UserId; saved.UserName = current.UserName; saved.CourtId = current.CourtId; saved.DwCount = current.DwCount; saved.CourtName = current.CourtName; saved.CourtRegionId = current.CourtRegionId; saved.CourtRegionName = current.CourtRegionName; saved.CourtTypeId = current.CourtTypeId; saved.CourtTypeName = current.CourtTypeName; saved.ParentCourtId = current.ParentCourtId; saved.ParentCourtName = current.ParentCourtName; saved.EcliCode = current.EcliCode; saved.EISPPCode = current.EISPPCode; saved.CityCode = current.CityCode; saved.CityName = current.CityName; dwRepo.Update <DWCaseSelectionProtocol>(saved); result = true; } } catch (Exception ex) { throw; } return(result); }
public bool CaseSelectionProtocolLawUnitInsertUpdate(DWCaseSelectionProtocolLawunit current, DWCourt court) { bool result = false; try { DWCaseSelectionProtocolLawunit saved = dwRepo.All <DWCaseSelectionProtocolLawunit>().Where(x => x.Id == current.Id).FirstOrDefault(); if (saved == null) { current.DateTransferedDW = DateTime.Now; dwRepo.Add <DWCaseSelectionProtocolLawunit>(current); result = true; } else { saved.Id = current.Id; saved.LawUnitId = current.LawUnitId; saved.LawUnitName = current.LawUnitName; saved.CaseId = current.CaseId; saved.CaseSelectionProtokolId = current.CaseSelectionProtokolId; saved.SelectedFromCaseGroup = current.SelectedFromCaseGroup; saved.CaseCount = current.CaseCount; saved.LoadIndex = current.LoadIndex; saved.CaseGroupId = current.CaseGroupId; saved.CaseGroupName = current.CaseGroupName; saved.StateId = current.StateId; saved.StateName = current.StateName; saved.DateTransferedDW = DateTime.Now; saved.DateWrt = current.DateWrt; saved.UserId = current.UserId; saved.UserName = current.UserName; saved.CourtId = current.CourtId; saved.DwCount = current.DwCount; saved.CourtName = current.CourtName; saved.CourtRegionId = current.CourtRegionId; saved.CourtRegionName = current.CourtRegionName; saved.CourtTypeId = current.CourtTypeId; saved.CourtTypeName = current.CourtTypeName; saved.ParentCourtId = current.ParentCourtId; saved.ParentCourtName = current.ParentCourtName; saved.EcliCode = current.EcliCode; saved.EISPPCode = current.EISPPCode; saved.CityCode = current.CityCode; saved.CityName = current.CityName; dwRepo.Update <DWCaseSelectionProtocolLawunit>(saved); result = true; } } catch (Exception ex) { throw; } return(result); }
public IEnumerable <DWDocumentDecisionCase> SelectDocumentDecisionCaseTransfer(long decisionId, DWCourt court) { IEnumerable <DWDocumentDecisionCase> result = null; result = repo.AllReadonly <DocumentDecisionCase>() .Where(x => x.DocumentDecisionId == decisionId) .Select(x => new DWDocumentDecisionCase() { Id = x.Id, Description = x.Description, DecisionTypeId = x.DecisionTypeId, DecisionTypeName = x.DecisionType.Label, DocumentDecisionId = x.DocumentDecisionId, UserId = x.DocumentDecision.UserId, UserName = x.DocumentDecision.User.LawUnit.FullName, DateTransferedDW = DateTime.Now, CourtId = court.CourtId, CourtName = court.CourtName, CourtTypeId = court.CourtTypeId, CourtTypeName = court.CourtTypeName, ParentCourtId = court.ParentCourtId, ParentCourtName = court.ParentCourtName, CourtRegionId = court.CourtRegionId, CourtRegionName = court.CourtRegionName, EcliCode = court.EcliCode, EISPPCode = court.EISPPCode, CityCode = court.CityCode, CityName = court.CityName }); return(result); }
public IEnumerable <DWCaseSelectionProtocol> SelectCaseSelectionProtokol(int selectedRowCount, DWCourt court) { Expression <Func <CaseSelectionProtokol, bool> > selectedCourt = x => true; if (court.CourtId != null) { selectedCourt = x => x.CourtId == court.CourtId; } IEnumerable <DWCaseSelectionProtocol> result = null; DateTime oldDate = new DateTime(1900, 01, 01); result = repo.AllReadonly <CaseSelectionProtokol>() .Where(selectedCourt) .Where(x => x.DateWrt > (x.DateTransferedDW ?? oldDate)) .Select(x => new DWCaseSelectionProtocol() { Id = x.Id, CaseId = x.CaseId, CompartmentID = x.CompartmentID, CompartmentName = x.CompartmentName, CaseLawUnitDismisalId = x.CaseLawUnitDismisalId, CourtDutyId = x.CourtDutyId, CourtDutyName = x.CourtDuty.Description, CourtGroupId = x.Case.CourtGroupId, CourtGroupName = x.Case.CourtGroup.Label, SelectionDate = x.SelectionDate, JudgeRoleId = x.JudgeRoleId, JudgeRoleName = x.JudgeRole.Label, SelectionModeId = x.SelectionModeId, SelectionModeName = x.SelectionMode.Label, SpecialityId = x.SpecialityId, SpecialityName = x.Speciality.Label, IncludeCompartmentJudges = x.IncludeCompartmentJudges, Description = x.Description, SelectedLawUnitId = x.SelectedLawUnitId, SelectedLawUnitName = x.SelectedLawUnit.FullName, SelectionProtokolStateId = x.SelectionProtokolStateId, SelectionProtokolStateName = x.SelectionProtokolState.Label, DateTransferedDW = DateTime.Now, DateWrt = x.DateWrt, UserId = x.UserId, UserName = x.User.LawUnit.FullName, CourtId = court.CourtId, CourtName = court.CourtName, CourtTypeId = court.CourtTypeId, CourtTypeName = court.CourtTypeName, ParentCourtId = court.ParentCourtId, ParentCourtName = court.ParentCourtName, CourtRegionId = court.CourtRegionId, CourtRegionName = court.CourtRegionName, EcliCode = court.EcliCode, EISPPCode = court.EISPPCode, CityCode = court.CityCode, CityName = court.CityName }).OrderBy(x => x.CourtId).Take(selectedRowCount); return(result); }
public IEnumerable <DWCaseSelectionProtocolLawunit> SelectCaseSelectionProtokolLawUnit(int selectedRowCount, DWCourt court) { Expression <Func <CaseSelectionProtokolLawUnit, bool> > selectedCourt = x => true; if (court.CourtId != null) { selectedCourt = x => x.CourtId == court.CourtId; } IEnumerable <DWCaseSelectionProtocolLawunit> result = null; DateTime oldDate = new DateTime(1900, 01, 01); result = repo.AllReadonly <CaseSelectionProtokolLawUnit>() .Where(selectedCourt) .Where(x => x.DateWrt > (x.DateTransferedDW ?? oldDate)) .Select(x => new DWCaseSelectionProtocolLawunit() { Id = x.Id, CaseId = x.CaseId, LawUnitId = x.LawUnitId, LawUnitName = x.LawUnit.FullName, LoadIndex = x.LoadIndex, CaseCount = x.CaseCount, SelectedFromCaseGroup = x.SelectedFromCaseGroup, CaseGroupId = x.CaseGroupId, CaseGroupName = x.CaseGroup.Label, StateId = x.StateId, StateName = x.State.Label, CaseSelectionProtokolId = x.CaseSelectionProtokolId, Description = x.Description, DateTransferedDW = DateTime.Now, DateWrt = x.DateWrt, UserId = x.UserId, UserName = x.User.LawUnit.FullName, CourtId = court.CourtId, CourtName = court.CourtName, CourtTypeId = court.CourtTypeId, CourtTypeName = court.CourtTypeName, ParentCourtId = court.ParentCourtId, ParentCourtName = court.ParentCourtName, CourtRegionId = court.CourtRegionId, CourtRegionName = court.CourtRegionName, EcliCode = court.EcliCode, EISPPCode = court.EISPPCode, CityCode = court.CityCode, CityName = court.CityName }).OrderBy(x => x.CourtId).Take(selectedRowCount); return(result); }
public IEnumerable <DWDocumentDecision> SelectDocumentDecisionTransfer(int selectedRowCount, DWCourt court) { Expression <Func <DocumentDecision, bool> > selectedCourt = x => true; if (court.CourtId != null) { selectedCourt = x => x.CourtId == court.CourtId; } IEnumerable <DWDocumentDecision> result = null; DateTime oldDate = new DateTime(1900, 01, 01); result = repo.AllReadonly <DocumentDecision>() .Where(selectedCourt) .Where(x => x.DateWrt > (x.DateTransferedDW ?? oldDate)) .Select(x => new DWDocumentDecision() { Id = x.Id, DecisionTypeId = x.DecisionTypeId, DecisionTypeName = x.DecisionType.Label, DocumentId = x.DocumentId, Description = x.Description, DocumentDecisionStateId = x.DocumentDecisionStateId, DocumentDecisionStateName = x.DocumentDecisionState.Label, OutDocumentId = x.OutDocumentId, RegDate = x.RegDate, RegNumber = x.RegNumber, UserDecisionId = x.UserDecisionId, UserDecisionName = x.UserDecision.LawUnit.FullName, DateTransferedDW = DateTime.Now, DateWrt = x.DateWrt, UserId = x.UserId, UserName = x.User.LawUnit.FullName, CourtId = court.CourtId, CourtName = court.CourtName, CourtTypeId = court.CourtTypeId, CourtTypeName = court.CourtTypeName, ParentCourtId = court.ParentCourtId, ParentCourtName = court.ParentCourtName, CourtRegionId = court.CourtRegionId, CourtRegionName = court.CourtRegionName, EcliCode = court.EcliCode, EISPPCode = court.EISPPCode, CityCode = court.CityCode, CityName = court.CityName }).OrderBy(x => x.CourtId).Take(selectedRowCount); return(result); }
public bool DocumentDecisionInsertUpdate(DWDocumentDecision current, DWCourt court) { bool result = false; try { DWDocumentDecision saved = dwRepo.All <DWDocumentDecision>().Where(x => x.Id == current.Id).FirstOrDefault(); if (saved == null) { current.DateTransferedDW = DateTime.Now; dwRepo.Add <DWDocumentDecision>(current); result = true; } else { saved.Id = current.Id; saved.DocumentId = current.DocumentId; saved.DateWrt = current.DateWrt; saved.DecisionTypeId = current.DecisionTypeId; saved.DecisionTypeName = current.DecisionTypeName; saved.Description = current.Description; saved.DocumentDecisionStateId = current.DocumentDecisionStateId; saved.DocumentDecisionStateName = current.DocumentDecisionStateName; saved.OutDocumentId = current.OutDocumentId; saved.UserDecisionId = saved.UserDecisionId; saved.UserDecisionName = saved.UserDecisionName; saved.RegNumber = current.RegNumber; saved.RegDate = current.RegDate; saved.DateTransferedDW = current.DateTransferedDW; saved.DateWrt = current.DateWrt; saved.UserId = current.UserId; saved.UserName = current.UserName; saved.CourtId = current.CourtId; saved.DwCount = current.DwCount; saved.CourtName = current.CourtName; saved.CourtRegionId = current.CourtRegionId; saved.CourtRegionName = current.CourtRegionName; saved.CourtTypeId = current.CourtTypeId; saved.CourtTypeName = current.CourtTypeName; saved.ParentCourtId = current.ParentCourtId; saved.ParentCourtName = current.ParentCourtName; saved.EcliCode = current.EcliCode; saved.EISPPCode = current.EISPPCode; saved.CityCode = current.CityCode; saved.CityName = current.CityName; dwRepo.Update <DWDocumentDecision>(saved); result = true; } if (result) { DocumentDecisionCaseTransfer(court, current.Id); } } catch (Exception ex) { serviceErrorLog.LogError((current.CourtId ?? 0), current.CourtName, "document_decision", current.Id, ex.Message); } return(result); }
public IEnumerable <DWDocumentInstitutionCaseInfo> SelectDocumentInstitutionCaseInfoTransfer(long documentId, DWCourt court) { IEnumerable <DWDocumentInstitutionCaseInfo> result = null; result = repo.AllReadonly <DocumentInstitutionCaseInfo>() .Where(x => x.DocumentId == documentId) .Select(x => new DWDocumentInstitutionCaseInfo() { Id = x.Id, InstitutionId = x.InstitutionId, InstitutionName = x.Institution.FullName, InstitutionCaseTypeId = x.InstitutionCaseTypeId, InstitutionCaseTypeName = x.InstitutionCaseType.Label, CaseNumber = x.CaseNumber, CaseYear = x.CaseYear, Description = x.Description, DateWrt = x.Document.DateWrt, DocumentId = x.DocumentId, UserId = x.Document.UserId, UserName = x.Document.User.UserName, DateTransferedDW = DateTime.Now, CourtId = court.CourtId, CourtName = court.CourtName, CourtTypeId = court.CourtTypeId, CourtTypeName = court.CourtTypeName, ParentCourtId = court.ParentCourtId, ParentCourtName = court.ParentCourtName, CourtRegionId = court.CourtRegionId, CourtRegionName = court.CourtRegionName, EcliCode = court.EcliCode, EISPPCode = court.EISPPCode, CityCode = court.CityCode, CityName = court.CityName }); return(result); }
public IEnumerable <DWDocumentLink> SelectDocumentLinkTransfer(long documentId, DWCourt court) { IEnumerable <DWDocumentLink> result = null; result = repo.AllReadonly <DocumentLink>() .Where(x => x.DocumentId == documentId) .Select(x => new DWDocumentLink() { Id = x.Id, Description = x.Description, DocumentDirectionId = x.DocumentDirectionId, DocumentDirectionName = x.DocumentDirection.Label, PrevDocumentDate = x.PrevDocumentDate, PrevDocumentNumber = x.PrevDocumentNumber, PrevDocumentId = x.PrevDocumentId, DocumentId = x.DocumentId, UserId = x.Document.UserId, UserName = x.Document.User.UserName, DateTransferedDW = DateTime.Now, CourtId = court.CourtId, CourtName = court.CourtName, CourtTypeId = court.CourtTypeId, CourtTypeName = court.CourtTypeName, ParentCourtId = court.ParentCourtId, ParentCourtName = court.ParentCourtName, CourtRegionId = court.CourtRegionId, CourtRegionName = court.CourtRegionName, EcliCode = court.EcliCode, EISPPCode = court.EISPPCode, CityCode = court.CityCode, CityName = court.CityName }); return(result); }
public bool DocumentInsertUpdate(DWDocument current, DWCourt court) { bool result = false; try { DWDocument saved = dwRepo.All <DWDocument>().Where(x => x.Id == current.Id).FirstOrDefault(); if (saved == null) { current.DateTransferedDW = DateTime.Now; dwRepo.Add <DWDocument>(current); result = true; } else { saved.Id = current.Id; saved.ActualDocumentDate = current.ActualDocumentDate; saved.DeliveryGroupId = current.DeliveryGroupId; saved.DeliveryGroupName = current.DeliveryGroupName; saved.DeliveryTypeId = current.DeliveryTypeId; saved.DeliveryTypeName = current.DeliveryTypeName; saved.Description = current.Description; saved.DocumentDate = current.DocumentDate; saved.DocumentDirectionId = current.DocumentDirectionId; saved.DocumentDirectionName = current.DocumentDirectionName; saved.DocumentGroupId = current.DocumentGroupId; saved.DocumentGroupName = current.DocumentGroupName; saved.DocumentNumber = current.DocumentNumber; saved.DocumentNumberValue = current.DocumentNumberValue; saved.DocumentTypeId = current.DocumentTypeId; saved.DocumentTypeName = current.DocumentTypeName; saved.IsOldNumber = current.IsOldNumber; saved.IsRestictedAccess = current.IsRestictedAccess; saved.IsSecret = current.IsSecret; saved.DateTransferedDW = DateTime.Now; saved.DateWrt = current.DateWrt; saved.UserId = current.UserId; saved.UserName = current.UserName; saved.CourtId = current.CourtId; saved.DwCount = current.DwCount; saved.CourtName = current.CourtName; saved.CourtRegionId = current.CourtRegionId; saved.CourtRegionName = current.CourtRegionName; saved.CourtTypeId = current.CourtTypeId; saved.CourtTypeName = current.CourtTypeName; saved.ParentCourtId = current.ParentCourtId; saved.ParentCourtName = current.ParentCourtName; saved.EcliCode = current.EcliCode; saved.EISPPCode = current.EISPPCode; saved.CityCode = current.CityCode; saved.CityName = current.CityName; dwRepo.Update <DWDocument>(saved); result = true; } if (result) { DocumentCaseInfoTransfer(court, current.Id); DocumentPersonTransfer(court, current.Id); DocumentLinkTransfer(court, current.Id); DocumentInstitutionCaseInfoTransfer(court, current.Id); } } catch (Exception ex) { serviceErrorLog.LogError((court.CourtId ?? 0), court.CourtName, "document", current.Id, ex.Message); } return(result); }
public IEnumerable <DWDocumentPerson> SelectDocumentPersonTransfer(long documentId, DWCourt court) { var session_act = repo.AllReadonly <CaseSessionAct>(); IEnumerable <DWDocumentPerson> result = null; result = repo.AllReadonly <DocumentPerson>() .Where(x => x.DocumentId == documentId) .Select(x => new DWDocumentPerson() { Id = x.Id, DateWrt = x.Document.DateWrt, Family2Name = x.Family2Name, FamilyName = x.FamilyName, FirstName = x.FirstName, FullName = x.FullName, LatinName = x.LatinName, MiddleName = x.MiddleName, MilitaryRangId = x.MilitaryRangId, MilitaryRangName = x.MilitaryRang.Label, PersonMaturityId = x.PersonMaturityId, PersonMaturityName = x.PersonMaturity.Label, PersonId = x.PersonId, PersonRoleId = x.PersonRoleId, PersonRoleName = x.PersonRole.Label, Person_SourceId = x.Person_SourceId, //Person_SourceName= to do Person_SourceType = x.Person_SourceType, //Person_SourceTypeName = to do Uic = x.Uic, UicTypeId = x.UicTypeId, UicTypeName = x.UicType.Label, DocumentId = x.DocumentId, UserId = x.Document.UserId, UserName = x.Document.User.UserName, DateTransferedDW = DateTime.Now, CourtId = court.CourtId, CourtName = court.CourtName, CourtTypeId = court.CourtTypeId, CourtTypeName = court.CourtTypeName, ParentCourtId = court.ParentCourtId, ParentCourtName = court.ParentCourtName, CourtRegionId = court.CourtRegionId, CourtRegionName = court.CourtRegionName, EcliCode = court.EcliCode, EISPPCode = court.EISPPCode, CityCode = court.CityCode, CityName = court.CityName }); return(result); }