public static int SetStudentActiveInBranch(int studentId, int branchId) { try { int insert = RegistrationStudentToBranch(studentId, branchId); BranchManager.IncreaseNumberOfStudents(branchId); StudentDataManager.SetStudentActive(studentId); return(insert); } catch (Exception) { _logger.Debug("Failed to set the student to active in this branch."); throw; } }
public static int ApprovalRegistration(BranchStudent branchStudent) { try { using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)) { int update = BranchStudentManager.ApprovalRegistrationStudent(branchStudent.Id); StudentDataManager.SetStudentActive(branchStudent.Student.Id); if (update == 1) { BranchManager.IncreaseNumberOfStudents(branchStudent.Branch.Id); } scope.Complete(); return(update); } } catch (Exception ex) { _logger.Debug($"Failed to set the student {branchStudent.Student.Id} to active in branch {branchStudent.Branch.Id}.", ex); throw; } }
public static int SetStudentActive(int studentId, int branchId) { try { using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)) { //TODO- not in that sprint: //all the requests,attendance... branchs become active? int update = StudentDataManager.SetStudentActive(studentId); if (update == 1) { BranchStudentManager.RegistrationStudentToBranch(studentId, branchId); BranchManager.IncreaseNumberOfStudents(branchId); } scope.Complete(); return(update); } } catch (Exception ex) { _logger.Debug($"Failed to set the student {studentId} to active.", ex); throw; } }