/// <summary>
 /// 得到一个对象实体
 /// </summary>
 public SHMetroTestSysModel.jc_EvaluateSurvey DataRowToModel(DataRow row)
 {
     SHMetroTestSysModel.jc_EvaluateSurvey model=new SHMetroTestSysModel.jc_EvaluateSurvey();
     if (row != null)
     {
         if(row["evalSurveryId"]!=null && row["evalSurveryId"].ToString()!="")
         {
             model.evalSurveryId=int.Parse(row["evalSurveryId"].ToString());
         }
         if(row["evalSurveryName"]!=null)
         {
             model.evalSurveryName=row["evalSurveryName"].ToString();
         }
         if(row["evalSurveryDescription"]!=null)
         {
             model.evalSurveryDescription=row["evalSurveryDescription"].ToString();
         }
         if(row["evalSurveryComments"]!=null)
         {
             model.evalSurveryComments=row["evalSurveryComments"].ToString();
         }
         if(row["evalCreateTime"]!=null && row["evalCreateTime"].ToString()!="")
         {
             model.evalCreateTime=DateTime.Parse(row["evalCreateTime"].ToString());
         }
     }
     return model;
 }
        protected void ibnt_addok_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                SHMetroTestSysModel.jc_EvaluateSurvey jcEvaluateModel = new SHMetroTestSysModel.jc_EvaluateSurvey();
                jcEvaluateModel.evalCreateTime = DateTime.Now;
                jcEvaluateModel.evalSurveryName = txt_evalSurveyName.Text;
                int evaluateSurveyId = jcEvaluateSurveyBF.Add(jcEvaluateModel);

                SHMetroTestSysModel.jc_EvaluateSurveyItem jcEvaluateSurveyItemModel = new SHMetroTestSysModel.jc_EvaluateSurveyItem();
                jcEvaluateSurveyItemModel.evalSurveryId = evaluateSurveyId;
                for (int i = 0; i < this.chkbox_evalItem.Items.Count; i++)
                {
                    if (this.chkbox_evalItem.Items[i].Selected == true)
                    {
                        jcEvaluateSurveyItemModel.evalItemId = int.Parse(chkbox_evalItem.Items[i].Value);
                        jcEvaluateSurveyItemBF.Add(jcEvaluateSurveyItemModel);
                    }
                }
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "startscript",
                  "<script text=\"text/javascript\"   defer=\"defer\">Dialog.alert('添加成功!');</script>");
            }
            catch (Exception ex)
            {
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "startscript",
                  "<script text=\"text/javascript\"   defer=\"defer\">Dialog.alert('发生未知错误!');</script>");
            }
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public SHMetroTestSysModel.jc_EvaluateSurvey GetModel(int evalSurveryId)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("select  top 1 evalSurveryId,evalSurveryName,evalSurveryDescription,evalSurveryComments,evalCreateTime from jc_EvaluateSurvey ");
            strSql.Append(" where evalSurveryId=@evalSurveryId");
            SqlParameter[] parameters = {
                    new SqlParameter("@evalSurveryId", SqlDbType.Int,4)
            };
            parameters[0].Value = evalSurveryId;

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