public async Task UpdateStudentInfoAsync([FromQuery] StudentGeneralInfo studentGeneralInfo)
        {
            StudentGeneralInfo student = await db.StudentInfo.FindAsync(studentGeneralInfo.ID);

            if (student != null)
            {
                student.CollageUk              = studentGeneralInfo.CollageUk;
                student.CollageEn              = studentGeneralInfo.CollageEn;
                student.OwnershipUk            = studentGeneralInfo.OwnershipUk;
                student.OwnershipEn            = studentGeneralInfo.OwnershipEn;
                student.FacultyUk              = studentGeneralInfo.FacultyUk;
                student.FacultyEn              = studentGeneralInfo.FacultyEn;
                student.EducationFormNameUk    = studentGeneralInfo.EducationFormNameUk;
                student.EducationFormNameEn    = studentGeneralInfo.EducationFormNameEn;
                student.StudyLanguageUk        = studentGeneralInfo.StudyLanguageUk;
                student.StudyLanguageEn        = studentGeneralInfo.StudyLanguageEn;
                student.DegreeUk               = studentGeneralInfo.DegreeUk;
                student.DegreeEn               = studentGeneralInfo.DegreeEn;
                student.SpecialityUk           = studentGeneralInfo.SpecialityUk;
                student.SpecialityEn           = studentGeneralInfo.SpecialityEn;
                student.ProfqualificationUk    = studentGeneralInfo.ProfqualificationUk;
                student.ProfqualificationEn    = studentGeneralInfo.ProfqualificationEn;
                student.FieldofStudyUk         = studentGeneralInfo.FieldofStudyUk;
                student.FieldofStudyEn         = studentGeneralInfo.FieldofStudyEn;
                student.LevelofQualificationUk = studentGeneralInfo.LevelofQualificationUk;
                student.LevelofQualificationEn = studentGeneralInfo.LevelofQualificationEn;
                student.years                = studentGeneralInfo.years;
                student.months               = studentGeneralInfo.months;
                student.FormNameUk           = studentGeneralInfo.FormNameUk;
                student.FormNameEn           = studentGeneralInfo.FormNameEn;
                student.MainUk               = studentGeneralInfo.MainUk;
                student.MainEn               = studentGeneralInfo.MainEn;
                student.AdditionalUk         = studentGeneralInfo.AdditionalUk;
                student.AdditionalEn         = studentGeneralInfo.AdditionalEn;
                student.AccessFurtherStudyUk = studentGeneralInfo.AccessFurtherStudyUk;
                student.AccessFurtherStudyEn = studentGeneralInfo.AccessFurtherStudyEn;
                student.ProfessionalStatusUk = studentGeneralInfo.ProfessionalStatusUk;
                student.ProfessionalStatusEn = studentGeneralInfo.ProfessionalStatusEn;
                student.PositionUk           = studentGeneralInfo.PositionUk;
                student.PositionEn           = studentGeneralInfo.PositionEn;
                student.SignerNameUk         = studentGeneralInfo.SignerNameUk;
                student.SignerNameEn         = studentGeneralInfo.SignerNameEn;
                student.SutisfyUk            = studentGeneralInfo.SutisfyUk;
                student.SutisfyEn            = studentGeneralInfo.SutisfyEn;
                student.KnowledgeUk          = studentGeneralInfo.KnowledgeUk;
                student.KnowledgeEn          = studentGeneralInfo.KnowledgeEn;
                student.UnderstandingUk      = studentGeneralInfo.UnderstandingUk;
                student.UnderstandingEn      = studentGeneralInfo.UnderstandingEn;
                student.JudgmentsUk          = studentGeneralInfo.JudgmentsUk;
                student.JudgmentsEn          = studentGeneralInfo.JudgmentsEn;
                db.StudentInfo.Update(student);
                await db.SaveChangesAsync();
            }
        }
        public async Task <StudentGeneralInfo> GetStudentInfoAsync(string id)
        {
            StudentGeneralInfo student = await db.StudentInfo.FindAsync(id);

            if (student == null)
            {
                return(null);
            }

            return(student);
        }
        public async Task <IActionResult> EditGeneralInfo(StudentGeneralInfo user)
        {
            StudentGeneralInfo student = await db.StudentInfo.FindAsync(user.ID);

            student.CollageUk              = user.CollageUk;
            student.CollageEn              = user.CollageEn;
            student.OwnershipUk            = user.OwnershipUk;
            student.OwnershipEn            = user.OwnershipEn;
            student.FacultyUk              = user.FacultyUk;
            student.FacultyEn              = user.FacultyEn;
            student.EducationFormNameUk    = user.EducationFormNameUk;
            student.EducationFormNameEn    = user.EducationFormNameEn;
            student.StudyLanguageUk        = user.StudyLanguageUk;
            student.StudyLanguageEn        = user.StudyLanguageEn;
            student.DegreeUk               = user.DegreeUk;
            student.DegreeEn               = user.DegreeEn;
            student.SpecialityUk           = user.SpecialityUk;
            student.SpecialityEn           = user.SpecialityEn;
            student.ProfqualificationUk    = user.ProfqualificationUk;
            student.ProfqualificationEn    = user.ProfqualificationEn;
            student.FieldofStudyUk         = user.FieldofStudyUk;
            student.FieldofStudyEn         = user.FieldofStudyEn;
            student.LevelofQualificationUk = user.LevelofQualificationUk;
            student.LevelofQualificationEn = user.LevelofQualificationEn;
            student.years                = user.years;
            student.months               = user.months;
            student.FormNameUk           = user.FormNameUk;
            student.FormNameEn           = user.FormNameEn;
            student.MainUk               = user.MainUk;
            student.MainEn               = user.MainEn;
            student.AdditionalUk         = user.AdditionalUk;
            student.AdditionalEn         = user.AdditionalEn;
            student.AccessFurtherStudyUk = user.AccessFurtherStudyUk;
            student.AccessFurtherStudyEn = user.AccessFurtherStudyEn;
            student.ProfessionalStatusUk = user.ProfessionalStatusUk;
            student.ProfessionalStatusEn = user.ProfessionalStatusEn;
            student.PositionUk           = user.PositionUk;
            student.PositionEn           = user.PositionEn;
            student.SignerNameUk         = user.SignerNameUk;
            student.SignerNameEn         = user.SignerNameEn;
            student.SutisfyUk            = user.SutisfyUk;
            student.SutisfyEn            = user.SutisfyEn;
            student.KnowledgeUk          = user.KnowledgeUk;
            student.KnowledgeEn          = user.KnowledgeEn;
            student.UnderstandingUk      = user.UnderstandingUk;
            student.UnderstandingEn      = user.UnderstandingEn;
            student.JudgmentsUk          = user.JudgmentsUk;
            student.JudgmentsEn          = user.JudgmentsEn;
            db.StudentInfo.Update(student);
            await db.SaveChangesAsync();

            return(Redirect("/Student"));
        }
        public async Task <IActionResult> EditGeneralInfo(string?id)
        {
            if (id != null)
            {
                StudentGeneralInfo user = await db.StudentInfo.FindAsync(id);

                if (user != null)
                {
                    return(View(user));
                }
                else
                {
                    StudentGeneralInfo student = new StudentGeneralInfo();
                    student.ID = id;
                    await db.StudentInfo.AddAsync(student);

                    await db.SaveChangesAsync();

                    return(View(student));
                }
            }
            return(NotFound());
        }