示例#1
0
 protected void uiDropDownListLanguage_SelectedIndexChanged(object sender, EventArgs e)
 {
     Course courses = new Course();
     courses.GetCourseByLanguageID(Convert.ToInt32(uiDropDownListLanguage.SelectedValue));
     if(courses.RowCount > 0)
         uiDropDownListCourses.DataSource = courses.DefaultView;
     else
         uiDropDownListCourses.DataSource = null;
     uiDropDownListCourses.DataTextField = "DisplayName";
     uiDropDownListCourses.DataValueField = Course.ColumnNames.CourseID;
     uiDropDownListCourses.DataBind();
 }
示例#2
0
        private void BindFields()
        {
            Student student = (Student)Session["CurrentUser"];
            ApplicationData app = new ApplicationData();
            app.GetApplicationByStudentID(student.StudentID);
            if (app.RowCount > 0 && app.IsSubmit == false)
            {
                uiTextBoxFamilyName.Text = app.FamilyName;
                uiTextBoxFirstName.Text = app.FirstName;
                uiTextBoxMiddleName.Text = app.MiddleName;
                if(!(app.IsColumnNull("DateOfBirth")))
                    uiTextBoxDOB.Text = app.DateOfBirth.ToString("dd/MM/yyyy");
                if (!app.IsColumnNull("CountryOfBirthID"))
                    uiDropDownListPOB.SelectedValue = app.CountryOfBirthID.ToString();

                uiTextBoxHeight.Text = app.Hieght.ToString();
                uiTextBoxWeight.Text = app.Weight.ToString();

                uiRadioButtonListGender.SelectedValue = app.GenderID.ToString();
                if (!(app.IsColumnNull("CitizenShipID")))
                    uiDropDownListCountry.SelectedValue = app.CitizenShipID.ToString();
                uiTextBoxPassNo.Text = app.PassportNo ;
                if(!app.IsColumnNull("PassportExpiryDate"))
                    uiTextBoxPassExp.Text = app.PassportExpiryDate.ToString("dd/MM/yyyy");
                if (!app.IsColumnNull("CountryOfIssueID"))
                    uiDropDownListCOI.SelectedValue = app.CountryOfIssueID.ToString();

                if (!app.IsColumnNull("HairColor"))
                    uiDropDownListHairColor.SelectedValue = app.HairColor;
                if (!app.IsColumnNull("EyeColor"))
                    uiDropDownListEyeColor.SelectedValue = app.EyeColor;

                uiTextBoxFaFamilyName.Text = app.FatherFamilyName;
                uiTextBoxFaFirstName.Text = app.FatherFirstName;
                uiTextBoxFaOccupation.Text = app.FatherOccupation;
                uiTextBoxFaHomePhone.Text = app.FatherHomePhone;
                uiTextBoxFaBusPhone.Text = app.FatherBusinessPhone;
                uiTextBoxFaMobile.Text = app.FatherCellPhone;
                uiTextBoxMoFamilyName.Text = app.MotherFamilyName;
                uiTextBoxMoFirstName.Text = app.MotherFirstName;
                uiTextBoxMoOccupation.Text = app.MotherOccupation;

                uiTextBoxStreetAddress.Text = app.StreetAddress;
                if (!app.IsColumnNull("CountryID"))
                    uiDropDownListAddressCountry.SelectedValue = app.CountryID.ToString();
                uiTextBoxCity.Text = app.City;
                uiTextBoxAddTele.Text = app.TelephoneNumber;
                uiTextBoxAddFax.Text = app.FaxNumber;
                uiTextBoxEmail.Text = app.Email;
                uiTextBoxCellphone.Text = app.CellPhone;

                uiTextBoxResAddress.Text = app.ResidentAddress;

                if (!string.IsNullOrEmpty(app.RecentPhotoPath))
                {
                    uiHiddenFieldRecentPhoto.Value = app.RecentPhotoPath;
                }
                else
                {
                    uiHiddenFieldRecentPhoto.Value = "";
                }

                uiTextBoxMDS.Text = app.MasterDegree;
                uiTextBoxMDUniversity.Text = app.University;
                if(!app.IsColumnNull("DateOfGraduation"))
                    uiTextBoxMDDate.Text = app.DateOfGraduation.ToString("dd/MM/yyyy");

                uiTextBoxBach.Text = app.BachelorDegree;
                uiTextBoxBachUni.Text = app.BachelorUniversity;
                if (!app.IsColumnNull("BachelorGraduationDate"))
                    uiTextBoxBachDate.Text = app.BachelorGraduationDate.ToString("dd/MM/yyyy");

                uiTextBoxHighSchool.Text = app.HighScool;
                uiTextBoxHighCollege.Text = app.HighSchoolCollege;
                if (!app.IsColumnNull("HighSchoolGradDate"))
                    uiTextBoxHighDate.Text = app.HighSchoolGradDate.ToString("dd/MM/yyyy");

                uiTextBoxDS.Text = app.DegreeSpecialization;
                uiTextBoxKOD.Text = app.KindOfDegree;
                uiTextBoxCS.Text = app.College;
                if (!app.IsColumnNull("DegreeDateOfGraduation"))
                    uiTextBoxDDOG.Text = app.DegreeDateOfGraduation.ToString("dd/MM/yyyy");

                if (!app.IsColumnNull("SelectedCourseID"))
                {
                    Course course = new Course();
                    course.LoadByPrimaryKey(app.SelectedCourseID);

                    uiDropDownListLanguage.SelectedValue = course.CourseLangaugeID.ToString();

                    Course courses = new Course();
                    courses.GetCourseByLanguageID(Convert.ToInt32(uiDropDownListLanguage.SelectedValue));
                    if (courses.RowCount > 0)
                        uiDropDownListCourses.DataSource = courses.DefaultView;
                    else
                        uiDropDownListCourses.DataSource = null;
                    uiDropDownListCourses.DataTextField = "DisplayName";
                    uiDropDownListCourses.DataValueField = Course.ColumnNames.CourseID;
                    uiDropDownListCourses.DataBind();

                    uiDropDownListCourses.SelectedValue = app.SelectedCourseID.ToString();
                }

                ApplicationAttachment attachments = new ApplicationAttachment();
                attachments.GetAttachmentsForNotSubmittedApplication(app.ApplicationDataID);
                uiPanelAttachments.Visible = (attachments.RowCount > 0);
                uiGridViewAttachments.DataSource = attachments.DefaultView;
                uiGridViewAttachments.DataBind();

            }
        }