Exemplo n.º 1
0
        private Evaluation GetModelByCondition(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select ID,FI_ID,FM_name,RF_name,ExpertName,FM_score,Spare1,Spare2,Spare3,Spare4 ");
            strSql.Append(" from Evaluation ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            thesis.model.Evaluation model = new thesis.model.Evaluation();
            DataSet ds = DbHelperSQL.Query(strSql.ToString());

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["ID"].ToString() != "")
                {
                    model.ID = int.Parse(ds.Tables[0].Rows[0]["ID"].ToString());
                }
                model.FI_ID      = int.Parse(ds.Tables[0].Rows[0]["FI_ID"].ToString());
                model.FM_name    = ds.Tables[0].Rows[0]["FM_name"].ToString();
                model.RF_name    = ds.Tables[0].Rows[0]["RF_name"].ToString();
                model.ExpertName = ds.Tables[0].Rows[0]["ExpertName"].ToString();
                model.FM_score   = ds.Tables[0].Rows[0]["FM_score"].ToString();

                model.Spare1 = ds.Tables[0].Rows[0]["Spare1"].ToString();
                model.Spare2 = ds.Tables[0].Rows[0]["Spare2"].ToString();
                model.Spare3 = ds.Tables[0].Rows[0]["Spare3"].ToString();
                model.Spare4 = ds.Tables[0].Rows[0]["Spare4"].ToString();
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(thesis.model.Evaluation model)
 {
     dal.Update(model);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(thesis.model.Evaluation model)
 {
     dal.Add(model);
 }