Esempio n. 1
0
        /// <summary>
        /// Update a Student Intership Requirement Reocord to Database
        /// </summary>
        /// <param name="studentId"></param>
        /// <param name="tnx"></param>
        public void Update(string studentId, IDbTransaction tnx)
        {
            try
            {
                //Create a DataService Object and With the transaction from the Student Class
                InternshipRequirementDataService dataService = new InternshipRequirementDataService(tnx);


                //Call the Insert method, Adds the Requirement Record to Databse
                dataService.Update(ref _requirementId, studentId, _internshipType.ToString(), _driverLicense, _owncar,
                                   _travelNj, _travelWestchester,
                                   _residenceStatus.ToString(), _limitation, _limitationExplanation, _semester);


                //Insert File upload Record
                // _fileUpload.Update(_requirementId, tnx);

                //loop through Modules taken Collection
                foreach (var mod in _modulesTaken)
                {
                    //Insert module taken record
                    mod.Update(_requirementId, tnx);
                }

                //Insert Preference Ranks
                foreach (var prefRank in _preferenceRanks)
                {
                    prefRank.Update(_requirementId, tnx);
                }
            }
            catch
            {
                throw;
            }
        }
Esempio n. 2
0
        public static InternshipRequirement Load(string studentId)
        {
            try
            {
                InternshipRequirementDataService dataService = new InternshipRequirementDataService();
                DataSet ds = dataService.Load(studentId);

                InternshipRequirement objRequirement = new InternshipRequirement();

                return(objRequirement.MapData(ds) ? objRequirement : null);
            } catch
            {
                throw;
            }
        }