Ejemplo n.º 1
0
 public static bool DeleteStudy(int studyId)
 {
     try
     {
         DbEntry.UsingTransaction(delegate
         {
             Study st    = Study.FindById(studyId);
             st.IsDelete = true;
             st.Save();
         });
     }
     catch { return(false); }
     return(true);
 }
Ejemplo n.º 2
0
 public static bool UpdateStudy(int studyId, string school, string grade, string major, string protector, string relationship, string phoneNo)
 {
     try
     {
         DbEntry.UsingTransaction(delegate
         {
             Study st        = Study.FindById(studyId);
             st.School       = school;
             st.Grade        = grade;
             st.Major        = major;
             st.Protector    = protector;
             st.Relationship = relationship;
             st.PhoneNo      = phoneNo;
             st.Save();
         });
     }
     catch { return(false); }
     return(true);
 }