Exemplo n.º 1
0
        //private static readonly ID_Promotion dal = IDal.CreatePromotion();
        /// <summary>
        ///添加记录
        /// </summary>
        /// <param name="Promotion"></param>
        /// <returns></returns>
        public int GetInsert(M_Promotion promotion)
        {
            string sqlStr = "INSERT INTO [dbo].[ZL_Promotion] ([userId],[LinkUrl],[PromoUrl],[type],[AllinaceUrl]) VALUES (@userId,@LinkUrl,@PromoUrl,@type,@AllinaceUrl);select @@IDENTITY";

            SqlParameter[] cmdParams = promotion.GetParameters();
            return(SqlHelper.ObjectToInt32(SqlHelper.ExecuteScalar(CommandType.Text, sqlStr, cmdParams)));
        }
Exemplo n.º 2
0
        /// <summary>
        ///更新记录
        /// </summary>
        /// <param name="Promotion"></param>
        /// <returns></returns>
        public bool GetUpdate(M_Promotion promotion)
        {
            string sqlStr = "UPDATE [dbo].[ZL_Promotion] SET [userId] = @userId,[LinkUrl] = @LinkUrl,[PromoUrl] = @PromoUrl,[type] = @type,[AllinaceUrl]=@AllinaceUrl WHERE [id] = @id";

            SqlParameter[] cmdParams = promotion.GetParameters();
            return(SqlHelper.ExecuteSql(sqlStr, cmdParams));
        }
Exemplo n.º 3
0
 public int insert(M_Promotion model)
 {
     return(Sql.insert(strTableName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Exemplo n.º 4
0
 /// <summary>
 /// 根据ID更新
 /// </summary>
 public bool UpdateByID(M_Promotion model)
 {
     return(Sql.UpdateByIDs(strTableName, PK, model.id.ToString(), BLLCommon.GetFieldAndPara(model), model.GetParameters()));
 }
Exemplo n.º 5
0
 public bool UpdateByID(M_Promotion model)
 {
     return(DBCenter.UpdateByID(model, model.ID));
 }
Exemplo n.º 6
0
 public int Insert(M_Promotion model)
 {
     return(DBCenter.Insert(model));
 }