public SaveDefectsStatus UpdateVictimsPresence(vw_CaseDefectsData Victims, int SessionID) { // Cases_VictimsSessionsLog VicObj = new Cases_VictimsSessionsLog { SessionID = SessionID, VictimID = Victims.PersonID, PresenceStatusID = (int)Victims .Presence }; var VicObj = GetAll().Where(def => def.VictimID == Victims.ID).FirstOrDefault(); if (VicObj != null) { VicObj.SessionID = SessionID; VicObj.VictimID = Victims.ID; VicObj.PresenceStatusID = (int)Victims.Presence; Update(VicObj); Save(); return(SaveDefectsStatus.Saved_Before); } else { Cases_VictimsSessionsLog VicObject = new Cases_VictimsSessionsLog { SessionID = SessionID , VictimID = Victims.ID, PresenceStatusID = (int)Victims.Presence }; Add(VicObject); Save(); return(SaveDefectsStatus.Saved); } }
public SaveDefectsStatus UpdateDefentantsPresence(vw_CaseDefectsData Defentants, int SessionID) { // Cases_DefendatnsSessionsLog DefObj =new Cases_DefendatnsSessionsLog { SessionID = SessionID, DefendantID = Defentants.PersonID, PresenceStatusID = (int)Defentants.Presence, CourtStatusID = Defentants.Status }; var defend = GetAll().Where(def => def.DefendantID == Defentants.ID && def.SessionID == SessionID).FirstOrDefault(); if (defend != null) { defend.SessionID = SessionID; defend.DefendantID = Defentants.ID; defend.PresenceStatusID = (int)Defentants.Presence; defend.CourtStatusID = Defentants.Status; //??? Update(defend); Save(); return(SaveDefectsStatus.Saved_Before); } else { Cases_DefendatnsSessionsLog sessionlog = new Cases_DefendatnsSessionsLog(); sessionlog.SessionID = SessionID; sessionlog.DefendantID = Defentants.ID; sessionlog.PresenceStatusID = (int)Defentants.Presence; sessionlog.CourtStatusID = Defentants.Status; //??? Add(sessionlog); Save(); return(SaveDefectsStatus.Saved); } }
internal static vw_PersonData Map(vw_CaseDefectsData caseParty) { return(new vw_PersonData { address_address = caseParty.Address, address_CityID = caseParty.CityID, address_PoliceStationID = caseParty.PoliceStationID, //CBirthDate = caseParty.Birthdate, ID = caseParty.PersonID, Job = caseParty.JobName, Name = caseParty.Name, NatNo = caseParty.NationalID, PassportNo = caseParty.PassportNumber, PhoneNo = caseParty.PhoneNo, NationalityID = caseParty.NationalityType, CBirthDate = caseParty.Birthdate, }); }
internal static CasePartyViewModels Map(vw_CaseDefectsData party) { if (party != null) { return new CasePartyViewModels { id = party.ID, IsCivilRightProsecutor = party.IsCivilRightProsecutor, NationalID = party.NationalID, PartiesOrder = party.Order, PartyName = party.Name, PartyType = party.DefectType, CrimeTypes = (party.Crimes != null ? party.Crimes.Select(crime => crime.ID).ToList() : new List <int>()), OriginalPartyType = party.DefectType, DefendantStatus = party.Status, } } ; return(null); }
public ActionResult Edit(int CaseID, long PartyID, int PartyType) { if (CurrentUser != null) { vw_CaseDefectsData CaseParty = PartiesService.GetCaseDefect(CaseID, PartyID, (PartyTypes)PartyType); var ViewModel = PrepareCasePartiesViewModel(CaseID, Models.vw_PersonData.Map(CaseParty), CasePartyViewModels.Map(CaseParty)); string[] li = Regex.Split(ViewModel.PersonData.PersonData.address_address.ToString(), "/"); if (li[0] != null) { ViewModel.PersonData.PersonData.address_address = li[0]; } if (li[1] != null) { ViewModel.PersonData.PersonData.address_CityID = int.Parse(li[1]); } if (li[2] != null) { ViewModel.PersonData.PersonData.address_PoliceStationID = int.Parse(li[2]); } ViewModel.PersonData.PersonData.Age = CalculateAge(CaseParty.Birthdate.Value); ////لايمكن التعديل اذا تحركت القضية فى flow الا بموافقة مدير النظام if (PartiesService.CaseInFlow(CaseID) == CaseStatus.GoInFlow) { ViewModel.CaseInFlow = CaseStatus.GoInFlow; } if (CurrentUser.UserTypeID == (int)SystemUserTypes.ElementaryCourtAdministrator) { ViewModel.CaseInFlow = CaseStatus.NotGoInFlow; } ViewData["SessionEnded"] = true; return(CPartialView(ViewModel)); } else { ViewData["SessionEnded"] = true; return(CPartialView()); } }
public SaveDefectsStatus UpdatePresence(vw_CaseDefectsData DefectData, int SessionID) { return(VicRepository.UpdateVictimsPresence(DefectData, SessionID)); }
public SaveDefectsStatus UpdatePresenceOfDefects(List <vw_CaseDefectsData> DefectsList, int SessionID, out vw_CaseDefectsData Defect) { throw new NotImplementedException(); }