private void LoadIPReportData() { var ipReviewStartDate = Session["IPReviewStartDate"].ToString(); DataSet ds = CReport.GetIPReportData(ipReviewStartDate, 1); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { var dataRow = ds.Tables[0].Rows[0]; foreach (DataRow row in ds.Tables[0].Rows) { if (row["QuestionType"].ToString().Equals("TextBox")) { (this.Master.FindControl("ContentPlaceHolder1").FindControl(row["QuestionAspID"].ToString()) as TextBox).Text = row["QuestionAns"].ToString(); } if (row["QuestionType"].ToString().Equals("RadioButton")) { (this.Master.FindControl("ContentPlaceHolder1").FindControl(row["QuestionAspID"].ToString()) as RadioButtonList).SelectedValue = row["QuestionAns"].ToString(); } if (row["QuestionType"].ToString().Equals("CheckBox")) { (this.Master.FindControl("ContentPlaceHolder1").FindControl(row["QuestionAspID"].ToString()) as CheckBox).Checked = row["QuestionAns"].ToString().Equals("Yes"); } } } }
private void LoadIPReportData() { var ipReviewStartDate = Session["IPReviewStartDate"].ToString(); DataSet ds = CReport.GetIPReportData(ipReviewStartDate, 1); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { var dataRow = ds.Tables[0].Rows[0]; foreach (DataRow row in ds.Tables[0].Rows) { if (!String.IsNullOrEmpty(row["QuestionAspID"].ToString()) && !row["QuestionType"].ToString().Equals("Table") && !row["QuestionType"].ToString().Equals("CheckBox")) { (this.Master.FindControl("ContentPlaceHolder1").FindControl(row["QuestionAspID"].ToString()) as Label).Text = row["QuestionAns"].ToString(); } if (row["QuestionType"].ToString().Equals("CheckBox")) { (this.Master.FindControl("ContentPlaceHolder1").FindControl(row["QuestionAspID"].ToString()) as CheckBox).Checked = row["QuestionAns"].ToString().Equals("Yes"); } } } }