public static bool InsertShopServiceRelation(ShopServiceRelation model, SqlTransaction tran)
        {
            const string sql = @"  INSERT INTO Tuhu_Groupon.dbo.[ShopServiceRelation]
                                              (                                           
                                               [ActivityId]
                                              ,[PKID]
                                              ,[ProductID]
                                              ,[ServersName]
                                              ,[CatogryID]
                                              ,[Type]
                                              ,[CreateTime]
                                              )
                                      VALUES  ( 
                                               @ActivityId
                                              ,@PKID
                                              ,@ProductID
                                              ,@ServersName
                                              ,@CatogryID
                                              ,@Type                                                                
                                              ,GETDATE()                                                                               
                                              )SELECT @@IDENTITY";

            var sqlParameter = new SqlParameter[]
            {
                new SqlParameter("@ActivityId", model.ActivityId),
                new SqlParameter("@PKID", model.PKID),
                new SqlParameter("@ProductID", model.ProductID ?? string.Empty),
                new SqlParameter("@ServersName", model.ServersName),
                new SqlParameter("@Type", model.Type),
                new SqlParameter("@CatogryID", model.CatogryID),
            };

            return(SqlHelper.ExecuteNonQuery(tran, CommandType.Text, sql, sqlParameter) > 0);
        }
Example #2
0
 public bool InsertShopServiceRelation(ShopServiceRelation model, ref int id)
 {
     try
     {
         return(true);// DALMeiRongAcitivityConfig.InsertShopServiceRelation(model, ref id);
     }
     catch (Exception ex)
     {
         Logger.Log(Level.Error, ex, "InsertShopServiceRelation");
         throw ex;
     }
 }