Exemplo n.º 1
0
        internal static int SetImage(Image image)
        {
            if (image == null)
            {
                return(-1);
            }

            SafeProcedure.ExecuteNonQuery(
                Database.GetDatabase(D4DDefine.DBInstanceName),
                "dbo.Image_Set",
                delegate(IParameterSet parameters)
            {
                parameters.AddWithValue("@ImageId", image.ImageId);
                parameters.AddWithValue("@AlbumId", image.AlbumId);
                parameters.AddWithValue("@ImageName", image.ImageName);
                parameters.AddWithValue("@ImageFile", image.ImageFile);
                parameters.AddWithValue("@SImageFile", image.SImageFile);
                parameters.AddWithValue("@AddUserId", image.AddUserID);
                parameters.AddWithValue("@PublishDate", image.PublishDate);
                parameters.AddWithValue("@Status", (int)(image.Status));
                parameters.AddWithValue("@RetVal", DBNull.Value, ParameterDirectionWrap.ReturnValue);
            },
                delegate(IParameterSet outputParameters)
            {
                image.ImageId = Convert.ToInt32(outputParameters.GetValue("@RetVal"));
            });

            return(image.ImageId);
        }
Exemplo n.º 2
0
        internal static int SetAlbum(Album album)
        {
            if (album == null)
            {
                return(-1);
            }

            SafeProcedure.ExecuteNonQuery(
                Database.GetDatabase(D4DDefine.DBInstanceName),
                "dbo.Album_Set",
                delegate(IParameterSet parameters)
            {
                parameters.AddWithValue("@AlbumId", album.AlbumId);
                parameters.AddWithValue("@Title", album.Title);
                parameters.AddWithValue("@SImage", album.SImage);
                parameters.AddWithValue("@LImage", album.LImage);
                parameters.AddWithValue("@BandId", album.BandId);
                parameters.AddWithValue("@PublishDate", album.PublishDate);
                parameters.AddWithValue("@PublishYear", album.PublishYear);
                parameters.AddWithValue("@PublishMonth", album.PublishMonth);
                parameters.AddWithValue("@AddUserId", album.AddUserID);
                parameters.AddWithValue("@Status", (int)(album.Status));
                parameters.AddWithValue("@TotalCount", album.TotalCount);
                parameters.AddWithValue("@RetVal", DBNull.Value, ParameterDirectionWrap.ReturnValue);
            },
                delegate(IParameterSet outputParameters)
            {
                album.AlbumId = Convert.ToInt32(outputParameters.GetValue("@RetVal"));
            });

            return(album.AlbumId);
        }
Exemplo n.º 3
0
        internal static int SetShopRegion(ShopRegion item)
        {
            if (item == null)
            {
                return(-1);
            }

            SafeProcedure.ExecuteNonQuery(
                Database.GetDatabase(JaneDefine.DBInstanceName),
                "dbo.Shop_region_Set",
                delegate(IParameterSet parameters)
            {
                parameters.AddWithValue("@id", item.Id);
                parameters.AddWithValue("@Name", item.Name);
                parameters.AddWithValue("@ParentId", item.ParentId);
                parameters.AddWithValue("@TransferPrice", item.TransferPrice);
                parameters.AddWithValue("@TransferPrice1", item.TransferPrice1);
                parameters.AddWithValue("@TransferPrice2", item.TransferPrice2);
                parameters.AddWithValue("@RetVal", DBNull.Value, ParameterDirectionWrap.ReturnValue);
            },
                delegate(IParameterSet outputParameters)
            {
                item.Id = Convert.ToInt32(outputParameters.GetValue("@RetVal"));
            });

            return(item.Id);
        }
Exemplo n.º 4
0
        internal static int Insert(MessageInfo info)
        {
            var db = Database.GetDatabase(DatabaseName.AppConnect);
            int id = 0;

            SafeProcedure.ExecuteNonQuery(db, "dbo.Message_Insert", parameterMapper =>
            {
                parameterMapper.AddWithValue("@BatchId", info.BatchId);
                parameterMapper.AddWithValue("@TenantId", info.TenantId);
                parameterMapper.AddWithValue("@FromUser", info.FromUser);
                parameterMapper.AddWithValue("@ToUser", info.ToUser);
                parameterMapper.AddWithValue("@ToOpenId", info.ToOpenId);
                parameterMapper.AddWithValue("@AppAccountId", info.AppAccountId);
                parameterMapper.AddWithValue("@TemplateIdShort", info.TemplateIdShort);
                parameterMapper.AddWithValue("@TemplateId", info.TemplateId);
                parameterMapper.AddWithValue("@Content", info.ContentJson);
                parameterMapper.AddWithValue("@State", (short)info.State);
                parameterMapper.AddWithValue("@MessageId", info.MessageId);
                parameterMapper.AddWithValue("@Result", info.Result);
                parameterMapper.AddTypedDbNull("@Id", ParameterDirectionWrap.Output, DbType.Int32);
            }, o =>
            {
                id = (int)o.GetValue("@Id");
            });
            return(id);
        }
