Exemplo n.º 1
0
        public void Delete(string value)
        {
            var dataQuery = new StudentDataModel();

            dataQuery.StudentId = int.Parse(value);
            StudentDataManager.Delete(dataQuery, SessionVariables.RequestProfile);
        }
Exemplo n.º 2
0
        public StudentDataModel GetById(string value)
        {
            var dataQuery = new StudentDataModel();

            dataQuery.StudentId = int.Parse(value);
            var result = StudentDataManager.GetEntityDetails(dataQuery, SessionVariables.RequestProfile, 1);

            return(result[0]);
        }
Exemplo n.º 3
0
 public static decimal GetPayment(int studentId)
 {
     try
     {
         decimal payment = StudentDataManager.GetPayment(studentId);
         return(payment);
     }
     catch (Exception ex)
     {
         _logger.Debug($"Failed to calculate student's payment,studentId: {studentId}.", ex);
         throw;
     }
 }
Exemplo n.º 4
0
 public static Student GetStudentByIdentityNumber(int studentIdentityNumber, Student.Includes includes)
 {
     try
     {
         Student student = StudentDataManager.GetStudentByIdentityNumber(studentIdentityNumber, includes);
         return(student);
     }
     catch (Exception ex)
     {
         _logger.Debug($"Failed to load student {studentIdentityNumber}.", ex);
         throw;
     }
 }
Exemplo n.º 5
0
 public static Students GetPendingStudents(Student.Includes includes)
 {
     try
     {
         Students students = StudentDataManager.GetPendingStudents(includes);
         return(students);
     }
     catch (Exception ex)
     {
         _logger.Debug($"Failed to load pending students.", ex);
         throw;
     }
 }
Exemplo n.º 6
0
 public static Students GetStudents(Student.Includes includes, int?from, int?amount)
 {
     try
     {
         Students students = StudentDataManager.GetAllStudents(includes, from, amount);
         return(students);
     }
     catch (Exception ex)
     {
         _logger.Debug($"Failed to load students.", ex);
         throw;
     }
 }
Exemplo n.º 7
0
 public static Students Contains(Student.Includes includes, string str)
 {
     try
     {
         Students students = StudentDataManager.Contains(includes, str);
         return(students);
     }
     catch (Exception ex)
     {
         _logger.Debug($"Failed to load students.", ex);
         throw;
     }
 }
Exemplo n.º 8
0
 public static Students GetStudentsOfBranch(int branchId, Student.Includes includes, int?from, int?amount)
 {
     try
     {
         Students students = StudentDataManager.GetStudentsOfBranch(branchId, includes, from, amount);
         return(students);
     }
     catch (Exception ex)
     {
         _logger.Debug($"Failed to load the students of this branch.", ex);
         throw;
     }
 }
Exemplo n.º 9
0
        public static int InsertPendingStudent(Student student, int branchId, int?studyPathId)
        {
            try
            {
                using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
                {
                    if (StudentDataManager.IsExistIdentityNumber(student.IdentityNumber, student.Id))
                    {
                        throw new Exception("The identity number is already exist.");
                    }

                    student.Address.Id = AddressManager.InsertAddress(student.Address);
                    student.Bank.Id    = BankManager.InsertBank(student.Bank);
                    //student.ChildrenNumber = getNumberNotMarriedChildren(student.StudentChildren);
                    //student.MarriedChildrenNumber = getNumberMarriedChildren(student.StudentChildren);
                    int insert = student.Id = StudentDataManager.InsertPendingStudent(student);
                    if (student.StudentChildren != null)
                    {
                        foreach (StudentChildren child in student.StudentChildren)
                        {
                            if (!ValidateModel.IsValid(new List <object>()
                            {
                                child
                            }))
                            {
                                throw new Exception("not valid child field/s");
                            }
                            //i had this line
                            child.Student    = student;
                            child.Student.Id = student.Id;
                            child.Id         = StudentChildrenDataManager.InsertStudentChildren(child);
                        }
                    }
                    //BranchStudentManager.RequestRregistration(student.Id, branchId, studyPathId);
                    scope.Complete();
                    return(insert);
                }
            }
            catch (Exception ex)
            {
                _logger.Debug($"Failed to insert pending student.", ex);
                throw;
            }
        }
