/// <summary>
 /// 得到一个对象实体
 /// </summary>
 public SHMetroTestSysModel.jc_EvaluateCourseUser DataRowToModel(DataRow row)
 {
     SHMetroTestSysModel.jc_EvaluateCourseUser model=new SHMetroTestSysModel.jc_EvaluateCourseUser();
     if (row != null)
     {
         if(row["evalCourseUserId"]!=null && row["evalCourseUserId"].ToString()!="")
         {
             model.evalCourseUserId=int.Parse(row["evalCourseUserId"].ToString());
         }
         if(row["evalCourseId"]!=null && row["evalCourseId"].ToString()!="")
         {
             model.evalCourseId=int.Parse(row["evalCourseId"].ToString());
         }
         if(row["evalUserId"]!=null && row["evalUserId"].ToString()!="")
         {
             model.evalUserId=int.Parse(row["evalUserId"].ToString());
         }
         if(row["evalCreateTime"]!=null && row["evalCreateTime"].ToString()!="")
         {
             model.evalCreateTime=DateTime.Parse(row["evalCreateTime"].ToString());
         }
         if(row["evalStatus"]!=null && row["evalStatus"].ToString()!="")
         {
             model.evalStatus=int.Parse(row["evalStatus"].ToString());
         }
         if(row["evalNote"]!=null)
         {
             model.evalNote=row["evalNote"].ToString();
         }
     }
     return model;
 }
        protected void ibnt_addok_Click(object sender, ImageClickEventArgs e)
        {
            var jcEvaluateCourseModel = jcEvaluateCourseBF.GetModel(int.Parse(Request.QueryString["evalCourseId"]));
            jcEvaluateCourseModel.evalCourseName = txt_evalCourseName.Text;
            jcEvaluateCourseModel.evalCourseAddress = txt_evalCourseAddress.Text;
            jcEvaluateCourseModel.evalCourseNumber = txt_evalCourseNumber.Text;
            jcEvaluateCourseModel.evalCourseTeacher = txt_evalCourseTeacher.Text;
            jcEvaluateCourseModel.evalSurveryId = int.Parse(ddl_evalSurvey.SelectedValue);
            jcEvaluateCourseModel.evalCourseDate = DateTime.Parse(txt_evalCourseDate.Text);
            jcEvaluateCourseModel.evalCourseContent = txt_evalCourseContent.Text;
            if (jcEvaluateCourseBF.Update(jcEvaluateCourseModel))
            {
                SHMetroTestSysModel.jc_EvaluateCourseUser jcEvaluateCourseUserModel =
                    new SHMetroTestSysModel.jc_EvaluateCourseUser();
                jcEvaluateCourseUserModel.evalCourseId = int.Parse(Request.QueryString["evalCourseId"]);
                jcEvaluateCourseUserModel.evalCreateTime = DateTime.Now;
                for (int i = 1; i < this.chkbox_evalUser.Items.Count; i++)
                {
                    jcEvaluateCourseUserModel.evalUserId = int.Parse(chkbox_evalUser.Items[i].Value);
                    if (this.chkbox_evalUser.Items[i].Selected == true && (!jcEvaluateCourseUserBF.IsSelectUser(int.Parse(Request.QueryString["evalCourseId"]), jcEvaluateCourseUserModel.evalUserId.Value)))
                    {
                        jcEvaluateCourseUserBF.Add(jcEvaluateCourseUserModel);
                    }
                    else if (this.chkbox_evalUser.Items[i].Selected == false)
                    {
                        jcEvaluateCourseUserBF.Delete(jcEvaluateCourseUserModel.evalCourseId.Value, jcEvaluateCourseUserModel.evalUserId.Value);
                    }
                }

                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "startscript",
                    "<script  type=\"text/javascript\"  defer=\"defer\">Dialog.alert('修改成功!');</script>");
                this.pan_Add.Visible = false;
                this.Pan_OK.Visible = true;
            }
            else
            {
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "startscript", "<script  type=\"text/javascript\"  defer=\"defer\">Dialog.alert('发生未知错误!');</script>");
            }
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public SHMetroTestSysModel.jc_EvaluateCourseUser GetModel(int evalCourseUserId)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("select  top 1 evalCourseUserId,evalCourseId,evalUserId,evalCreateTime,evalStatus,evalNote from jc_EvaluateCourseUser ");
            strSql.Append(" where evalCourseUserId=@evalCourseUserId");
            SqlParameter[] parameters = {
                    new SqlParameter("@evalCourseUserId", SqlDbType.Int,4)
            };
            parameters[0].Value = evalCourseUserId;

            SHMetroTestSysModel.jc_EvaluateCourseUser model=new SHMetroTestSysModel.jc_EvaluateCourseUser();
            DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters);
            if(ds.Tables[0].Rows.Count>0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }