Exemple #1
0
 public ActionResult PreviousSchool(PreviousSchool previousSchool)
 {
     if (previousSchool.Id > 0)
     {
         SmsRepository.UpdatePreviousSchool(previousSchool);
     }
     else
     {
         SmsRepository.InsertPreviousSchool(previousSchool);
     }
     PreviousSchoolCommon();
     return(View());
 }
Exemple #2
0
 public static void InsertPreviousSchool(PreviousSchool previousSchool)
 {
     try
     {
         using (var db = new SMSContext())
         {
             db.PreviousSchools.Add(previousSchool);
             db.SaveChanges();
         }
     }
     catch (Exception exception)
     {
         LogManage.Log("MethodName:GetClassById " + Environment.NewLine + " Time: " + DateTime.Now + Environment.NewLine + " ErrorMsg: " + exception.Message);
     }
 }
Exemple #3
0
        public static PreviousSchool GetPreviousSchoolByStudentId(int studentId)
        {
            var previousSchoolStudentId = new PreviousSchool();

            try
            {
                using (var db = new SMSContext())
                {
                    previousSchoolStudentId = db.PreviousSchools.Single(x => x.Id == studentId);
                }
            }
            catch (Exception exception)
            {
                LogManage.Log("MethodName:GetClassById " + Environment.NewLine + " Time: " + DateTime.Now + Environment.NewLine + " ErrorMsg: " + exception.Message);
            }
            return(previousSchoolStudentId);
        }
Exemple #4
0
 public static void UpdatePreviousSchool(PreviousSchool previousSchool)
 {
     try
     {
         using (var db = new SMSContext())
         {
             var tempPreviousSchool = db.PreviousSchools.Single(x => x.Id == previousSchool.Id);
             tempPreviousSchool.StudentId     = previousSchool.StudentId;
             tempPreviousSchool.InstituteName = previousSchool.InstituteName;
             tempPreviousSchool.JoinDate      = previousSchool.JoinDate;
             tempPreviousSchool.LeaveDate     = previousSchool.LeaveDate;
         }
     }
     catch (Exception exception)
     {
         LogManage.Log("MethodName:GetClassById " + Environment.NewLine + " Time: " + DateTime.Now + Environment.NewLine + " ErrorMsg: " + exception.Message);
     }
 }