Ejemplo n.º 1
0
 public bool updateIncident(int inciID, string date, string dateReported, string time, string location, string incident, string result, string notes, string followUp, int orgID, string reportedBy, List <MemberList> memberList, List <NonMemberList> nonMemberList)
 {
     try
     {
         dataContext.sp_DeletepeopleInvoluvedForIncident(inciID);
         dataContext.sp_DeleteNonMembersInvoluvedForIncident(inciID);
         dataContext.sp_UpdateIncident(inciID, date, dateReported, location, incident, result, notes, followUp, reportedBy, time, orgID);
         dataContext.SubmitChanges();
     }
     catch (Exception e)
     {
         return(false);
     }
     for (int i = 0; i < memberList.Count; ++i)
     {
         dataContext.sp_NewPeopleInvoluved(Convert.ToInt32(memberList[i].Student_ID), inciID);
         try
         {
             dataContext.SubmitChanges();
         }
         catch (Exception e)
         {
             return(false);
         }
     }
     for (int i = 0; i < nonMemberList.Count; ++i)
     {
         try
         {
             dataContext.sp_NewNonMembersInvoluved(nonMemberList[i].ID, nonMemberList[i].Name, inciID);
             dataContext.SubmitChanges();
         }
         catch (Exception e)
         {
             return(false);
         }
     }
     return(true);
 }