Пример #1
0
 public virtual ActionResult SaveStudentProfile(StudentProfileModel studentProfileModel)
 {
     try
     {
         if (!ModelState.IsValid)
         {
             return(Json(new { isError = true, Message = @"ورودی نامعتبر!" }));
         }
         if (studentProfileModel.Gender == Gender.Famele)
         {
             studentProfileModel.MilitaryServiceStatus = MilitaryServiceStatus.None;
         }
         var levelId  = Convert.ToInt64(User.LevelId());
         var personId = _personManagementService.GetPersonIdbyStudentNumber(studentProfileModel.StudentNumber);
         studentProfileModel.PersonId = personId;
         var data = _personManagementService.AddOrUpdateStudentProfile(studentProfileModel, levelId);
         return(Json(new { isError = !data.Item1, Message = data.Item2 }));
     }
     catch (Exception exception)
     {
         return(Json(new { isError = true, Message = @"خطا در ثبت اطلاعات" }));
     }
 }