Ejemplo n.º 1
0

        
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public WechatBuilder.Model.wx_ucard_users_consumeinfo DataRowToModel(DataRow row)
 {
     WechatBuilder.Model.wx_ucard_users_consumeinfo model = new WechatBuilder.Model.wx_ucard_users_consumeinfo();
     if (row != null)
     {
         if (row["id"] != null && row["id"].ToString() != "")
         {
             model.id = int.Parse(row["id"].ToString());
         }
         if (row["sId"] != null && row["sId"].ToString() != "")
         {
             model.sId = int.Parse(row["sId"].ToString());
         }
         if (row["uid"] != null && row["uid"].ToString() != "")
         {
             model.uid = int.Parse(row["uid"].ToString());
         }
         if (row["moduleType"] != null)
         {
             model.moduleType = row["moduleType"].ToString();
         }
         if (row["moduleTypeId"] != null && row["moduleTypeId"].ToString() != "")
         {
             model.moduleTypeId = int.Parse(row["moduleTypeId"].ToString());
         }
         if (row["moduleActionName"] != null)
         {
             model.moduleActionName = row["moduleActionName"].ToString();
         }
         if (row["moduleActionId"] != null && row["moduleActionId"].ToString() != "")
         {
             model.moduleActionId = int.Parse(row["moduleActionId"].ToString());
         }
         if (row["cScoreType"] != null && row["cScoreType"].ToString() != "")
         {
             model.cScoreType = int.Parse(row["cScoreType"].ToString());
         }
         if (row["score"] != null && row["score"].ToString() != "")
         {
             model.score = int.Parse(row["score"].ToString());
         }
         if (row["cMoneyType"] != null && row["cMoneyType"].ToString() != "")
         {
             model.cMoneyType = int.Parse(row["cMoneyType"].ToString());
         }
         if (row["consumeMoney"] != null && row["consumeMoney"].ToString() != "")
         {
             model.consumeMoney = decimal.Parse(row["consumeMoney"].ToString());
         }
         if (row["cContent"] != null)
         {
             model.cContent = row["cContent"].ToString();
         }
         if (row["remark"] != null)
         {
             model.remark = row["remark"].ToString();
         }
         if (row["addTime"] != null && row["addTime"].ToString() != "")
         {
             model.addTime = DateTime.Parse(row["addTime"].ToString());
         }
         if (row["sort_id"] != null && row["sort_id"].ToString() != "")
         {
             model.sort_id = int.Parse(row["sort_id"].ToString());
         }
         if (row["sn"] != null)
         {
             model.sn = row["sn"].ToString();
         }
         if (row["operName"] != null)
         {
             model.operName = row["operName"].ToString();
         }
         if (row["pwd"] != null)
         {
             model.pwd = row["pwd"].ToString();
         }
     }
     return model;
 }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public WechatBuilder.Model.wx_ucard_users_consumeinfo GetModel(int id)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 id,sId,uid,moduleType,moduleTypeId,moduleActionName,moduleActionId,cScoreType,score,cMoneyType,consumeMoney,cContent,remark,addTime,sort_id,sn,operName,pwd from wx_ucard_users_consumeinfo ");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters = {
					new SqlParameter("@id", SqlDbType.Int,4)
			};
            parameters[0].Value = id;

            WechatBuilder.Model.wx_ucard_users_consumeinfo model = new WechatBuilder.Model.wx_ucard_users_consumeinfo();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }
Ejemplo n.º 4
0

        
Ejemplo n.º 5
0

        
Ejemplo n.º 6
0

        
Ejemplo n.º 7
0