public string[] setStudentDataBase7(StudentTeachingInformation StudentTeaching) { string[] returnValue = new string[2]; returnValue[0] = "0"; returnValue[1] = ""; DataBase Base = new DataBase(); SqlConnection Sqlconn = new SqlConnection(Base.GetConnString()); using (Sqlconn) { try { Sqlconn.Open(); string sql = "UPDATE StudentDatabase SET CaseFamilyCooperative=@CaseFamilyCooperative, EntrustOthers=@EntrustOthers, " + "CooperativeDifficulty=@CooperativeDifficulty, RearingAttitude=@RearingAttitude, RearingAttitude1=@RearingAttitude1, " + "RearingAttitude1Text=@RearingAttitude1Text, RearingAttitude2=@RearingAttitude2, RearingAttitude2Text=@RearingAttitude2Text, " + "RearingAttitude3=@RearingAttitude3, RearingAttitude3Text=@RearingAttitude3Text, RearingAttitude4=@RearingAttitude4, " + "RearingAttitude4Text=@RearingAttitude4Text, RearingAttitude5=@RearingAttitude5, RearingAttitude5Text=@RearingAttitude5Text, " + "RearingAttitude6=@RearingAttitude6, RearingAttitude6Text=@RearingAttitude6Text, Dispositional=@Dispositional, Dispositional1=@Dispositional1, " + "Dispositional1Text=@Dispositional1Text, Dispositional2=@Dispositional2, Dispositional2Text=@Dispositional2Text, Dispositional3=@Dispositional3, " + "Dispositional3Text=@Dispositional3Text, Dispositional4=@Dispositional4, Dispositional4Text=@Dispositional4Text, Attendance=@Attendance, " + "AttendanceText=@AttendanceText, TeachEscorts=@TeachEscorts, TeachEscortsText=@TeachEscortsText, AfterTeach=@AfterTeach, AfterTeachText=@AfterTeachText, " + "MajorProblem=@MajorProblem, MajorProblemText=@MajorProblemText, RemarkOther=@RemarkOther, LearningAttitude=@LearningAttitude, Temperament=@Temperament, " + "Activity=@Activity, Focus=@Focus, Persistence=@Persistence, CommunicationBehavior=@CommunicationBehavior, AuditorySkill=@AuditorySkill, " + "Acknowledge=@Acknowledge, Language=@Language, LanguageText=@LanguageText, Action=@Action, WearAids=@WearAids, SpiritAndCoordinate=@SpiritAndCoordinate, " + "SpiritAndCoordinateOther=@SpiritAndCoordinateOther, Communication=@Communication, LearningDesire=@LearningDesire, AttachmentData=@AttachmentData, " + "AttachmentDataText=@AttachmentDataText, RemarkOther2=@RemarkOther2, ExistingResources=@ExistingResources, InterventionAgencies=@InterventionAgencies, " + "HospitalIntervention=@HospitalIntervention, RelatedIntervention=@RelatedIntervention, RelatedInterventionText=@RelatedInterventionText, " + "InNurserySchool=@InNurserySchool, HearingRehabilitation=@HearingRehabilitation, CaseNeed=@CaseNeed, CaseFamilyEnthusiasm=@CaseFamilyEnthusiasm, " + "Rehousing=@Rehousing, RehousingText=@RehousingText, CaseFamilyCourseProposal=@CaseFamilyCourseProposal, " + "CaseFamilyCourseProposalText=@CaseFamilyCourseProposalText, CaseCourseProposal=@CaseCourseProposal, CaseCourseProposalText=@CaseCourseProposalText, " + "Teacher=@Teacher, TeacherDate=@TeacherDate " + "WHERE ID=@ID "; SqlCommand cmd = new SqlCommand(sql, Sqlconn); cmd.Parameters.Add("@ID", SqlDbType.BigInt).Value = StudentTeaching.ID; cmd.Parameters.Add("@CaseFamilyCooperative", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case1); cmd.Parameters.Add("@EntrustOthers", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case1t04); cmd.Parameters.Add("@CooperativeDifficulty", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case1t05); cmd.Parameters.Add("@RearingAttitude", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case2); cmd.Parameters.Add("@RearingAttitude1", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case21); cmd.Parameters.Add("@RearingAttitude1Text", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case21t01); cmd.Parameters.Add("@RearingAttitude2", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case22); cmd.Parameters.Add("@RearingAttitude2Text", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case22t01); cmd.Parameters.Add("@RearingAttitude3", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case23); cmd.Parameters.Add("@RearingAttitude3Text", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case23t01); cmd.Parameters.Add("@RearingAttitude4", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case24); cmd.Parameters.Add("@RearingAttitude4Text", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case24t01); cmd.Parameters.Add("@RearingAttitude5", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case25); cmd.Parameters.Add("@RearingAttitude5Text", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case25t01); cmd.Parameters.Add("@RearingAttitude6", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case26); cmd.Parameters.Add("@RearingAttitude6Text", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case26t01); cmd.Parameters.Add("@Dispositional", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case3); cmd.Parameters.Add("@Dispositional1", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case31); cmd.Parameters.Add("@Dispositional1Text", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case31t01); cmd.Parameters.Add("@Dispositional2", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case32); cmd.Parameters.Add("@Dispositional2Text", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case32t01); cmd.Parameters.Add("@Dispositional3", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case33); cmd.Parameters.Add("@Dispositional3Text", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case33t01); cmd.Parameters.Add("@Dispositional4", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case34); cmd.Parameters.Add("@Dispositional4Text", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case34t01); cmd.Parameters.Add("@Attendance", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.attend); cmd.Parameters.Add("@AttendanceText", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.attend01t01); cmd.Parameters.Add("@TeachEscorts", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.accompany); cmd.Parameters.Add("@TeachEscortsText", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.accompany01t01); cmd.Parameters.Add("@AfterTeach", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.teach); cmd.Parameters.Add("@AfterTeachText", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.teach01t01); cmd.Parameters.Add("@MajorProblem", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.caseQ); cmd.Parameters.Add("@MajorProblemText", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.caseQ01t01); cmd.Parameters.Add("@RemarkOther", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.OtherRemark1); cmd.Parameters.Add("@LearningAttitude", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case4); cmd.Parameters.Add("@Temperament", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case5); cmd.Parameters.Add("@Activity", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case6); cmd.Parameters.Add("@Focus", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case7); cmd.Parameters.Add("@Persistence", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case8); cmd.Parameters.Add("@CommunicationBehavior", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case9); cmd.Parameters.Add("@AuditorySkill", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case10); cmd.Parameters.Add("@Acknowledge", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case11); cmd.Parameters.Add("@Language", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case12); cmd.Parameters.Add("@LanguageText", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case12t01); cmd.Parameters.Add("@Action", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case13); cmd.Parameters.Add("@WearAids", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(StudentTeaching.wear); cmd.Parameters.Add("@SpiritAndCoordinate", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(StudentTeaching.mind); cmd.Parameters.Add("@SpiritAndCoordinateOther", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.mind01t01); cmd.Parameters.Add("@Communication", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(StudentTeaching.connectwish); cmd.Parameters.Add("@LearningDesire", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(StudentTeaching.studywish); cmd.Parameters.Add("@AttachmentData", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(StudentTeaching.related); cmd.Parameters.Add("@AttachmentDataText", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.related01t01); cmd.Parameters.Add("@RemarkOther2", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.OtherRemark2); cmd.Parameters.Add("@ExistingResources", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case14); cmd.Parameters.Add("@InterventionAgencies", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(StudentTeaching.trusteeship); cmd.Parameters.Add("@HospitalIntervention", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case14t01); cmd.Parameters.Add("@RelatedIntervention", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.proceed); cmd.Parameters.Add("@RelatedInterventionText", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.proceedt01); cmd.Parameters.Add("@InNurserySchool", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(StudentTeaching.preschools); cmd.Parameters.Add("@HearingRehabilitation", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case15); cmd.Parameters.Add("@CaseNeed", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(StudentTeaching.Rehabilitation1); cmd.Parameters.Add("@CaseFamilyEnthusiasm", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(StudentTeaching.Rehabilitation2); cmd.Parameters.Add("@Rehousing", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(StudentTeaching.Rehabilitation3); cmd.Parameters.Add("@RehousingText", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.Rehabilitation3Text); cmd.Parameters.Add("@CaseFamilyCourseProposal", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case16); cmd.Parameters.Add("@CaseFamilyCourseProposalText", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.OtherRemark3); cmd.Parameters.Add("@CaseCourseProposal", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.case17); cmd.Parameters.Add("@CaseCourseProposalText", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentTeaching.OtherRemark4); cmd.Parameters.Add("@Teacher", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(StudentTeaching.teacherID); cmd.Parameters.Add("@TeacherDate", SqlDbType.Date).Value = Chk.CheckStringtoDateFunction(StudentTeaching.teacherDate); returnValue[0] = cmd.ExecuteNonQuery().ToString(); Sqlconn.Close(); } catch (Exception e) { returnValue[0] = "-1"; returnValue[1] = e.Message; } } return returnValue; }
public StudentResult getStudentDataWho(string StudentID) { StudentResult returnValue = new StudentResult(); returnValue.StudentData = new CreateStudent(); DataBase Base = new DataBase(); using (SqlConnection Sqlconn = new SqlConnection(Base.GetConnString())) { try { Sqlconn.Open(); string sql = "SELECT * FROM StudentDatabase WHERE isDeleted=0 AND StudentID= @ID";////修正SQL式[ StudentID= (@ID) ] → [ ID = @ID ] by Awho SqlCommand cmd = new SqlCommand(sql, Sqlconn); cmd.Parameters.Add("@ID", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentID); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { returnValue.Column = Int64.Parse(dr["ID"].ToString()); CreateStudent addValue = new CreateStudent(); StaffDataBase sDB = new StaffDataBase(); List<string> StaffData = sDB.getStaffDataName(dr["WriteName"].ToString()); addValue.fillInName = StaffData[1]; addValue.ID = dr["ID"].ToString(); addValue.assessDate = dr["EvaluationDate"].ToString(); addValue.consultationDate = dr["ConsultDate"].ToString(); addValue.upDate = dr["Updated"].ToString(); addValue.caseStatu = dr["CaseStatu"].ToString(); addValue.Unit = dr["Unit"].ToString(); addValue.studentID = dr["StudentID"].ToString(); addValue.studentName = dr["StudentName"].ToString(); addValue.studentTWID = dr["StudentIdentity"].ToString(); addValue.censusAddressZip = dr["AddressZip1"].ToString(); addValue.censusAddressCity = dr["AddressCity1"].ToString(); addValue.censusAddress = dr["AddressOther1"].ToString(); addValue.addressZip = dr["AddressZip2"].ToString(); addValue.addressCity = dr["AddressCity2"].ToString(); addValue.address = dr["AddressOther2"].ToString(); addValue.studentbirthday = DateTime.Parse(dr["StudentBirthday"].ToString()).ToString("yyyy-MM-dd"); addValue.studentSex = dr["StudentSex"].ToString(); addValue.firstClassDate = DateTime.Parse(dr["ClassDate"].ToString()).ToString("yyyy-MM-dd"); addValue.guaranteeDate = DateTime.Parse(dr["GuaranteeDate"].ToString()).ToString("yyyy-MM-dd"); addValue.endReasonDate = DateTime.Parse(dr["CompletedDate"].ToString()).ToString("yyyy-MM-dd"); addValue.endReasonType = dr["CompletedType"].ToString(); addValue.endReason = dr["CompletedReason"].ToString(); addValue.sendDateSince = DateTime.Parse(dr["ShortEndDateSince"].ToString()).ToString("yyyy-MM-dd"); addValue.sendDateUntil = DateTime.Parse(dr["ShortEndDateUntil"].ToString()).ToString("yyyy-MM-dd"); addValue.nomembershipType = dr["NomembershipType"].ToString(); addValue.nomembershipReason = dr["NomembershipReason"].ToString(); addValue.studentPhoto = dr["StudentAvatar"].ToString(); addValue.wCare = dr["CaregiversDaytime"].ToString(); addValue.wCareName = dr["CaregiversDaytimeText"].ToString(); addValue.bCare = dr["CaregiversNight"].ToString(); addValue.bCareName = dr["CaregiversNightText"].ToString(); addValue.fPRelation1 = dr["ContactRelation1"].ToString(); addValue.fPName1 = dr["ContactName1"].ToString(); addValue.fPTel1 = dr["ContactTel_company1"].ToString(); addValue.fPPhone1 = dr["ContactPhone1"].ToString(); addValue.fPHPhone1 = dr["ContactTel_home1"].ToString(); addValue.fPFax1 = dr["ContactFax1"].ToString(); addValue.fPRelation2 = dr["ContactRelation2"].ToString(); addValue.fPName2 = dr["ContactName2"].ToString(); addValue.fPTel2 = dr["ContactTel_company2"].ToString(); addValue.fPPhone2 = dr["ContactPhone2"].ToString(); addValue.fPHPhone2 = dr["ContactTel_home2"].ToString(); addValue.fPFax2 = dr["ContactFax2"].ToString(); addValue.fPRelation3 = dr["ContactRelation3"].ToString(); addValue.fPName3 = dr["ContactName3"].ToString(); addValue.fPTel3 = dr["ContactTel_company3"].ToString(); addValue.fPPhone3 = dr["ContactPhone3"].ToString(); addValue.fPHPhone3 = dr["ContactTel_home3"].ToString(); addValue.fPFax3 = dr["ContactFax3"].ToString(); addValue.fPRelation4 = dr["ContactRelation4"].ToString(); addValue.fPName4 = dr["ContactName4"].ToString(); addValue.fPTel4 = dr["ContactTel_company4"].ToString(); addValue.fPPhone4 = dr["ContactPhone4"].ToString(); addValue.fPHPhone4 = dr["ContactTel_home4"].ToString(); addValue.fPFax4 = dr["ContactFax4"].ToString(); addValue.email = dr["StudentEmail"].ToString(); addValue.sourceType = dr["ReferralSourceType"].ToString(); addValue.sourceName = dr["ReferralSource"].ToString(); addValue.manualWhether = dr["PhysicalAndMentalDisabilityHandbook"].ToString(); addValue.manualCategory1 = dr["DisabilityCategory1"].ToString(); addValue.manualGrade1 = dr["DisabilityGrade1"].ToString(); addValue.manualCategory2 = dr["DisabilityCategory2"].ToString(); addValue.manualGrade2 = dr["DisabilityGrade2"].ToString(); addValue.manualCategory3 = dr["DisabilityCategory3"].ToString(); addValue.manualGrade3 = dr["DisabilityGrade3"].ToString(); addValue.manualNo = dr["NoDisabilityHandbook"].ToString(); addValue.manualUnit = dr["ApplyDisabilityHandbook"].ToString(); addValue.studentManualImg = dr["DisabilityProve"].ToString(); addValue.notificationWhether = dr["Notify"].ToString(); addValue.notificationUnit = dr["Notify_Unit"].ToString(); addValue.notificationManage = dr["Notify_Member"].ToString(); addValue.notificationTel = dr["Notify_Tel"].ToString(); addValue.notificationDate = DateTime.Parse(dr["Notify_Date"].ToString()).ToString("yyyy-MM-dd"); addValue.notificationCity = dr["Notify_City"].ToString(); addValue.economy = dr["EconomyState"].ToString(); addValue.economyLow = dr["EconomyLow"].ToString(); addValue.fAppellation1 = dr["FamilyAppellation1"].ToString(); addValue.fName1 = dr["FamilyName1"].ToString(); addValue.fBirthday1 = DateTime.Parse(dr["FamilyBirthday1"].ToString()).ToString("yyyy-MM-dd"); addValue.fEDU1 = dr["FamilyEducation1"].ToString(); addValue.fProfession1 = dr["FamilyProfession1"].ToString(); addValue.fLive1 = dr["FamilyLive1"].ToString(); addValue.fHearing1 = dr["FamilyHearing1"].ToString(); addValue.fHealthy1 = dr["FamilyHealth1"].ToString(); addValue.familyText01 = dr["FamilyHealthText1"].ToString(); addValue.fAppellation2 = dr["FamilyAppellation2"].ToString(); addValue.fName2 = dr["FamilyName2"].ToString(); addValue.fBirthday2 = DateTime.Parse(dr["FamilyBirthday2"].ToString()).ToString("yyyy-MM-dd"); addValue.fEDU2 = dr["FamilyEducation2"].ToString(); addValue.fProfession2 = dr["FamilyProfession2"].ToString(); addValue.fLive2 = dr["FamilyLive2"].ToString(); addValue.fHearing2 = dr["FamilyHearing2"].ToString(); addValue.fHealthy2 = dr["FamilyHealth2"].ToString(); addValue.familyText02 = dr["FamilyHealthText2"].ToString(); addValue.fAppellation3 = dr["FamilyAppellation3"].ToString(); addValue.fName3 = dr["FamilyName3"].ToString(); addValue.fBirthday3 = DateTime.Parse(dr["FamilyBirthday3"].ToString()).ToString("yyyy-MM-dd"); addValue.fEDU3 = dr["FamilyEducation3"].ToString(); addValue.fProfession3 = dr["FamilyProfession3"].ToString(); addValue.fLive3 = dr["FamilyLive3"].ToString(); addValue.fHearing3 = dr["FamilyHearing3"].ToString(); addValue.fHealthy3 = dr["FamilyHealth3"].ToString(); addValue.familyText03 = dr["FamilyHealthText3"].ToString(); addValue.fAppellation4 = dr["FamilyAppellation4"].ToString(); addValue.fName4 = dr["FamilyName4"].ToString(); addValue.fBirthday4 = DateTime.Parse(dr["FamilyBirthday4"].ToString()).ToString("yyyy-MM-dd"); addValue.fEDU4 = dr["FamilyEducation4"].ToString(); addValue.fProfession4 = dr["FamilyProfession4"].ToString(); addValue.fLive4 = dr["FamilyLive4"].ToString(); addValue.fHearing4 = dr["FamilyHearing4"].ToString(); addValue.fHealthy4 = dr["FamilyHealth4"].ToString(); addValue.familyText04 = dr["FamilyHealthText4"].ToString(); addValue.fAppellation5 = dr["FamilyAppellation5"].ToString(); addValue.fName5 = dr["FamilyName5"].ToString(); addValue.fBirthday5 = DateTime.Parse(dr["FamilyBirthday5"].ToString()).ToString("yyyy-MM-dd"); addValue.fEDU5 = dr["FamilyEducation5"].ToString(); addValue.fProfession5 = dr["FamilyProfession5"].ToString(); addValue.fLive5 = dr["FamilyLive5"].ToString(); addValue.fHearing5 = dr["FamilyHearing5"].ToString(); addValue.fHealthy5 = dr["FamilyHealth5"].ToString(); addValue.familyText05 = dr["FamilyHealthText5"].ToString(); addValue.fAppellation6 = dr["FamilyAppellation6"].ToString(); addValue.fName6 = dr["FamilyName6"].ToString(); addValue.fBirthday6 = DateTime.Parse(dr["FamilyBirthday6"].ToString()).ToString("yyyy-MM-dd"); addValue.fEDU6 = dr["FamilyEducation6"].ToString(); addValue.fProfession6 = dr["FamilyProfession6"].ToString(); addValue.fLive6 = dr["FamilyLive6"].ToString(); addValue.fHearing6 = dr["FamilyHearing6"].ToString(); addValue.fHealthy6 = dr["FamilyHealth6"].ToString(); addValue.familyText06 = dr["FamilyHealthText6"].ToString(); addValue.fAppellation7 = dr["FamilyAppellation7"].ToString(); addValue.fName7 = dr["FamilyName7"].ToString(); addValue.fBirthday7 = DateTime.Parse(dr["FamilyBirthday7"].ToString()).ToString("yyyy-MM-dd"); addValue.fEDU7 = dr["FamilyEducation7"].ToString(); addValue.fProfession7 = dr["FamilyProfession7"].ToString(); addValue.fLive7 = dr["FamilyLive7"].ToString(); addValue.fHearing7 = dr["FamilyHearing7"].ToString(); addValue.fHealthy7 = dr["FamilyHealth7"].ToString(); addValue.familyText07 = dr["FamilyHealthText7"].ToString(); addValue.fAppellation8 = dr["FamilyAppellation8"].ToString(); addValue.fName8 = dr["FamilyName8"].ToString(); addValue.fBirthday8 = DateTime.Parse(dr["FamilyBirthday8"].ToString()).ToString("yyyy-MM-dd"); addValue.fEDU8 = dr["FamilyEducation8"].ToString(); addValue.fProfession8 = dr["FamilyProfession8"].ToString(); addValue.fLive8 = dr["FamilyLive8"].ToString(); addValue.fHearing8 = dr["FamilyHearing8"].ToString(); addValue.fHealthy8 = dr["FamilyHealth8"].ToString(); addValue.familyText08 = dr["FamilyHealthText8"].ToString(); addValue.lang1 = dr["FamilyLanguage"].ToString(); addValue.lang1t01 = dr["FamilyLanguageText"].ToString(); addValue.lang2 = dr["FamilyConnectLanguage"].ToString(); addValue.lang2t01 = dr["FamilyConnectLanguageText"].ToString(); addValue.familyEcological = dr["FamilyProfile1"].ToString(); addValue.famailySituation = dr["FamilyProfile2"].ToString(); addValue.famailyMedical = dr["FamilyProfile3"].ToString(); addValue.famailyActionSituation = dr["FamilyProfile4"].ToString(); addValue.fswAssess = dr["FamilyProfile5"].ToString(); StaffData = sDB.getStaffDataName(dr["FamilyProfileWriteName"].ToString()); addValue.socialName = StaffData[1]; addValue.socialDate = DateTime.Parse(dr["FamilyProfileWriteDate"].ToString()).ToString("yyyy-MM-dd"); returnValue.StudentData = addValue; StudentHearingInformation addValue2 = new StudentHearingInformation(); addValue2.history = dr["StudentDevelop"].ToString(); addValue2.history02t01 = dr["StudentDevelopText21"].ToString(); addValue2.history02t02 = dr["StudentDevelopText22"].ToString(); addValue2.history03t01 = dr["StudentDevelopText31"].ToString(); addValue2.history06t01 = dr["StudentDevelopText61"].ToString(); addValue2.history06t02 = dr["StudentDevelopText62"].ToString(); addValue2.history08t01 = dr["StudentDevelopText81"].ToString(); addValue2.history10t01 = dr["StudentDevelopText10"].ToString(); addValue2.history11t01 = dr["StudentDevelopText11"].ToString(); addValue2.history12t01 = dr["StudentDevelopText12"].ToString(); addValue2.problems01t01 = dr["HearingProblemAge"].ToString(); addValue2.problems01t02 = dr["HearingProblemMonth"].ToString(); addValue2.hearingQ = dr["HearingProblem"].ToString(); addValue2.hearingQText = dr["HearingProblemText"].ToString(); addValue2.problems02t01 = dr["DiagnoseAge"].ToString(); addValue2.problems02t02 = dr["DiagnoseMonth"].ToString(); addValue2.problems02t03 = dr["DiagnoseAgency"].ToString(); addValue2.problems02t04 = dr["DiagnoseR"].ToString(); addValue2.problems02t05 = dr["DiagnoseL"].ToString(); addValue2.hearingcheck = dr["NewbornHearing"].ToString(); addValue2.hearingYescheck = dr["NewbornHearingInspection"].ToString(); addValue2.hearingYesPlace = dr["NewbornHearingInspectionAgency"].ToString(); addValue2.hearingYesResultR = dr["NewbornHearingInspectionDiagnoseR"].ToString(); addValue2.hearingYesResultL = dr["NewbornHearingInspectionDiagnoseL"].ToString(); addValue2.sleepcheck = dr["AuditoryElectrophysiology1"].ToString(); addValue2.sleepcheckTime1 = DateTime.Parse(dr["AuditoryElectrophysiology_Date1"].ToString()).ToString("yyyy-MM-dd");//dr["AuditoryElectrophysiology_Date1"].ToString(); addValue2.sleepcheckPlace1 = dr["AuditoryElectrophysiology_Agency1"].ToString(); addValue2.sleepcheckCheckItem1 = dr["AuditoryElectrophysiology_Item1"].ToString(); addValue2.sleepcheckResultL1 = dr["AuditoryElectrophysiology_Diagnose1R"].ToString(); addValue2.sleepcheckResultR1 = dr["AuditoryElectrophysiology_Diagnose1L"].ToString(); addValue2.sleepcheckTime2 = DateTime.Parse(dr["AuditoryElectrophysiology_Date2"].ToString()).ToString("yyyy-MM-dd"); addValue2.sleepcheckPlace2 = dr["AuditoryElectrophysiology_Agency2"].ToString(); addValue2.sleepcheckCheckItem2 = dr["AuditoryElectrophysiology_Item2"].ToString(); addValue2.sleepcheckResultL2 = dr["AuditoryElectrophysiology_Diagnose2R"].ToString(); addValue2.sleepcheckResultR2 = dr["AuditoryElectrophysiology_Diagnose2L"].ToString(); addValue2.sleepcheckTime3 = DateTime.Parse(dr["AuditoryElectrophysiology_Date3"].ToString()).ToString("yyyy-MM-dd"); addValue2.sleepcheckPlace3 = dr["AuditoryElectrophysiology_Agency3"].ToString(); addValue2.sleepcheckCheckItem3 = dr["AuditoryElectrophysiology_Item3"].ToString(); addValue2.sleepcheckResultL3 = dr["AuditoryElectrophysiology_Diagnose3R"].ToString(); addValue2.sleepcheckResultR3 = dr["AuditoryElectrophysiology_Diagnose3L"].ToString(); addValue2.sleepcheckTime4 = DateTime.Parse(dr["AuditoryElectrophysiology_Date4"].ToString()).ToString("yyyy-MM-dd"); addValue2.sleepcheckPlace4 = dr["AuditoryElectrophysiology_Agency4"].ToString(); addValue2.sleepcheckCheckItem4 = dr["AuditoryElectrophysiology_Item4"].ToString(); addValue2.sleepcheckResultL4 = dr["AuditoryElectrophysiology_Diagnose4R"].ToString(); addValue2.sleepcheckResultR4 = dr["AuditoryElectrophysiology_Diagnose4L"].ToString(); addValue2.sleepcheckTime5 = DateTime.Parse(dr["AuditoryElectrophysiology_Date5"].ToString()).ToString("yyyy-MM-dd"); addValue2.sleepcheckPlace5 = dr["AuditoryElectrophysiology_Agency5"].ToString(); addValue2.sleepcheckCheckItem5 = dr["AuditoryElectrophysiology_Item5"].ToString(); addValue2.sleepcheckResultL5 = dr["AuditoryElectrophysiology_Diagnose5R"].ToString(); addValue2.sleepcheckResultR5 = dr["AuditoryElectrophysiology_Diagnose5L"].ToString(); addValue2.ctmri = dr["CTorMRI"].ToString(); addValue2.ctmriTime = DateTime.Parse(dr["CTorMRI_Date1"].ToString()).ToString("yyyy-MM-dd"); addValue2.ctmriPlace = dr["CTorMRI_Agency1"].ToString(); addValue2.ctmriResultL = dr["CTorMRI_DiagnoseR"].ToString(); addValue2.ctmriResultR = dr["CTorMRI_DiagnoseL"].ToString(); addValue2.gene = dr["GeneScreening"].ToString(); addValue2.geneTime = DateTime.Parse(dr["GeneScreening_Date"].ToString()).ToString("yyyy-MM-dd"); addValue2.genePlace = dr["GeneScreening_Agency"].ToString(); addValue2.geneResult = dr["GeneScreening_Item"].ToString(); addValue2.familyhistory = dr["FamilyHearingProblemHistory"].ToString(); addValue2.familyhistoryText = dr["FamilyHearingProblemHistoryText"].ToString(); addValue2.changehistory = dr["HearingChangeHistory"].ToString(); addValue2.changehistoryText = dr["HearingChangeHistoryText"].ToString(); addValue2.assistmanage = dr["AidsManagement"].ToString(); addValue2.accessory = dr["AidsManagementTextAge"].ToString(); addValue2.assistmanageR = dr["HearingAids_R"].ToString(); addValue2.brandR = dr["AidsBrand_R"].ToString(); addValue2.modelR = dr["AidsModel_R"].ToString(); addValue2.buyingPlaceR = dr["AidsOptionalLocation_R"].ToString(); addValue2.buyingtimeR = DateTime.Parse(dr["AidsOptionalTime_R"].ToString()).ToString("yyyy-MM-dd"); addValue2.insertHospitalR = dr["EEarHospital_R"].ToString(); addValue2.openHzDateR = DateTime.Parse(dr["EEarOpen_R"].ToString()).ToString("yyyy-MM-dd"); addValue2.assistmanageL = dr["HearingAids_L"].ToString(); addValue2.brandL = dr["AidsBrand_L"].ToString(); addValue2.modelL = dr["AidsModel_L"].ToString(); addValue2.buyingtimeL = DateTime.Parse(dr["AidsOptionalTime_L"].ToString()).ToString("yyyy-MM-dd"); addValue2.buyingPlaceL = dr["AidsOptionalLocation_L"].ToString(); addValue2.insertHospitalL = dr["EEarHospital_L"].ToString(); addValue2.openHzDateL = DateTime.Parse(dr["EEarOpen_L"].ToString()).ToString("yyyy-MM-dd"); addValue2.allassis = dr["AllDayAids"].ToString(); addValue2.allassisNoText = dr["AllDayAidsText"].ToString(); addValue2.assis1 = dr["ActiveReaction"].ToString(); addValue2.assis1NoText = dr["ActiveReactionText"].ToString(); addValue2.assis2 = dr["BasicCare"].ToString(); addValue2.assis2NoText = dr["BasicCareText"].ToString(); addValue2.assisFM = dr["UseFMsystem"].ToString(); addValue2.assisFMBrand = dr["UseFMsystemBrand"].ToString(); addValue2.assessnotes = dr["HearingAssessmentSummary"].ToString(); addValue2.assessnotes1 = dr["EarEndoscopy"].ToString(); addValue2.assessnotes102Text = dr["EarEndoscopyAbnormalText"].ToString(); addValue2.problems11t02 = dr["PureToneText"].ToString(); addValue2.assessnotes2 = dr["Tympanogram"].ToString(); addValue2.problems11t03 = dr["SATorSDT"].ToString(); addValue2.problems11t04 = dr["SpeechRecognition"].ToString(); addValue2.problems11t05 = dr["AidsSystem"].ToString(); addValue2.problems11t06 = dr["HearingInspection"].ToString(); addValue2.problems11t07 = dr["HearingOther"].ToString(); addValue2.inspectorID = dr["Audiologist"].ToString(); addValue2.inspectorDate = DateTime.Parse(dr["SurveyingDate"].ToString()).ToString("yyyy-MM-dd"); returnValue.HearingData = addValue2; StudentTeachingInformation addValue4 = new StudentTeachingInformation(); addValue4.case1 = dr["CaseFamilyCooperative"].ToString(); addValue4.case1t04 = dr["EntrustOthers"].ToString(); addValue4.case1t05 = dr["CooperativeDifficulty"].ToString(); addValue4.case2 = dr["RearingAttitude"].ToString(); addValue4.case21 = dr["RearingAttitude1"].ToString(); addValue4.case21t01 = dr["RearingAttitude1Text"].ToString(); addValue4.case22 = dr["RearingAttitude2"].ToString(); addValue4.case22t01 = dr["RearingAttitude2Text"].ToString(); addValue4.case23 = dr["RearingAttitude3"].ToString(); addValue4.case23t01 = dr["RearingAttitude3Text"].ToString(); addValue4.case24 = dr["RearingAttitude4"].ToString(); addValue4.case24t01 = dr["RearingAttitude4Text"].ToString(); addValue4.case25 = dr["RearingAttitude5"].ToString(); addValue4.case25t01 = dr["RearingAttitude5Text"].ToString(); addValue4.case26 = dr["RearingAttitude6"].ToString(); addValue4.case26t01 = dr["RearingAttitude6Text"].ToString(); addValue4.case3 = dr["Dispositional"].ToString(); addValue4.case31 = dr["Dispositional1"].ToString(); addValue4.case31t01 = dr["Dispositional1Text"].ToString(); addValue4.case32 = dr["Dispositional2"].ToString(); addValue4.case32t01 = dr["Dispositional2Text"].ToString(); addValue4.case33 = dr["Dispositional3"].ToString(); addValue4.case33t01 = dr["Dispositional3Text"].ToString(); addValue4.case34 = dr["Dispositional4"].ToString(); addValue4.case34t01 = dr["Dispositional4Text"].ToString(); addValue4.attend = dr["Attendance"].ToString(); addValue4.attend01t01 = dr["AttendanceText"].ToString(); addValue4.accompany = dr["TeachEscorts"].ToString(); addValue4.accompany01t01 = dr["TeachEscortsText"].ToString(); addValue4.teach = dr["AfterTeach"].ToString(); addValue4.teach01t01 = dr["AfterTeachText"].ToString(); addValue4.caseQ = dr["MajorProblem"].ToString(); addValue4.caseQ01t01 = dr["MajorProblemText"].ToString(); addValue4.OtherRemark1 = dr["RemarkOther"].ToString(); addValue4.case4 = dr["LearningAttitude"].ToString(); addValue4.case5 = dr["Temperament"].ToString(); addValue4.case6 = dr["Activity"].ToString(); addValue4.case7 = dr["Focus"].ToString(); addValue4.case8 = dr["Persistence"].ToString(); addValue4.case9 = dr["CommunicationBehavior"].ToString(); addValue4.case10 = dr["AuditorySkill"].ToString(); addValue4.case11 = dr["Acknowledge"].ToString(); addValue4.case12 = dr["Language"].ToString(); addValue4.case12t01 = dr["LanguageText"].ToString(); addValue4.case13 = dr["Action"].ToString(); addValue4.wear = dr["WearAids"].ToString(); addValue4.mind = dr["SpiritAndCoordinate"].ToString(); addValue4.mind01t01 = dr["SpiritAndCoordinateOther"].ToString(); addValue4.connectwish = dr["Communication"].ToString(); addValue4.studywish = dr["LearningDesire"].ToString(); addValue4.related = dr["AttachmentData"].ToString(); addValue4.related01t01 = dr["AttachmentDataText"].ToString(); addValue4.OtherRemark2 = dr["RemarkOther2"].ToString(); addValue4.case14 = dr["ExistingResources"].ToString(); addValue4.trusteeship = dr["InterventionAgencies"].ToString(); addValue4.case14t01 = dr["HospitalIntervention"].ToString(); addValue4.proceed = dr["RelatedIntervention"].ToString(); addValue4.proceedt01 = dr["RelatedInterventionText"].ToString(); addValue4.preschools = dr["InNurserySchool"].ToString(); addValue4.case15 = dr["HearingRehabilitation"].ToString(); addValue4.Rehabilitation1 = dr["CaseNeed"].ToString(); addValue4.Rehabilitation2 = dr["CaseFamilyEnthusiasm"].ToString(); addValue4.Rehabilitation3 = dr["Rehousing"].ToString(); addValue4.Rehabilitation3Text = dr["RehousingText"].ToString(); addValue4.case16 = dr["CaseFamilyCourseProposal"].ToString(); addValue4.OtherRemark3 = dr["CaseFamilyCourseProposalText"].ToString(); addValue4.case17 = dr["CaseCourseProposal"].ToString(); addValue4.OtherRemark4 = dr["CaseCourseProposalText"].ToString(); addValue4.teacherID = dr["Teacher"].ToString(); addValue4.teacherDate = DateTime.Parse(dr["TeacherDate"].ToString()).ToString("yyyy-MM-dd"); returnValue.TeachData = addValue4; } dr.Close(); List<StudentBodyInformation> addValue3 = new List<StudentBodyInformation>(); sql = "SELECT * FROM StudentHeightWeightRecord WHERE isDeleted=0 AND StudentID=(@ID)"; cmd = new SqlCommand(sql, Sqlconn); cmd.Parameters.Add("@ID", SqlDbType.NVarChar).Value = returnValue.StudentData.studentID; dr = cmd.ExecuteReader(); while (dr.Read()) { StudentBodyInformation addValue3item = new StudentBodyInformation(); addValue3item.RecordID = dr["hwID"].ToString(); addValue3item.RecordDate = DateTime.Parse(dr["hwDate"].ToString()).ToString("yyyy-MM-dd"); addValue3item.studentID = dr["StudentID"].ToString(); addValue3item.RecordHeight = dr["StudentHeight"].ToString(); addValue3item.RecordWeight = dr["StudentWeight"].ToString(); addValue3item.RecordRemark = dr["hwRemark"].ToString(); addValue3.Add(addValue3item); } dr.Close(); returnValue.BodyData = addValue3; Sqlconn.Close(); } catch (Exception e) { returnValue.checkNo = "-1"; returnValue.errorMsg = e.Message; } } return returnValue; }
public string[] setStudentDataBase7(StudentTeachingInformation StudentTeachingData) { TeachDataBase aDB = new TeachDataBase(); aDB.personnelFunction(); CaseDataBase SDB = new CaseDataBase(); //if (int.Parse(aDB._StaffhaveRoles[1]) == 1) //{ return SDB.setStudentDataBase7(StudentTeachingData); //} //else //{ // return new string[2] { _noRole, _errorMsg }; //} }
public StudentTeachingInformation getStudentData7(string ID) { StudentTeachingInformation returnValue = new StudentTeachingInformation(); DataBase Base = new DataBase(); using (SqlConnection Sqlconn = new SqlConnection(Base.GetConnString())) { try { Sqlconn.Open(); string sql = "SELECT * FROM StudentDatabase WHERE isDeleted=0 AND ID=(@ID)"; SqlCommand cmd = new SqlCommand(sql, Sqlconn); cmd.Parameters.Add("@ID", SqlDbType.BigInt).Value = Chk.CheckStringtoInt64Function(ID); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { returnValue.case1 = dr["CaseFamilyCooperative"].ToString(); returnValue.case1t04 = dr["EntrustOthers"].ToString(); returnValue.case1t05 = dr["CooperativeDifficulty"].ToString(); returnValue.case2 = dr["RearingAttitude"].ToString(); returnValue.case21 = dr["RearingAttitude1"].ToString(); returnValue.case21t01 = dr["RearingAttitude1Text"].ToString(); returnValue.case22 = dr["RearingAttitude2"].ToString(); returnValue.case22t01 = dr["RearingAttitude2Text"].ToString(); returnValue.case23 = dr["RearingAttitude3"].ToString(); returnValue.case23t01 = dr["RearingAttitude3Text"].ToString(); returnValue.case24 = dr["RearingAttitude4"].ToString(); returnValue.case24t01 = dr["RearingAttitude4Text"].ToString(); returnValue.case25 = dr["RearingAttitude5"].ToString(); returnValue.case25t01 = dr["RearingAttitude5Text"].ToString(); returnValue.case26 = dr["RearingAttitude6"].ToString(); returnValue.case26t01 = dr["RearingAttitude6Text"].ToString(); returnValue.case3 = dr["Dispositional"].ToString(); returnValue.case31 = dr["Dispositional1"].ToString(); returnValue.case31t01 = dr["Dispositional1Text"].ToString(); returnValue.case32 = dr["Dispositional2"].ToString(); returnValue.case32t01 = dr["Dispositional2Text"].ToString(); returnValue.case33 = dr["Dispositional3"].ToString(); returnValue.case33t01 = dr["Dispositional3Text"].ToString(); returnValue.case34 = dr["Dispositional4"].ToString(); returnValue.case34t01 = dr["Dispositional4Text"].ToString(); returnValue.attend = dr["Attendance"].ToString(); returnValue.attend01t01 = dr["AttendanceText"].ToString(); returnValue.accompany = dr["TeachEscorts"].ToString(); returnValue.accompany01t01 = dr["TeachEscortsText"].ToString(); returnValue.teach = dr["AfterTeach"].ToString(); returnValue.teach01t01 = dr["AfterTeachText"].ToString(); returnValue.caseQ = dr["MajorProblem"].ToString(); returnValue.caseQ01t01 = dr["MajorProblemText"].ToString(); returnValue.OtherRemark1 = dr["RemarkOther"].ToString(); returnValue.case4 = dr["LearningAttitude"].ToString(); returnValue.case5 = dr["Temperament"].ToString(); returnValue.case6 = dr["Activity"].ToString(); returnValue.case7 = dr["Focus"].ToString(); returnValue.case8 = dr["Persistence"].ToString(); returnValue.case9 = dr["CommunicationBehavior"].ToString(); returnValue.case10 = dr["AuditorySkill"].ToString(); returnValue.case11 = dr["Acknowledge"].ToString(); returnValue.case12 = dr["Language"].ToString(); returnValue.case12t01 = dr["LanguageText"].ToString(); returnValue.case13 = dr["Action"].ToString(); returnValue.wear = dr["WearAids"].ToString(); returnValue.mind = dr["SpiritAndCoordinate"].ToString(); returnValue.mind01t01 = dr["SpiritAndCoordinateOther"].ToString(); returnValue.connectwish = dr["Communication"].ToString(); returnValue.studywish = dr["LearningDesire"].ToString(); returnValue.related = dr["AttachmentData"].ToString(); returnValue.related01t01 = dr["AttachmentDataText"].ToString(); returnValue.OtherRemark2 = dr["RemarkOther2"].ToString(); returnValue.case14 = dr["ExistingResources"].ToString(); returnValue.trusteeship = dr["InterventionAgencies"].ToString(); returnValue.case14t01 = dr["HospitalIntervention"].ToString(); returnValue.proceed = dr["RelatedIntervention"].ToString(); returnValue.proceedt01 = dr["RelatedInterventionText"].ToString(); returnValue.preschools = dr["InNurserySchool"].ToString(); returnValue.case15 = dr["HearingRehabilitation"].ToString(); returnValue.Rehabilitation1 = dr["CaseNeed"].ToString(); returnValue.Rehabilitation2 = dr["CaseFamilyEnthusiasm"].ToString(); returnValue.Rehabilitation3 = dr["Rehousing"].ToString(); returnValue.Rehabilitation3Text = dr["RehousingText"].ToString(); returnValue.case16 = dr["CaseFamilyCourseProposal"].ToString(); returnValue.OtherRemark3 = dr["CaseFamilyCourseProposalText"].ToString(); returnValue.case17 = dr["CaseCourseProposal"].ToString(); returnValue.OtherRemark4 = dr["CaseCourseProposalText"].ToString(); returnValue.teacherDate = DateTime.Parse(dr["TeacherDate"].ToString()).ToString("yyyy-MM-dd"); StaffDataBase sDB = new StaffDataBase(); List<string> StaffData = sDB.getStaffDataName(dr["Teacher"].ToString()); returnValue.teacherID = dr["Teacher"].ToString(); returnValue.teacherName = StaffData[1]; } Sqlconn.Close(); } catch (Exception e) { returnValue.checkNo = "-1"; returnValue.errorMsg = e.Message.ToString(); } return returnValue; } }
public StudentTeachingInformation getStudentDataBase7(string ID) { CaseDataBase SDB = new CaseDataBase(); StudentTeachingInformation returnValue = new StudentTeachingInformation(); if (int.Parse(SDB._StaffhaveRoles[3]) == 1) { returnValue = SDB.getStudentData7(ID); } else { returnValue.checkNo = _noRole; returnValue.errorMsg = _errorMsg; } return returnValue; }