}//------------------- //this procedure will update scholarship information public void UpdateScholarshipInformation(CommonExchange.SysAccess userInfo, CommonExchange.ScholarshipInformation scholarshipInfo) { using (RemoteClient.RemCntScholarshipManager remClient = new RemoteClient.RemCntScholarshipManager()) { remClient.UpdateScholarshipInformation(userInfo, scholarshipInfo); } Int32 index = 0; foreach (DataRow scholarRow in _classDataSet.Tables["ScholarshipInformationTable"].Rows) { if (String.Equals(scholarshipInfo.ScholarshipSysId, RemoteServerLib.ProcStatic.DataRowConvert(scholarRow, "sysid_scholarship", ""))) { DataRow editRow = _classDataSet.Tables["ScholarshipInformationTable"].Rows[index]; editRow.BeginEdit(); editRow["sysid_scholarship"] = scholarshipInfo.ScholarshipSysId; editRow["course_group_id"] = scholarshipInfo.CourseGroupInfo.CourseGroupId; editRow["department_id"] = scholarshipInfo.DepartmentInfo.DepartmentId; editRow["department_name"] = scholarshipInfo.DepartmentInfo.DepartmentName; editRow["department_acronym"] = scholarshipInfo.DepartmentInfo.Acronym; editRow["is_non_academic"] = scholarshipInfo.IsNonAcademic; editRow["scholarship_description"] = scholarshipInfo.ScholarshipDescription; editRow.EndEdit(); } index++; } }//----------------------
}//------------------ //this procedure will update student scholarship information public void UpdateStudentScholarshipInformation(CommonExchange.SysAccess userInfo, CommonExchange.StudentScholarship studentScholarshipInfo) { using (RemoteClient.RemCntScholarshipManager remClient = new RemoteClient.RemCntScholarshipManager()) { remClient.UpdateStudentScholarship(userInfo, studentScholarshipInfo); } Int32 index = 0; foreach (DataRow scholarRow in _studentScholarshipTable.Rows) { if (scholarRow.RowState != DataRowState.Deleted) { DataRow editRow = _studentScholarshipTable.Rows[index]; editRow.BeginEdit(); editRow["sysid_enrolmentlevel"] = studentScholarshipInfo.StudentEnrolmentLevelInfo.EnrolmentLevelSysId; editRow["is_non_academic"] = studentScholarshipInfo.ScholarshipInfo.IsNonAcademic; editRow["scholarship_description"] = studentScholarshipInfo.ScholarshipInfo.ScholarshipDescription; editRow["sysid_scholarship"] = studentScholarshipInfo.ScholarshipInfo.ScholarshipSysId; editRow["sysid_studentscholarship"] = studentScholarshipInfo.StudentScholarshipSysId; editRow.EndEdit(); } index++; } }//-------------------
}//--------------------------- //this function determines if student scholarship already exsits public Boolean IsExistsSysIDStudentScholarshipEnrolmentLevelStudentScholarship(CommonExchange.SysAccess userInfo, CommonExchange.StudentScholarship studentScholarship) { Boolean value; using (RemoteClient.RemCntScholarshipManager remClient = new RemoteClient.RemCntScholarshipManager()) { value = remClient.IsExistsSysIDStudentScholarshipEnrolmentLevelStudentScholarship(userInfo, studentScholarship); } return(value); }//--------------------------
}//------------------------ //this fucntion determines if scholarship description already exist public Boolean IsExistsScholarshipDescriptionScholarshipInformation(CommonExchange.SysAccess userInfo, CommonExchange.ScholarshipInformation scholarshipInfo) { Boolean value; using (RemoteClient.RemCntScholarshipManager remClient = new RemoteClient.RemCntScholarshipManager()) { value = remClient.IsExistsScholarshipDescriptionScholarshipInformation(userInfo, scholarshipInfo); } return(value); }//---------------------------
}//--------------------- //this procedure will initialized the class private void InitializeClass(CommonExchange.SysAccess userInfo) { //gets the server date and time using (RemoteClient.RemCntBaseManager remClient = new RemoteClient.RemCntBaseManager()) { _serverDateTime = remClient.GetServerDateTime(userInfo); } //-------------------------------- //get dataset for scholarship manager using (RemoteClient.RemCntScholarshipManager remClient = new RemoteClient.RemCntScholarshipManager()) { _classDataSet = remClient.GetDataSetForScholarship(userInfo, _serverDateTime); } }//-------------------------
}//------------------- //this procedure will insert student scholarship information public void InsertStudentScholarship(CommonExchange.SysAccess userInfo, CommonExchange.StudentScholarship studentScholarshipInfo) { using (RemoteClient.RemCntScholarshipManager remClient = new RemoteClient.RemCntScholarshipManager()) { remClient.InsertStudentScholarship(userInfo, ref studentScholarshipInfo); } DataRow newRow = _studentScholarshipTable.NewRow(); newRow["sysid_enrolmentlevel"] = studentScholarshipInfo.StudentEnrolmentLevelInfo.EnrolmentLevelSysId; newRow["is_non_academic"] = studentScholarshipInfo.ScholarshipInfo.IsNonAcademic; newRow["scholarship_description"] = studentScholarshipInfo.ScholarshipInfo.ScholarshipDescription; newRow["sysid_scholarship"] = studentScholarshipInfo.ScholarshipInfo.ScholarshipSysId; newRow["sysid_studentscholarship"] = studentScholarshipInfo.StudentScholarshipSysId; _studentScholarshipTable.Rows.Add(newRow); }//------------------
//this procedure will insert scholarship information public void InsertScholarshipInformation(CommonExchange.SysAccess userInfo, CommonExchange.ScholarshipInformation scholarshipInfo) { using (RemoteClient.RemCntScholarshipManager remClient = new RemoteClient.RemCntScholarshipManager()) { remClient.InsertScholarshipInformation(userInfo, ref scholarshipInfo); } DataRow newRow = _classDataSet.Tables["ScholarshipInformationTable"].NewRow(); newRow["sysid_scholarship"] = scholarshipInfo.ScholarshipSysId; newRow["course_group_id"] = scholarshipInfo.CourseGroupInfo.CourseGroupId; newRow["group_description"] = scholarshipInfo.CourseGroupInfo.GroupDescription; newRow["department_id"] = scholarshipInfo.DepartmentInfo.DepartmentId; newRow["department_name"] = this.GetDepartmentDescription(scholarshipInfo.DepartmentInfo.DepartmentId); newRow["department_acronym"] = this.GetDepartmentAcronym(scholarshipInfo.DepartmentInfo.DepartmentId); newRow["is_non_academic"] = scholarshipInfo.IsNonAcademic; newRow["scholarship_description"] = scholarshipInfo.ScholarshipDescription; _classDataSet.Tables["ScholarshipInformationTable"].Rows.Add(newRow); }//-------------------
}//---------------------- //this procedure will delete student scholarship information public void DeleteStudentScholarshipInformation(CommonExchange.SysAccess userInfo, CommonExchange.StudentScholarship studentScholarshipInfo) { using (RemoteClient.RemCntScholarshipManager remClient = new RemoteClient.RemCntScholarshipManager()) { remClient.DeleteStudentScholarship(userInfo, studentScholarshipInfo); } Int32 index = 0; foreach (DataRow scholarRow in _studentScholarshipTable.Rows) { if (scholarRow.RowState != DataRowState.Deleted && String.Equals(studentScholarshipInfo.StudentScholarshipSysId, RemoteServerLib.ProcStatic.DataRowConvert(scholarRow, "sysid_studentscholarship", ""))) { DataRow delRow = _studentScholarshipTable.Rows[index]; delRow.Delete(); } index++; } }//-------------------------
}//------------------------------- #endregion #region Programer-Defined Functions //this fucntion gets the search student scholarship public DataTable GetSearchedStudentScholarship(CommonExchange.SysAccess userInfo, String queryString, String dateStart, String dateEnd, String scholarshipSysIdList, String departmentIdList, String yearLevelIdList) { DataTable newTable = new DataTable("StudentSearchByStudentNameIdCardNumberTable"); newTable.Columns.Add("sysid_studentscholarship", System.Type.GetType("System.String")); newTable.Columns.Add("student_name", System.Type.GetType("System.String")); newTable.Columns.Add("scholarship_description", System.Type.GetType("System.String")); newTable.Columns.Add("student_id", System.Type.GetType("System.String")); newTable.Columns.Add("card_number", System.Type.GetType("System.String")); newTable.Columns.Add("course_title", System.Type.GetType("System.String")); newTable.Columns.Add("year_level_description", System.Type.GetType("System.String")); newTable.Columns.Add("department_name", System.Type.GetType("System.String")); newTable.Columns.Add("present_address", System.Type.GetType("System.String")); newTable.Columns.Add("present_phone_nos", System.Type.GetType("System.String")); newTable.Columns.Add("home_address", System.Type.GetType("System.String")); newTable.Columns.Add("home_phone_nos", System.Type.GetType("System.String")); newTable.Columns.Add("emer_contact_name", System.Type.GetType("System.String")); newTable.Columns.Add("emer_relationship_description", System.Type.GetType("System.String")); newTable.Columns.Add("emer_present_address", System.Type.GetType("System.String")); newTable.Columns.Add("emer_present_phone_nos", System.Type.GetType("System.String")); newTable.Columns.Add("emer_home_address", System.Type.GetType("System.String")); newTable.Columns.Add("emer_home_phone_nos", System.Type.GetType("System.String")); if (!String.IsNullOrEmpty(queryString)) { using (RemoteClient.RemCntScholarshipManager remClient = new RemoteClient.RemCntScholarshipManager()) { _studentScholarshipTable = remClient.SelectStudentScholarship(userInfo, queryString, dateStart, dateEnd, scholarshipSysIdList, departmentIdList, yearLevelIdList); } } foreach (DataRow studentRow in _studentScholarshipTable.Rows) { DataRow newRow = newTable.NewRow(); newRow["sysid_studentscholarship"] = RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "sysid_studentscholarship", ""); newRow["student_name"] = RemoteClient.ProcStatic.GetCompleteNameMiddleInitial(studentRow, "last_name", "first_name", "middle_name"); newRow["course_title"] = RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "course_title", "") + " - " + RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "course_acronym", ""); newRow["scholarship_description"] = RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "scholarship_description", ""); newRow["student_id"] = RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "student_id", ""); newRow["card_number"] = RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "card_number", ""); newRow["year_level_description"] = RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "year_level_description", ""); newRow["department_name"] = RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "department_name", "") + " - " + RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "department_acronym", ""); newRow["present_address"] = RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "present_address", ""); newRow["present_phone_nos"] = RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "present_phone_nos", ""); newRow["home_address"] = RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "home_address", ""); newRow["home_phone_nos"] = RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "home_phone_nos", ""); newRow["emer_contact_name"] = RemoteClient.ProcStatic.GetCompleteNameMiddleInitial(studentRow, "emer_last_name", "emer_first_name", "emer_middle_name"); newRow["emer_relationship_description"] = RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "emer_relationship_description", String.Empty); newRow["emer_present_address"] = RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "emer_present_address", String.Empty); newRow["emer_present_phone_nos"] = RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "emer_present_phone_nos", String.Empty); newRow["emer_home_address"] = RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "emer_home_address", String.Empty); newRow["emer_home_phone_nos"] = RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "emer_home_phone_nos", String.Empty); newTable.Rows.Add(newRow); } newTable.AcceptChanges(); return(newTable); }//------------------------------