Exemplo n.º 1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(HtmlCouponCount model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update HtmlCouponCount set ");

            strSql.Append(" insetTime = @insetTime , ");
            strSql.Append(" valJson = @valJson  ");
            strSql.Append(" where id=@id ");

            int row = DapperHelper.Execute(strSql.ToString(), model);

            if (row > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 新增加一条数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Add(HtmlCouponCount model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into HtmlCouponCount(");
            strSql.Append("insetTime,valJson");
            strSql.Append(") values (");
            strSql.Append("@insetTime,@valJson");
            strSql.Append(") ");
            strSql.Append(";select @@IDENTITY");
            object obj = DapperHelper.ExecuteScalar(strSql.ToString(), model);

            if (obj != null)
            {
                return(Convert.ToInt32(obj));
            }
            else
            {
                return(0);
            }
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public static bool Update(HtmlCouponCount model)
        {
            HtmlCouponCountBaseDAL dal = new HtmlCouponCountBaseDAL();

            return(dal.Update(model));
        }
        /// <summary>
        /// 新增加一条数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static int Add(HtmlCouponCount model)
        {
            HtmlCouponCountBaseDAL dal = new HtmlCouponCountBaseDAL();

            return(dal.Add(model));
        }