Ejemplo n.º 1
0
        public async Task <AdminStudentDetailFeatureModel> GetStudentDetailFeatures()
        {
            AdminStudentDetailFeatureModel result = new AdminStudentDetailFeatureModel();
            var exist = await _edFiDb.AdminStudentDetailFeatures.FirstOrDefaultAsync();

            if (exist != null)
            {
                result.AdminStudentDetailFeaturesId = exist.AdminStudentDetailFeaturesId;
                result.AllAboutMe                  = exist.AllAboutMe;
                result.Arc                         = exist.Arc;
                result.Assessment                  = exist.Assessment;
                result.AttendanceIndicator         = exist.AttendanceIndicator;
                result.AttendanceLog               = exist.AttendanceLog;
                result.BehaviorIndicator           = exist.BehaviorIndicator;
                result.BehaviorLog                 = exist.BehaviorLog;
                result.Calendar                    = exist.Calendar;
                result.CollegeInitiativeCorner     = exist.CollegeInitiativeCorner;
                result.CourseAverageIndicator      = exist.CourseAverageIndicator;
                result.CourseGrades                = exist.CourseGrades;
                result.DateCreated                 = exist.DateCreated;
                result.DateUpdated                 = exist.DateUpdated;
                result.Goals                       = exist.Goals;
                result.MissingAssignments          = exist.MissingAssignments;
                result.MissingAssignmentsIndicator = exist.MissingAssignmentsIndicator;
                result.Profile                     = exist.Profile;
                result.StaarAssessment             = exist.StaarAssessment;
                result.SuccessTeam                 = exist.SuccessTeam;
            }

            return(result);
        }
        public async Task <IHttpActionResult> SaveStudentDetailFeatures(AdminStudentDetailFeatureModel entity)
        {
            AdminStudentDetailFeatureModel result = await _adminService.SaveStudentDetailFeatures(entity);

            return(Ok(result));
        }
        public async Task <IHttpActionResult> GetStudentDetailFeatures()
        {
            AdminStudentDetailFeatureModel result = await _adminService.GetStudentDetailFeatures();

            return(Ok(result));
        }
Ejemplo n.º 4
0
        public async Task <AdminStudentDetailFeatureModel> SaveStudentDetailFeatures(AdminStudentDetailFeatureModel model)
        {
            AdminStudentDetailFeatureModel result = new AdminStudentDetailFeatureModel();

            if (model.AdminStudentDetailFeaturesId == 0)
            {
                var newRecord = _edFiDb.AdminStudentDetailFeatures.Add(new AdminStudentDetailFeature
                {
                    AllAboutMe                  = model.AllAboutMe,
                    Arc                         = model.Arc,
                    Assessment                  = model.Assessment,
                    AttendanceIndicator         = model.AttendanceIndicator,
                    AttendanceLog               = model.AttendanceLog,
                    CourseAverageIndicator      = model.CourseAverageIndicator,
                    MissingAssignments          = model.MissingAssignments,
                    MissingAssignmentsIndicator = model.MissingAssignmentsIndicator,
                    StaarAssessment             = model.StaarAssessment,
                    BehaviorIndicator           = model.BehaviorIndicator,
                    BehaviorLog                 = model.BehaviorLog,
                    Calendar                    = model.Calendar,
                    CollegeInitiativeCorner     = model.CollegeInitiativeCorner,
                    CourseGrades                = model.CourseGrades,
                    Goals                       = model.Goals,
                    Profile                     = model.Profile,
                    SuccessTeam                 = model.SuccessTeam,
                    DateCreated                 = DateTime.Now,
                    DateUpdated                 = DateTime.Now,
                });

                await _edFiDb.SaveChangesAsync();

                model.AdminStudentDetailFeaturesId = newRecord.AdminStudentDetailFeaturesId;
                model.DateCreated = newRecord.DateCreated;
                model.DateUpdated = newRecord.DateUpdated;
            }
            else
            {
                var recordToUpdate = await _edFiDb.AdminStudentDetailFeatures.FirstOrDefaultAsync(rec => rec.AdminStudentDetailFeaturesId == model.AdminStudentDetailFeaturesId);

                recordToUpdate.AdminStudentDetailFeaturesId = model.AdminStudentDetailFeaturesId;
                recordToUpdate.AllAboutMe                  = model.AllAboutMe;
                recordToUpdate.Arc                         = model.Arc;
                recordToUpdate.Assessment                  = model.Assessment;
                recordToUpdate.AttendanceIndicator         = model.AttendanceIndicator;
                recordToUpdate.AttendanceLog               = model.AttendanceLog;
                recordToUpdate.BehaviorIndicator           = model.BehaviorIndicator;
                recordToUpdate.BehaviorLog                 = model.BehaviorLog;
                recordToUpdate.Calendar                    = model.Calendar;
                recordToUpdate.CollegeInitiativeCorner     = model.CollegeInitiativeCorner;
                recordToUpdate.CourseAverageIndicator      = model.CourseAverageIndicator;
                recordToUpdate.CourseGrades                = model.CourseGrades;
                recordToUpdate.DateCreated                 = model.DateCreated;
                recordToUpdate.DateUpdated                 = model.DateUpdated;
                recordToUpdate.Goals                       = model.Goals;
                recordToUpdate.MissingAssignments          = model.MissingAssignments;
                recordToUpdate.MissingAssignmentsIndicator = model.MissingAssignmentsIndicator;
                recordToUpdate.Profile                     = model.Profile;
                recordToUpdate.StaarAssessment             = model.StaarAssessment;
                recordToUpdate.SuccessTeam                 = model.SuccessTeam;
                recordToUpdate.DateUpdated                 = DateTime.Now;
                await _edFiDb.SaveChangesAsync();
            }

            result = model;
            return(result);
        }
Ejemplo n.º 5
0
 public async Task <AdminStudentDetailFeatureModel> SaveStudentDetailFeatures(AdminStudentDetailFeatureModel model)
 {
     return(await _adminRepository.SaveStudentDetailFeatures(model));
 }