Ejemplo n.º 1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(UserPermission.Model.USER_SHARE_PRODUCTFUN model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update USER_SHARE_PRODUCTFUN set ");
            strSql.Append("PRODUCTID=@PRODUCTID,");
            strSql.Append("FUNID=@FUNID");
            strSql.Append(" where ");
            Database  db        = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());

            db.AddInParameter(dbCommand, "PRODUCTID", DbType.String, model.PROCUTID);
            db.AddInParameter(dbCommand, "FUNID", DbType.String, model.FUNID);
            db.ExecuteNonQuery(dbCommand);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(UserPermission.Model.USER_SHARE_PRODUCTFUN model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into USER_SHARE_PRODUCTFUN(");
            strSql.Append("PRODUCTID,FUNID)");

            strSql.Append(" values (");
            strSql.Append("@PRODUCTID,@FUNID)");
            Database  db        = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());

            db.AddInParameter(dbCommand, "PRODUCTID", DbType.String, model.PROCUTID);
            db.AddInParameter(dbCommand, "FUNID", DbType.String, model.FUNID);
            db.ExecuteNonQuery(dbCommand);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 对象实体绑定数据
        /// </summary>
        public UserPermission.Model.USER_SHARE_PRODUCTFUN ReaderBind(IDataReader dataReader)
        {
            UserPermission.Model.USER_SHARE_PRODUCTFUN model = new UserPermission.Model.USER_SHARE_PRODUCTFUN();
            object ojb;

            ojb = dataReader["PROCUTID"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.PROCUTID = (decimal)ojb;
            }
            ojb = dataReader["FUNID"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.FUNID = (decimal)ojb;
            }
            return(model);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public UserPermission.Model.USER_SHARE_PRODUCTFUN GetModel()
        {
            //该表无主键信息,请自定义主键/条件字段
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select PRODUCTID,FUNID from USER_SHARE_PRODUCTFUN ");
            strSql.Append(" where ");
            Database  db        = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());

            UserPermission.Model.USER_SHARE_PRODUCTFUN model = null;
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    model = ReaderBind(dataReader);
                }
            }
            return(model);
        }