Admit
Admit
(StudentNo,CampusID,ProgID,MajorDiscID,YearLevelID,AppNo,TermID,
CurriculumID,MaxUnitsLoad,TblFeesID,DateAdmitted,LastName,MiddleName,FirstName,Midd
leInitial,ExtName,
DateOfBirth,PlaceOfBirth,Gender,CivilStatusID,ReligionID,NationalityID,TelNo,Mobile
No,Email,Father,
Father_Occupation, Father_Company, Father_CompanyAddress,
Father_Email,Father_TelNo, Mother,Mother_Occupation,
Mother_Company, Mother_CompanyAddress, Mother_TelNo,
Res_Address, Res_Street,Res_Barangay,Res_TownCity,Res_ZipCode,
Res_Province, Perm_Address, Perm_Street, Perm_Barangay,
Perm_TownCity, Perm_ZipCode,Perm_Province,College_School,
College_Address,College_Degree,College_InclDates,GS_School,
GS_Address,GS_Degree,GS_InclDates,LastModifiedDate)
Select @StudentNo,
case when isAcceptedByCollege=1 then
isnull(A.Choice1_CampusID,0) when isAcceptedBy2ndChoice=1 then
isnull(A.Choice2_CampusID,0) end,
case when isAcceptedByCollege=1 then isnull(A.Choice1_Course,0)
when isAcceptedBy2ndChoice=1 then isnull(A.Choice2_Course,0) end,
case when isAcceptedByCollege=1 then
isnull(A.Choice1_CourseMajor,0) when isAcceptedBy2ndChoice=1 then
isnull(A.Choice2_CourseMajor,0) end,
'1',
@AppNo, @TermID,
case when isAcceptedByCollege=1 then [dbo].
[fn_getBulkAdmitCurriculum](A.Choice1_Course,A.Choice1_CourseMajor,A.SHSTrackID)
when isAcceptedBy2ndChoice=1 then [dbo].[fn_getBulkAdmitCurriculum]
(A.Choice2_Course,A.Choice2_CourseMajor,A.SHSTrackID) end,
@MaxUnits,
(select top 1 [TblFeesID] from [dbo].[ES_BulkAdmitConfig] C
where C.termID=A.TermID
and C.ProgID=A.Choice1_Course and
C.MajorID=isnull(A.Choice1_CourseMajor,0)),
GETDATE(),A.LastName,A.MiddleName,A.FirstName,A.MiddleInitial,A.ExtName,A.DateOfBir
th,A.PlaceOfBirth,
A.Gender,A.CivilStatusID,A.ReligionID,A.NationalityID,A.TelNo,A.MobileNo,A.Email,A.
Father,A.Father_Occupation,
A.Father_Company, A.Father_CompanyAddress,
A.Father_Email,A.Father_TelNo, A.Mother,A.Mother_Occupation,
A.Mother_Company, A.Mother_CompanyAddress, A.Mother_TelNo,
A.Res_Address, A.Res_Street,A.Res_Barangay,
A.Res_TownCity,A.Res_ZipCode, A.Res_Province, A.Perm_Address,
A.Perm_Street, A.Perm_Barangay, A.Perm_TownCity,
A.Perm_ZipCode,A.Perm_Province,A.College_School,A.College_Address,A.College_Degree,
A.College_InclDates,
A.GS_School, A.GS_Address,A.GS_Degree,A.GS_InclDates,GETDATE()
from ES_Admission A
inner join ES_Admission_Temp T on A.AppNo=T.AppNo
where A.appno=@AppNo