private void Show() { DataRow row = _grade.FillPlaceHolderControlsById(Request["id"]); if (row == null) return; DGrade dGrade = new DGrade(); DSchool dSchool = new DSchool(); //取得學校名稱 String schoolAllName = dSchool.GetNameBySchoolId(row["school_id"].ToString()); schoolName.Text = schoolAllName; //取得班級名稱 GradeName.Text = dGrade.GetShortGradeNameById((int) row["id"]); //學校班級名稱 AllName.Text = dGrade.GetFullGradeNameById((int) row["id"]); //取得班級人數 String gradeStudentCount = dGrade.GetGradeCountById((int) row["id"]); GradeStudentCount.Text = gradeStudentCount; description.Text = My.WebForm.TXT2HTML(description.Text); enable.Text = enable.Text.ToScodeEnableName(); }
//秀出所有學校名單(下拉式選單) private void Show() { DGrade dGrade = new DGrade(); DataRow row = _grade.FillPlaceHolderControlsById(Request["id"]); //取得學校名稱 DSchool dSchool = new DSchool(); schoolName.Text = dSchool.GetNameBySchoolId(row["school_id"].ToString()); AllName.Text = dGrade.GetFullGradeNameById((int)row["id"]); }
/// <summary> /// 根據班級編號取得班級完整名稱如:XX國小X年X班 /// </summary> /// <param name="gradeId">班級編號</param> /// <returns>班級完整名稱</returns> public string GetFullGradeNameById(int gradeId) { DataRow row = _grade.GetById(gradeId.ToString()); //取得學校名稱 DSchool dSchool = new DSchool(); String schoolAllName = dSchool.GetNameBySchoolId(row["school_id"].ToString()); //取得班級名稱 String gradeAllName = String.Format("{0}年{1}班", row["currentYear"], row["name"]); return schoolAllName + gradeAllName; }