protected void Dropdown_StudentlList(int StudentId) { ddlStudent.Items.Clear(); var cglobal = new CGlobal(); int SiteLocationId = CurrentSiteLocationId; if (StudentId > 0) { var cStudentRequest = new CDormitoryRegistrations(); SiteLocationId = cStudentRequest.SiteLocationbyStudentId(StudentId); } ddlStudent.DataSource = cglobal.LoadStudentList(SiteLocationId);//CurrentSiteLocationId ddlStudent.DataTextField = "Name"; ddlStudent.DataValueField = "Value"; if (StudentId == 0) { ddlStudent.SelectedIndex = 0; } else { ddlStudent.SelectedValue = StudentId.ToString(); } ddlStudent.DataBind(); }
protected void Dropdown_StudentlList(int DormitoryRegistrationId, int StudentId) { ddlStudent.Items.Clear(); var cglobal = new CGlobal(); int SiteLocationId = CurrentSiteLocationId; if (StudentId > 0) { var cStudentRequest = new CDormitoryRegistrations(); SiteLocationId = cStudentRequest.SiteLocationbyStudentId(StudentId); } ddlStudent.DataSource = cglobal.LoadStudentList(SiteLocationId); //CurrentSiteLocationId ddlStudent.DataTextField = "Name"; ddlStudent.DataValueField = "Value"; ddlStudent.Filter = (RadComboBoxFilter)Convert.ToInt32(1); ddlStudent.Items.Insert(0, new RadComboBoxItem("", "0")); if (StudentId > 0) { ddlStudent.SelectedValue = StudentId.ToString(); } else if (StudentId == 0 && DormitoryRegistrationId > 0) { ddlStudent.SelectedValue = GetStudentId(DormitoryRegistrationId).ToString(); } else if (DormitoryRegistrationId == 0 && StudentId == 0) { ddlStudent.SelectedIndex = 0; } ddlStudent.DataBind(); }