Exemplo n.º 5
0
        internal static int SetBandInfo(BandInfo info)
        {
            if (info == null)
            {
                return(-1);
            }

            SafeProcedure.ExecuteNonQuery(
                Database.GetDatabase(D4DDefine.DBInstanceName),
                "dbo.BandInfo_Set",
                delegate(IParameterSet parameters)
            {
                parameters.AddWithValue("@BandId", info.BandId);
                parameters.AddWithValue("@BandName", info.BandName);
                parameters.AddWithValue("@Info1", info.Info1);
                parameters.AddWithValue("@Info2", info.Info2);
                parameters.AddWithValue("@Info3", info.Info3);
                parameters.AddWithValue("@Remark", info.Remark);
                parameters.AddWithValue("@DeleteFlag", info.DeleteFlag);
                parameters.AddWithValue("@RetVal", DBNull.Value, ParameterDirectionWrap.ReturnValue);
            },
                delegate(IParameterSet outputParameters)
            {
                info.BandId = Convert.ToInt32(outputParameters.GetValue("@RetVal"));
            });

            return(info.BandId);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 增加开放平台帐号信息
        /// </summary>
        /// <param name="info"></param>
        internal static int Insert(AppAccountInfo info)
        {
            var db = Database.GetDatabase(DatabaseName.AppConnect);
            int id = 0;

            SafeProcedure.ExecuteNonQuery(db, "dbo.AppAccount_Insert", parameterMapper =>
            {
                parameterMapper.AddWithValue("@AppAccountId", info.AppAccountId);
                parameterMapper.AddWithValue("@TenantId", info.TenantId);
                parameterMapper.AddWithValue("@Name", info.Name);
                parameterMapper.AddWithValue("@Type", info.Type);
                parameterMapper.AddWithValue("@SourceId", info.SourceId);
                parameterMapper.AddWithValue("@AppId", info.AppId);
                parameterMapper.AddWithValue("@AppSecret", info.AppSecret);
                parameterMapper.AddWithValue("@AgentId", info.AgentId);
                parameterMapper.AddWithValue("@State", (short)info.State);
                parameterMapper.AddWithValue("@Tag", info.Tag);
                parameterMapper.AddWithValue("@UserId", info.CreateBy);
                parameterMapper.AddTypedDbNull("@Id", ParameterDirectionWrap.Output, DbType.Int32);
            }, o =>
            {
                id = (int)o.GetValue("@Id");
            });
            return(id);
        }
Exemplo n.º 7
0
        internal static int SetShopItem(ShopItem item)
        {
            if (item == null)
            {
                return(-1);
            }

            SafeProcedure.ExecuteNonQuery(
                Database.GetDatabase(JaneDefine.DBInstanceName),
                "dbo.Shop_items_Set",
                delegate(IParameterSet parameters)
            {
                parameters.AddWithValue("@Id", item.Id);
                parameters.AddWithValue("@name", item.Name);
                parameters.AddWithValue("@description", item.Description);
                parameters.AddWithValue("@body", item.Body);
                parameters.AddWithValue("@price", item.Price);
                parameters.AddWithValue("@SImage", item.SImage);
                parameters.AddWithValue("@LImage", item.LImage);
                parameters.AddWithValue("@PublishDate", item.PublishDate);
                parameters.AddWithValue("@AddUserId", item.AddUserID);
                parameters.AddWithValue("@Status", (int)(item.Status));
                parameters.AddWithValue("@Hits", (int)(item.Hits));
                parameters.AddWithValue("@BaseCountEachdeliver", (int)(item.BaseCountEachdeliver));
                parameters.AddWithValue("@Weight", item.Weight);
                parameters.AddWithValue("@RetVal", DBNull.Value, ParameterDirectionWrap.ReturnValue);
            },
                delegate(IParameterSet outputParameters)
            {
                item.Id = Convert.ToInt32(outputParameters.GetValue("@RetVal"));
            });

            return(item.Id);
        }
Exemplo n.º 8
0
        internal static int SetSpamKeyword(SpamKeyword keyword)
        {
            if (keyword == null)
            {
                return(-1);
            }

            SafeProcedure.ExecuteNonQuery(
                Database.GetDatabase(D4DDefine.DBInstanceName),
                "dbo.SpamKeywords_Set",
                delegate(IParameterSet parameters)
            {
                parameters.AddWithValue("@Id", keyword.Id);
                parameters.AddWithValue("@Keyword", keyword.Keyword);
                parameters.AddWithValue("@Status", keyword.Status);
                parameters.AddWithValue("@AddUserId", keyword.AddUserID);
                parameters.AddWithValue("@RetVal", DBNull.Value, ParameterDirectionWrap.ReturnValue);
            },
                delegate(IParameterSet outputParameters)
            {
                keyword.Id = Convert.ToInt32(outputParameters.GetValue("@RetVal"));
            });

            return(keyword.Id);
        }
Exemplo n.º 9
0
 internal static void DeleteTagRelationByTagId(int tagId)
 {
     SafeProcedure.ExecuteNonQuery(
         Database.GetDatabase(D4DDefine.DBInstanceName),
         "dbo.TagRelation_DeleteByTagId",
         tagId);
 }
Exemplo n.º 10
0
        internal static int SetMusicSongList(MusicSongList m)
        {
            if (m == null)
            {
                return(-1);
            }

            SafeProcedure.ExecuteNonQuery(
                Database.GetDatabase(D4DDefine.DBInstanceName),
                "dbo.Music_SetMusicSongList",
                delegate(IParameterSet parameters)
            {
                parameters.AddWithValue("@ListId", m.ListId);
                parameters.AddWithValue("@MusicId", m.MusicId);
                parameters.AddWithValue("@SongName", m.SongName);
                parameters.AddWithValue("@SongFile", m.SongFile);
                parameters.AddWithValue("@SongTime", m.SongTime);
                parameters.AddWithValue("@AddUserId", m.AddUserID);
                parameters.AddWithValue("@Status", (int)(m.Status));
                parameters.AddWithValue("@RetVal", DBNull.Value, ParameterDirectionWrap.ReturnValue);
            },
                delegate(IParameterSet outputParameters)
            {
                m.ListId = Convert.ToInt32(outputParameters.GetValue("@RetVal"));
            });

            return(m.ListId);
        }
Exemplo n.º 11
0
 internal static void DeleteTagRelationByObject(int objectId, int objectType)
 {
     SafeProcedure.ExecuteNonQuery(
         Database.GetDatabase(D4DDefine.DBInstanceName),
         "dbo.TagRelation_DeleteByObject",
         objectId, objectType);
 }
Exemplo n.º 12
0
        internal static int SetShopTradelist(ShopTradelist item)
        {
            if (item == null)
            {
                return(-1);
            }

            SafeProcedure.ExecuteNonQuery(
                Database.GetDatabase(JaneDefine.DBInstanceName),
                "dbo.Shop_tradelist_Set",
                delegate(IParameterSet parameters)
            {
                parameters.AddWithValue("@Id", item.Id);
                parameters.AddWithValue("@orderid", item.OrderId);
                parameters.AddWithValue("@itemid", item.ItemId);
                parameters.AddWithValue("@itemcount", item.ItemCount);
                parameters.AddWithValue("@RetVal", DBNull.Value, ParameterDirectionWrap.ReturnValue);
            },
                delegate(IParameterSet outputParameters)
            {
                item.Id = Convert.ToInt32(outputParameters.GetValue("@RetVal"));
            });

            return(item.Id);
        }
Exemplo n.º 13
0
        internal static int SetMusicTitle(MusicTitle m)
        {
            if (m == null)
            {
                return(-1);
            }

            SafeProcedure.ExecuteNonQuery(
                Database.GetDatabase(D4DDefine.DBInstanceName),
                "dbo.Music_SetMusicTitle",
                delegate(IParameterSet parameters)
            {
                parameters.AddWithValue("@MusicId", m.MusicId);
                parameters.AddWithValue("@Title", m.Title);
                parameters.AddWithValue("@Body", m.Body);
                parameters.AddWithValue("@SImage", m.SImage);
                parameters.AddWithValue("@LImage", m.LImage);
                parameters.AddWithValue("@BandId", m.BandId);
                parameters.AddWithValue("@PublishDate", m.PublishDate);
                parameters.AddWithValue("@PublishYear", m.PublishYear);
                parameters.AddWithValue("@AddUserId", m.AddUserID);
                parameters.AddWithValue("@Status", (int)(m.Status));
                parameters.AddWithValue("@RetVal", DBNull.Value, ParameterDirectionWrap.ReturnValue);
            },
                delegate(IParameterSet outputParameters)
            {
                m.MusicId = Convert.ToInt32(outputParameters.GetValue("@RetVal"));
            });

            return(m.MusicId);
        }
Exemplo n.º 14
0
        internal static int SetNews(News m)
        {
            if (m == null)
            {
                return(-1);
            }

            SafeProcedure.ExecuteNonQuery(
                Database.GetDatabase(D4DDefine.DBInstanceName),
                "dbo.News_Set",
                delegate(IParameterSet parameters)
            {
                parameters.AddWithValue("@NewsId", m.NewsId);
                parameters.AddWithValue("@Title", m.Title);
                parameters.AddWithValue("@Body", m.Body);
                parameters.AddWithValue("@Preview", m.Preview);
                parameters.AddWithValue("@SImage", m.SImage);
                parameters.AddWithValue("@LImage", m.LImage);
                parameters.AddWithValue("@NewsType", m.NewsType);
                parameters.AddWithValue("@Hits", m.Hits);
                parameters.AddWithValue("@PublishDate", m.PublishDate);
                parameters.AddWithValue("@AddUserId", m.AddUserID);
                parameters.AddWithValue("@Status", (int)(m.Status));
                parameters.AddWithValue("@Remark", m.Remark);
                parameters.AddWithValue("@RetVal", DBNull.Value, ParameterDirectionWrap.ReturnValue);
            },
                delegate(IParameterSet outputParameters)
            {
                m.NewsId = Convert.ToInt32(outputParameters.GetValue("@RetVal"));
            });

            return(m.NewsId);
        }
Exemplo n.º 15
0
        internal static int InsertComment(Comment comment)
        {
            if (comment == null)
            {
                return(-1);
            }

            SafeProcedure.ExecuteNonQuery(
                Database.GetDatabase(D4DDefine.DBInstanceName),
                "dbo.Comment_Insert",
                delegate(IParameterSet parameters)
            {
                parameters.AddWithValue("@ObjectId", comment.ObjectId);
                parameters.AddWithValue("@ObjectType", (int)(comment.ObjectType));
                parameters.AddWithValue("@UserId", comment.UserId);
                parameters.AddWithValue("@UserName", comment.UserName);
                parameters.AddWithValue("@AddDate", comment.AddDate);
                parameters.AddWithValue("@Body", comment.Body);
                parameters.AddWithValue("@Remark", comment.Remark);
                parameters.AddWithValue("@Status", (int)(comment.Status));
                parameters.AddWithValue("@RetVal", DBNull.Value, ParameterDirectionWrap.ReturnValue);
            },
                delegate(IParameterSet outputParameters)
            {
                comment.CommentId = Convert.ToInt32(outputParameters.GetValue("@RetVal"));
            });

            return(comment.CommentId);
        }
Exemplo n.º 16
0
 internal static void DeleteAddInfo(int objectId, int objectType)
 {
     SafeProcedure.ExecuteNonQuery(
         Database.GetDatabase(D4DDefine.DBInstanceName),
         "dbo.Add_infos_Delete",
         objectType, objectId);
 }
Exemplo n.º 17
0
 internal static void DeleteMusicTitle(int musicId)
 {
     if (musicId > 0)
     {
         SafeProcedure.ExecuteNonQuery(
             Database.GetDatabase(D4DDefine.DBInstanceName),
             "dbo.Music_DeleteMusicTitle",
             musicId);
     }
 }
Exemplo n.º 18
0
 internal static void DeleteMusicSongList(int listId)
 {
     if (listId > 0)
     {
         SafeProcedure.ExecuteNonQuery(
             Database.GetDatabase(D4DDefine.DBInstanceName),
             "dbo.Music_DeleteSongList",
             listId);
     }
 }
Exemplo n.º 19
0
 internal static void DeleteKeyword(int id)
 {
     if (id > 0)
     {
         SafeProcedure.ExecuteNonQuery(
             Database.GetDatabase(D4DDefine.DBInstanceName),
             "dbo.SpamKeywords_Delete",
             id);
     }
 }
Exemplo n.º 20
0
 internal static void DeleteCommentByObject(int objectId, int objectType)
 {
     if (objectId > 0)
     {
         SafeProcedure.ExecuteNonQuery(
             Database.GetDatabase(D4DDefine.DBInstanceName),
             "dbo.Comment_DeleteByObject",
             objectId, objectType);
     }
 }
Exemplo n.º 21
0
 internal static void DeleteComment(int commentId)
 {
     if (commentId > 0)
     {
         SafeProcedure.ExecuteNonQuery(
             Database.GetDatabase(D4DDefine.DBInstanceName),
             "dbo.Comment_Delete",
             commentId);
     }
 }
Exemplo n.º 22
0
 internal static void DeleteShopTradelistByOrderId(int orderid)
 {
     if (orderid > 0)
     {
         SafeProcedure.ExecuteNonQuery(
             Database.GetDatabase(JaneDefine.DBInstanceName),
             "dbo.Shop_tradelist_Deletebyorderid",
             orderid);
     }
 }
Exemplo n.º 23
0
 /// <summary>
 /// 删除tag
 /// </summary>
 /// <param name="tagId"></param>
 internal static void DeleteTag(int tagId)
 {
     if (tagId > 0)
     {
         SafeProcedure.ExecuteNonQuery(
             Database.GetDatabase(D4DDefine.DBInstanceName),
             "dbo.Tags_DeleteTag",
             tagId);
     }
 }
Exemplo n.º 24
0
        internal static void Delete(int userId, int id)
        {
            var db = Database.GetDatabase(DatabaseName.AppConnect);

            SafeProcedure.ExecuteNonQuery(db, "dbo.TemplateMapping_Delete", parameterMapper =>
            {
                parameterMapper.AddWithValue("@Id", id);
                parameterMapper.AddWithValue("@UserId", userId);
            });
        }
Exemplo n.º 25
0
        /// <summary>
        /// 用户解绑
        /// </summary>
        /// <param name="appId"></param>
        /// <param name="openId"></param>
        internal static void UnBind(string appId, string openId)
        {
            var db = Database.GetDatabase(DatabaseName.UserSecurity);

            SafeProcedure.ExecuteNonQuery(db, "dbo.AppUserAccount_UnBind", parameterMapper =>
            {
                parameterMapper.AddWithValue("@AppId", appId);
                parameterMapper.AddWithValue("@OpenId", openId);
            });
        }
Exemplo n.º 26
0
 internal static void DeleteUserLogin(int userId)
 {
     if (userId > 0)
     {
         SafeProcedure.ExecuteNonQuery(
             Database.GetDatabase(D4DDefine.DBInstanceName),
             "dbo.UserLogin_Delete",
             userId);
     }
 }
Exemplo n.º 27
0
        /// <summary>
        /// 更新状态
        /// </summary>
        /// <param name="batchId"></param>
        /// <param name="state"></param>
        public static void UpdateState(string batchId, CallbackContentState state)
        {
            var db = Database.GetDatabase(DatabaseName.AppConnect);

            SafeProcedure.ExecuteNonQuery(db, "dbo.CallbackContent_UpdateState", parameterMapper =>
            {
                parameterMapper.AddWithValue("@BatchId", new Guid(batchId));
                parameterMapper.AddWithValue("@State", (short)state);
            });
        }
Exemplo n.º 28
0
        /// <summary>
        /// 更新主账户ID
        /// </summary>
        /// <param name="id"></param>
        /// <param name="masterAccountId"></param>
        internal static void UpdateMasterAccountId(int id, int masterAccountId)
        {
            var db = Database.GetDatabase(DatabaseName.UserSecurity);

            SafeProcedure.ExecuteNonQuery(db, "dbo.AppUserAccount_UpdateMasterAccountId", parameterMapper =>
            {
                parameterMapper.AddWithValue("@Id", id);
                parameterMapper.AddWithValue("@MasterAccountId", masterAccountId);
            });
        }
Exemplo n.º 29
0
 internal static void DeleteShopItem(int id)
 {
     if (id > 0)
     {
         SafeProcedure.ExecuteNonQuery(
             Database.GetDatabase(JaneDefine.DBInstanceName),
             "dbo.Shop_items__Delete",
             id);
     }
 }
Exemplo n.º 30
0
 internal static void DeleteAlbum(int albumId)
 {
     if (albumId > 0)
     {
         SafeProcedure.ExecuteNonQuery(
             Database.GetDatabase(D4DDefine.DBInstanceName),
             "dbo.Album_Delete",
             albumId);
     }
 }