public static int RegistrationStudentToBranch(int studentId, int branchId) { string entryHebrewDate = DateConverter.GetHebrewDate(DateTime.Today); int insert = BranchStudentDataManager.RegistrationStudentToBranch(studentId, branchId, entryHebrewDate); return(insert); }
public static int ApprovalRegistrationStudent(int branchStudentId) { try { string entryHebrewDate = DateConverter.GetHebrewDate(DateTime.Today); int update = BranchStudentDataManager.ApprovalRegistrationStudent(branchStudentId, entryHebrewDate); return(update); } catch (Exception) { _logger.Debug($"Failed to approve registration for the student in this branchbranch."); throw; } }
public static int SetBranchOfStudentInactive(int studentId) { try { int update = 0; BranchesStudents branchesStudent = BranchStudentDataManager.GetActiveBranchesOfStudent(studentId, Student.Includes.Branch); string releaseHebrewDate = DateConverter.GetHebrewDate(DateTime.UtcNow); foreach (BranchStudent branchStudent in branchesStudent) { update = BranchStudentDataManager.SetStudentInactiveInBranch(studentId, branchStudent.Branch.Id, releaseHebrewDate); BranchManager.ReduceNumberOfStudents(branchStudent.Branch.Id); } return(update); } catch (Exception ex) { _logger.Debug("Failed to set the student to inactive in his branches."); throw; } }
public static int SetStudentInactiveInBranch(int studentId, int branchId) { try { string releaseHebrewDate = DateConverter.GetHebrewDate(DateTime.UtcNow); int update = BranchStudentDataManager.SetStudentInactiveInBranch(studentId, branchId, releaseHebrewDate); if (update == 1) { BranchManager.ReduceNumberOfStudents(branchId); } BranchesStudents branchStudents = BranchStudentDataManager.GetActiveBranchesOfStudent(studentId); if (branchStudents.Count() == 0) { StudentDataManager.SetStudentInactive(studentId); } return(update); } catch (Exception) { _logger.Debug("Failed to set the student to inactive in this branch."); throw; } }