Advertisement
Advertisement
| 03.10.2008 at 09:35AM PDT, ID: 23228957 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: |
//Repeater code
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<asp:Repeater runat="server" ID="RepWorkArea" OnItemDataBound="ShowQuestions">
<ItemTemplate>
<tr>
<td colspan="3">
<h4><%# ((DataRowView)Container.DataItem)["WorkArea"]%></h4>
</td>
</tr>
<asp:Repeater ID="RepQuestions" OnItemDataBound="ShowSubQuestions" runat="server">
<itemtemplate>
<tr>
<td width="90px"><asp:RadioButtonList ID="radQuestionList" runat="server" DataSourceID="SqlDataSource1" DataValueField="SkillImportanceID" OnSelectedIndexChanged="btnViewSkill_Click" RepeatDirection="Horizontal" DataTextField="empty" RepeatLayout="flow"/></td>
<td width="*"><b><%# (Container.ItemIndex + 1) %>.</b> <%# ((DataRowView)Container.DataItem)["Question"]%></td>
<td width="70px" align="right"><asp:RadioButtonList ID="radSubQuestionList" runat="server" DataSourceID="SqlDataSource2" DataValueField="AnswerID" RepeatDirection="Horizontal" DataTextField="empty" RepeatLayout="flow"/></td>
</tr>
<tr>
<td colspan="3" align="left">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<asp:repeater id="RepSubQuestions" runat="server">
<itemtemplate>
<tr>
<td width="90px">
<asp:RadioButtonList ID="radQuestionList" runat="server" DataSourceID="SqlDataSource1" DataValueField="SkillImportanceID" OnSelectedIndexChanged="btnViewSkill_Click" RepeatDirection="Horizontal" DataTextField="empty" RepeatLayout="flow"/>
</td>
<td width="*">
<div id="SubQuestions">
<li class="bold"><%# DataBinder.Eval(Container.DataItem, "[\"Question\"]")%></li>
</div>
</td>
<td width="70px" align="right">
<asp:RadioButtonList ID="radSubQuestionList" runat="server" DataSourceID="SqlDataSource2" DataValueField="AnswerID" RepeatDirection="Horizontal" DataTextField="empty" RepeatLayout="flow"/>
</td>
</tr>
</itemtemplate>
</asp:repeater>
</table>
</td>
</tr>
</itemtemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>
//Code Behind
private SqlConnection connString = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString.ToString());
protected void Page_Load(object sender, EventArgs e)
{
string strSql;
DataSet ds = new DataSet();
strSql = "select distinct A.* from WorkAreas as A right Join EvaluationQuestions AS B on a.WorkAreaId = B.WorkAreaID AND B.EvaluationID = 1 Order By A.SortOrder";
SqlDataAdapter daWorkAreas = new SqlDataAdapter(strSql, connString);
daWorkAreas.Fill(ds, "WorkAreas");
strSql = "select * from EvaluationQuestions WHERE ParentId = -1 AND Active = 1 AND EvaluationID = 1 Order By EvaluationQuestionID";
SqlDataAdapter daEvaluationQuestions = new SqlDataAdapter(strSql, connString);
daEvaluationQuestions.Fill(ds, "EvaluationQuestions");
strSql = "select * from EvaluationQuestions WHERE Active = 1 AND EvaluationID = 1 Order By EvaluationQuestionID";
SqlDataAdapter daSubQuestions = new SqlDataAdapter(strSql, connString);
daSubQuestions.Fill(ds, "SubQuestions");
DataRelation rel = new DataRelation("QuestionsRel",ds.Tables["WorkAreas"].Columns["WorkAreaID"], ds.Tables["EvaluationQuestions"].Columns["WorkAreaID"],false);
ds.Relations.Add(rel);
DataRelation rel2 = new DataRelation("QuestionsRel2", ds.Tables["EvaluationQuestions"].Columns["EvaluationQuestionID"], ds.Tables["SubQuestions"].Columns["ParentID"], false);
ds.Relations.Add(rel2);
RepWorkArea.DataSource = ds.Tables["WorkAreas"].DefaultView;
RepWorkArea.DataBind();
connString.Close();
}
public void ShowQuestions(Object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
((Repeater)e.Item.FindControl("RepQuestions")).DataSource =
((DataRowView)e.Item.DataItem).CreateChildView("QuestionsRel");
((Repeater)e.Item.FindControl("RepQuestions")).DataBind();
}
}
public void ShowSubQuestions(Object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
((Repeater)e.Item.FindControl("RepSubQuestions")).DataSource =
((DataRowView)e.Item.DataItem).CreateChildView("QuestionsRel2");
((Repeater)e.Item.FindControl("RepSubQuestions")).DataBind();
}
}
|