<%@ Control Language="C#" %>
<%@ Import Namespace="Kesion.Publics" %>
<%@ Import Namespace="Kesion.BLL" %>
<%@ Import Namespace="Kesion.Cache" %>
<%@ Import Namespace="Kesion.HtmlTags" %>
<%@ Import Namespace="Kesion.APPCode" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="Kesion.Course" %>
<script runat="server" type="text/C#">
	dynamic __user = HttpContext.Current.Items["user"];                //初始化用户信息，
	private static dynamic __info = new System.Dynamic.ExpandoObject();   //初始化当前页信息
	bool isLoadPage = true;  //定义页面是否加载
	public int scoreid = 0;
	public DataRow drp = null;
	protected void Page_Load(object sender, EventArgs e)
	{
		scoreid = Utils.StrToInt(KSCMS.S("scoreid"));
		string DoMethod = BasicField.GetParam("do");
		if (string.IsNullOrEmpty(DoMethod))
		{
			DoMethod = KSCMS.S("action");
		}
		switch (DoMethod)
		{
			case "save":
				SaveChange();
				break;
		}
		using (DataTable dt = DataFactory.GetDataTable("select top 1 * from KS_SJScore where scoreid="+scoreid+""))
		{
			if (dt.Rows.Count > 0)
			{
				drp = dt.Rows[0];
			}
		}
	}

	public void SaveChange()
	{
		DataFactory.ExecuteNonQuery("update KS_SJScore set TcComment='" + Utils.RemoveXss(Utils.RemoveHtml(KSCMS.S("TxtIntro"))) + "' where scoreid="+scoreid+"");
		Msg.Alert("评论成功！", BasicField.GetUserUrl("teacher/TcHWSjScore", "sjid-"+Utils.StrToInt(KSCMS.S("sjid"))));
		isLoadPage = false;
		return;
	}
	public string GetParam(string Fields)
	{
		string result = string.Empty;
		if (drp != null)
		{
			result = drp[Fields].ToString();
		}
		return result;
	}
</script>
<%
    if (!isLoadPage) return;
%>
  <form name="myform" action="<%=BasicField.GetUserUrl("teacher/TcSjComment","do-save") %>" method="post" id="myform" >
  <input name="scoreid" type="text" value="<%=scoreid %>" style="display:none" />
  <input name="sjid" type="text" value="<%=GetParam("sjid") %>" style="display:none" />
  <div class="t_tybox">
         <div class="ty_title">教师评语</div>
		       <div class="tips" style="padding:10px 0px; font-size:14px">
        <span>学员名称：<%=GetParam("UserName") %></span></div>

		   <table width="100%" align="center" border="0" cellpadding="0" cellspacing="0" class="border"> 
		    <tr>
			 <td align="right" class="lefttd" height="30" ><strong>评语内容：</strong></td>
			 <td class="tag_left"><textarea name="TxtIntro" rows="2" cols="20" id="TxtIntro" style="height:200px;width:90%;"><%=GetParam("TcComment") %></textarea>
			    <%Kesion.APPCode.EditorAPI.EchoHead(); %>
				<% Kesion.APPCode.EditorAPI.EchoEditor("editor", "TxtIntro", "Basic");%>
			 </td>
		 </tr>
		   </table>
		 </div>
		 <div class="cz_btn nofloat" style="padding-left:162px;">
         <span><input type="submit" name="Button2" value="确定保存" onclick="return (CheckForm());" id="Button2" class="button" /></span>
           <span><input type="button" class="button" onclick="window.history.go(-1);"value=" 返 回 "></span>
       </div>
	   </form>