Exemplo n.º 10
0
        public static int UpdateStudent(Student student)
        {
            try
            {
                using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
                {
                    //if (StudentDataManager.IsExistIdentityNumber(student.IdentityNumber, student.Id))
                    //    throw new Exception("The identity number is already exist.");
                    AddressManager.UpdateAddress(student.Address);
                    BankManager.UpdateBank(student.Bank);
                    student.ChildrenNumber        = getNumberNotMarriedChildren(student.StudentChildren);
                    student.MarriedChildrenNumber = getNumberMarriedChildren(student.StudentChildren);
                    int update = StudentDataManager.UpdateStudent(student);
                    if (student.StudentChildren != null)
                    {
                        foreach (StudentChildren child in student.StudentChildren)
                        {
                            if (!ValidateModel.IsValid(new List <object>()
                            {
                                child
                            }))
                            {
                                throw new Exception("not valid child field/s");
                            }

                            //if (child.Id > 0)
                            //    update = StudentChildrenDataManager.UpdateStudentChildren(child);
                            //else
                            //{
                            //    child.Student.Id = student.Id;
                            //    child.Id = StudentChildrenDataManager.InsertStudentChildren(child);
                            //}
                        }
                    }
                    scope.Complete();
                    return(update);
                }
            }
            catch (Exception ex)
            {
                _logger.Debug($"Failed to update student {student.Id}.", ex);
                throw;
            }
        }
Exemplo n.º 11
0
        public static int InsertStudentPayment(StudentPayment studentPayment)
        {
            try
            {
                using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
                {
                    //todo check if not appear scolarship in that month

                    int insert = studentPayment.Id = StudentDataManager.InsertStudentPayment(studentPayment);
                    scope.Complete();
                    return(insert);
                }
            }
            catch (Exception ex)
            {
                _logger.Debug($"Failed to insert payment of student.", ex);
                throw;
            }
        }
Exemplo n.º 12
0
 public static int SetStudentInactive(int studentId)
 {
     try
     {
         using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
         {
             //TODO- not in that sprint:
             //all the requests,attendance... become Inactive
             BranchStudentManager.SetBranchOfStudentInactive(studentId);
             int update = StudentDataManager.SetStudentInactive(studentId);
             scope.Complete();
             return(update);
         }
     }
     catch (Exception ex)
     {
         _logger.Debug($"Failed to set the student {studentId} to inactive.", ex);
         throw;
     }
 }
Exemplo n.º 13
0
        // GET api/summary/GetList
        public IEnumerable <StudentDataModel> GetList(string value, string value1)
        {
            var settingCategory = value1;
            var searchString    = value;

            var dictionaryObject = JsonConvert.DeserializeObject <Dictionary <string, string> >(searchString);

            // save search filter parameters in user preference
            if (dictionaryObject != null)
            {
                foreach (var searchFilterColumnName in dictionaryObject.Keys)
                {
                    var searchFilterValue = dictionaryObject[searchFilterColumnName];
                    PerferenceUtility.UpdateUserPreference(settingCategory, searchFilterColumnName, dictionaryObject[searchFilterColumnName]);
                }
            }

            var dataQuery = JsonConvert.DeserializeObject <StudentDataModel>(searchString);

            return(StudentDataManager.GetEntityDetails(dataQuery, SessionVariables.RequestProfile));
        }
Exemplo n.º 14
0
 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;
     }
 }
Exemplo n.º 15
0
 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;
     }
 }
Exemplo n.º 16
0
 public void Update([FromBody] StudentDataModel data)
 {
     StudentDataManager.Update(data, SessionVariables.RequestProfile);
 }
Exemplo n.º 17
0
 public AcademicRecordController()
 {
     dataManager = StudentDataManager.Instance;
 }
Exemplo n.º 18
0
 public StudentsController()
 {
     dataManager = StudentDataManager.Instance;
 }