private void initPage() { lblTitle.Text = "Student's Application History"; USTTI.Data.USTTIDataAccess data = new USTTI.Data.USTTIDataAccess(); USTTI.Base.Student StudentInfo = data.GetStudentInfo(StudentID); student_info_header.SetObjectValue(StudentInfo.FirstName, StudentInfo.LastName, StudentInfo.DOB.ToString(), StudentInfo.CountryName); string sql = "SELECT a.*,s.firstname,s.lastname,c.countryname,o.date_from " + "FROM application a,student s,country c,orientation o WHERE s.studentid=a.studentid AND c.countryid=s.countryid " + "AND o.orientid=a.orientid AND a.studentid='" + StudentID + "' ORDER BY a.applicdate DESC"; DataTable dt = data.Fill(sql); dgApplication.DataSource = dt; dgApplication.DataBind(); if (dt.DefaultView.Count.Equals(0)) { lblMessNull.Text = "No Application History for This Student"; lblMessNull.Visible = true; } else { lblMessNull.Visible = false; } }
private void initPage() { txtSID.Text = Convert.ToString(StudentID); application_date.GenerateDateList(2006, 2020); SetDefaultApplicationDate(); arrival_date.GenerateDateList(2006, 2020); departure_date.GenerateDateList(2006, 2020); checkout_date.GenerateDateList(2006, 2020); RequiredFieldValidator1.Enabled = false; RequiredFieldValidator2.Enabled = false; application_date.setValidatorOff(); arrival_date.setValidatorOff(); departure_date.setValidatorOff(); checkout_date.setValidatorOff(); RequiredFieldValidator3.Enabled = false; USTTI.Data.USTTIDataAccess data = new USTTI.Data.USTTIDataAccess(); USTTI.Base.Student StudentInfo = data.GetStudentInfo(StudentID); if (lblStartDate.Text.Length.Equals(0)) { btnBrowseOID.Visible = true; } else { btnBrowseOID.Visible = false; } lblStudentName.Text = StudentInfo.FirstName + " " + StudentInfo.LastName; }
private void initPage() { USTTI.Data.USTTIDataAccess data = new USTTI.Data.USTTIDataAccess(); USTTI.Base.Student StudentInfo = data.GetStudentInfo(StudentID); student_header_info.SetObjectValue(StudentInfo.FirstName, StudentInfo.LastName, StudentInfo.DOB.ToString(), StudentInfo.CountryName); ViewCourseLoadDetail(); tblSubPageEntryDetail.Visible = false; }
private void initPage() { InitiateFunderList(); InitiateFundTypeList(); start_date.GenerateDateList(2006, 2020); end_date.GenerateDateList(2006, 2020); USTTI.Data.USTTIDataAccess data = new USTTI.Data.USTTIDataAccess(); USTTI.Base.Student StudentInfo = data.GetStudentInfo(StudentID); student_info_header.SetObjectValue(StudentInfo.FirstName, StudentInfo.FirstName, StudentInfo.DOB.ToString(), StudentInfo.CountryName); ViewFundingListDetail(); tblSubPageEntryDetail.Visible = false; }
private bool IsDuplicate() { bool IsDuplicate = false; USTTI.Data.USTTIDataAccess data = new USTTI.Data.USTTIDataAccess(); string sql = "SELECT applicationid FROM application WHERE studentid=" + StudentID; DataTable dt = data.Fill(sql); if (dt.DefaultView.Count > 0) { IsDuplicate = true; } return(IsDuplicate); }
protected bool IsDuplicate(string ApplicationID, string FunderID) { bool TrueStatement = false; string sql = "SELECT * FROM funding" + " WHERE applicationid=" + ApplicationID + " AND funderid=" + FunderID; USTTI.Data.USTTIDataAccess data = new USTTI.Data.USTTIDataAccess(); DataTable dt = data.Fill(sql); if (dt.DefaultView.Count > 0) { TrueStatement = true; } return(TrueStatement); }
protected bool IsDuplicate(string StudentID, string ApplicationID, string CourseID) { bool trueStatement = false; string sql = "SELECT * FROM studentcourse" + " WHERE applicationid=" + ApplicationID + " AND courseid='" + CourseID + "'" + " AND studentid='" + StudentID + "'"; USTTI.Data.USTTIDataAccess data = new USTTI.Data.USTTIDataAccess(); DataTable dt = data.Fill(sql); if (dt.DefaultView.Count > 0) { trueStatement = true; } return(trueStatement); }
protected void AddFunder() { USTTI.Data.USTTIDataAccess data = new USTTI.Data.USTTIDataAccess(); Decimal FundingID = data.GetNextFundingID(); string sql = "SELECT * FROM application WHERE studentid=" + StudentID; DataTable dt = data.Fill(sql); if (dt.DefaultView.Count.Equals(0)) { lblNullMessage3.Visible = true; lblNullMessage3.Text = "This student does not have application record"; lblNullMessage2.Visible = false; return; } USTTI.Base.Funding funder = new USTTI.Base.Funding(); funder.FundingID = Convert.ToString(FundingID); funder.ApplicationID = Convert.ToString(dt.Rows[0]["applicationid"].ToString()); funder.StudentID = Convert.ToString(StudentID); funder.FunderID = FunderList.SelectedValue; funder.FunderTypeID = FundTypeList.SelectedValue; funder.StartDate = start_date.GetDate(); funder.EndDate = end_date.GetDate(); funder.Year = ""; funder.flAmount = Convert.ToDecimal(txtAmount.Text); funder.PIO = ""; if (IsDuplicate(funder.ApplicationID, funder.FunderID)) { lblDupMessage.Visible = true; return; } data.InsertFundingRecord(funder); ViewFundingListDetail(); }
protected void AddCourseLoad() { USTTI.Data.USTTIDataAccess data = new USTTI.Data.USTTIDataAccess(); Decimal EnrollmentID = data.GetNextStudentCourseID(); string sql = "SELECT * FROM application WHERE studentid=" + StudentID; DataTable dt = data.Fill(sql); if (dt.DefaultView.Count.Equals(0)) { lblNullMessage3.Visible = true; lblNullMessage3.Text = "This student does not have application record"; lblNullMessage2.Visible = false; return; } USTTI.Base.Enrollment enrollment = new USTTI.Base.Enrollment(); enrollment.EnrollmentID = Convert.ToString(EnrollmentID); enrollment.StudentID = Convert.ToString(StudentID); enrollment.CourseID = txtCID.Text; enrollment.ApplicationID = dt.Rows[0]["applicationid"].ToString(); enrollment.Accepted = AcceptedButtonList.SelectedValue; enrollment.Confirmed = ConfirmButtonList.SelectedValue; enrollment.Participated = ParticipatButtonList.SelectedValue; enrollment.FaxSent = FaxButtonList.SelectedValue; enrollment.Pref = ""; enrollment.Year = DateTime.Now.Year.ToString().Trim(); if (IsDuplicate(enrollment.StudentID, enrollment.ApplicationID, enrollment.CourseID)) { lblDupMessage.Visible = true; return; } else { data.InsertEnrollmentRecord(enrollment); } }
protected void SaveUserInput() { USTTI.Data.USTTIDataAccess data = new USTTI.Data.USTTIDataAccess(); Decimal ApplicationID = data.GetNextApplicationID(); Application newApplication = new Application(); newApplication.ApplicationID = ApplicationID; newApplication.SID = txtSID.Text.Trim(); newApplication.OID = txtOID.Text.Trim(); newApplication.AppDate = application_date.GetDate().Trim(); newApplication.ArrUS = arrival_date.GetDate().Trim(); newApplication.DeptUS = departure_date.GetDate().Trim(); newApplication.Year = lblYear.Text.Trim(); newApplication.HotelDC = HotelDCButtonList.SelectedItem.Text.Trim(); newApplication.ChkoutDate = checkout_date.GetDate().Trim(); newApplication.NeedsFund = NeedsFundRadioButton.SelectedItem.Text.Trim(); newApplication.Memo = ""; data.InsertApplicationRecord(newApplication); }