Example #1
0
        internal static News GetNews(int newsId, int hits)
        {
            News m = new News(newsId);

            if (newsId > 0)
            {
                SafeProcedure.ExecuteAndMapRecords(
                    Database.GetDatabase(D4DDefine.DBInstanceName),
                    "dbo.News_Get",
                    delegate(IRecord record)
                {
                    m.Title       = record.GetStringOrEmpty(1);
                    m.Body        = record.GetStringOrEmpty(2);
                    m.Preview     = record.GetStringOrEmpty(3);
                    m.SImage      = record.GetStringOrEmpty(4);
                    m.LImage      = record.GetStringOrEmpty(5);
                    m.NewsType    = record.GetInt32OrDefault(6, 0);
                    m.Hits        = record.GetInt32OrDefault(7, 0);
                    m.PublishDate = record.GetDateTime(8);
                    m.AddUserID   = record.GetInt32OrDefault(9, 0);
                    m.AddDate     = record.GetDateTime(10);
                    m.Status      = (PublishStatus)(record.GetInt32OrDefault(11, 0));
                    m.Remark      = record.GetStringOrEmpty(12);
                },
                    newsId, hits);
            }
            return(m);
        }
Example #2
0
        internal static Comment GetComment(int commentId)
        {
            Comment c = new Comment();

            if (commentId > 0)
            {
                SafeProcedure.ExecuteAndMapRecords(
                    Database.GetDatabase(D4DDefine.DBInstanceName),
                    "dbo.Comment_Get",
                    delegate(IRecord record)
                {
                    c.CommentId  = record.GetInt32OrDefault(0, 0);
                    c.ObjectId   = record.GetInt32OrDefault(1, 0);
                    c.ObjectType = (ObjectTypeDefine)(record.GetInt32OrDefault(2, 0));
                    c.UserId     = record.GetInt32OrDefault(3, 0);
                    c.UserName   = record.GetStringOrEmpty(4);
                    c.AddDate    = record.GetDateTime(5);
                    c.Body       = record.GetStringOrEmpty(6);
                    c.Remark     = record.GetStringOrEmpty(7);
                    c.Status     = (PublishStatus)(record.GetInt32OrDefault(8, 0));
                },
                    commentId);
            }
            return(c);
        }
Example #3
0
        internal static ShopItem GetShopItem(int id, int hits)
        {
            ShopItem m = new ShopItem(id);

            if (id > 0)
            {
                SafeProcedure.ExecuteAndMapRecords(
                    Database.GetDatabase(JaneDefine.DBInstanceName),
                    "dbo.Shop_items_Get",
                    delegate(IRecord record)
                {
                    m.Id                   = record.GetInt32OrDefault(0, 0);
                    m.Name                 = record.GetStringOrEmpty(1);
                    m.Description          = record.GetStringOrEmpty(2);
                    m.Price                = record.GetDouble(3);
                    m.SImage               = record.GetStringOrEmpty(4);
                    m.LImage               = record.GetStringOrEmpty(5);
                    m.PublishDate          = record.GetDateTimeOrEmpty(6);
                    m.AddUserID            = record.GetInt32OrDefault(7, 0);
                    m.AddDate              = record.GetDateTime(8);
                    m.Status               = (PublishStatus)(record.GetInt32OrDefault(9, 0));
                    m.Body                 = record.GetStringOrEmpty(10);
                    m.Hits                 = record.GetInt32OrDefault(11, 0);
                    m.BaseCountEachdeliver = record.GetInt32OrDefault(12, 5);
                    m.Weight               = record.GetDouble(13);
                },
                    id, hits);
            }
            return(m);
        }
Example #4
0
        internal static Dictionary <int, int> GetComments20(List <int> oIds, int objectType)
        {
            Dictionary <int, int> dic = new Dictionary <int, int>();

            if (oIds != null && oIds.Count > 0)
            {
                SafeProcedure.ExecuteAndMapRecords(Database.GetDatabase(D4DDefine.DBInstanceName),
                                                   "dbo.Comment_GetCmments20",
                                                   delegate(IParameterSet parameters)
                {
                    parameters.AddWithValue("@ObjectType", objectType);
                    int maxCount = oIds.Count > 20 ? 20 : oIds.Count;
                    for (int i = 0; i < maxCount; i++)
                    {
                        parameters.AddWithValue("@id" + (i + 1).ToString(), oIds[i]);
                    }
                },
                                                   delegate(IRecord record)
                {
                    int commentCount = record.GetInt32OrDefault(0, 0);
                    int objectId     = record.GetInt32OrDefault(1, 0);


                    if (!dic.ContainsKey(objectId))
                    {
                        dic.Add(objectId, commentCount);
                    }
                }
                                                   );
            }

            return(dic);
        }
Example #5
0
        internal static MusicTitle GetMusicTitle(int musicId)
        {
            MusicTitle m = new MusicTitle(musicId);

            if (musicId > 0)
            {
                SafeProcedure.ExecuteAndMapRecords(
                    Database.GetDatabase(D4DDefine.DBInstanceName),
                    "dbo.Music_GetMusicTitle",
                    delegate(IRecord record)
                {
                    m.Title       = record.GetStringOrEmpty(1);
                    m.Body        = record.GetStringOrEmpty(2);
                    m.SImage      = record.GetStringOrEmpty(3);
                    m.LImage      = record.GetStringOrEmpty(4);
                    m.BandId      = record.GetInt32OrDefault(5, 0);
                    m.PublishDate = record.GetDateTime(6);
                    m.PublishYear = record.GetInt32OrDefault(7, 0);
                    m.AddUserID   = record.GetInt32OrDefault(8, 0);
                    m.AddDate     = record.GetDateTime(9);
                    m.Status      = (PublishStatus)(record.GetInt32OrDefault(10, 0));
                },
                    musicId);
            }
            return(m);
        }
Example #6
0
        internal static List <MusicTitle> GetPagedMusicTitlesByBandIdANDPublishYear(PagingContext pager, int bandId, int publishYear, int publishStatus)
        {
            List <MusicTitle> list = new List <MusicTitle>(pager.RecordsPerPage);

            SafeProcedure.ExecuteAndMapRecords(Database.GetDatabase(D4DDefine.DBInstanceName),
                                               "dbo.Music_GetPagedMusicTitleByBandIdANDPublishYear",
                                               delegate(IParameterSet parameters)
            {
                parameters.AddWithValue("@PublishYear", publishYear);
                parameters.AddWithValue("@BandId", bandId);
                parameters.AddWithValue("@PublishStatus", publishStatus);
                parameters.AddWithValue("@PageIndex", pager.CurrentPageNumber);
                parameters.AddWithValue("@PageSize", pager.RecordsPerPage);
                parameters.AddWithValue("@NumberOfCount", 0, ParameterDirectionWrap.Output);
            },
                                               delegate(IRecord record)
            {
                MapMusicTitleList(record, list);
            },
                                               delegate(IParameterSet outputParameters)
            {
                pager.TotalRecordCount = outputParameters.GetValue("@NumberOfCount") == DBNull.Value ? 0 : (int)outputParameters.GetValue("@NumberOfCount");
            }
                                               );

            return(list);
        }
Example #7
0
        internal static Dictionary <int, Tag> GetTags20(List <int> tagIds)
        {
            Dictionary <int, Tag> dic = new Dictionary <int, Tag>();

            if (tagIds != null && tagIds.Count > 0)
            {
                SafeProcedure.ExecuteAndMapRecords(Database.GetDatabase(D4DDefine.DBInstanceName),
                                                   "dbo.Tags_GetTags20",
                                                   delegate(IParameterSet parameters)
                {
                    int maxCount = tagIds.Count > 20 ? 20 : tagIds.Count;
                    for (int i = 0; i < maxCount; i++)
                    {
                        parameters.AddWithValue("@tid" + (i + 1).ToString(), tagIds[i]);
                    }
                },
                                                   delegate(IRecord record)
                {
                    Tag tag       = new Tag();
                    tag.TagId     = record.GetInt32OrDefault(0, 0);
                    tag.TagName   = record.GetStringOrEmpty(1);
                    tag.Hits      = record.GetInt32OrDefault(2, 0);
                    tag.AddUserID = record.GetInt32OrDefault(3, 0);
                    tag.AddDate   = record.GetDateTime(4);

                    if (!dic.ContainsKey(tag.TagId))
                    {
                        dic.Add(tag.TagId, tag);
                    }
                }
                                                   );
            }

            return(dic);
        }
Example #8
0
        internal static List <Tag> GetPagedTags(PagingContext pager)
        {
            List <Tag> list = new List <Tag>(pager.RecordsPerPage);

            SafeProcedure.ExecuteAndMapRecords(Database.GetDatabase(D4DDefine.DBInstanceName),
                                               "dbo.GetPagedTags",
                                               delegate(IParameterSet parameters)
            {
                parameters.AddWithValue("@PageIndex", pager.CurrentPageNumber);
                parameters.AddWithValue("@PageSize", pager.RecordsPerPage);
                parameters.AddWithValue("@NumberOfCount", 0, ParameterDirectionWrap.Output);
            },
                                               delegate(IRecord record)
            {
                Tag tag       = new Tag();
                tag.TagId     = record.GetInt32OrDefault(0, 0);
                tag.TagName   = record.GetStringOrEmpty(1);
                tag.Hits      = record.GetInt32OrDefault(2, 0);
                tag.AddUserID = record.GetInt32OrDefault(3, 0);
                tag.AddDate   = record.GetDateTime(4);

                list.Add(tag);
            },
                                               delegate(IParameterSet outputParameters)
            {
                pager.TotalRecordCount = outputParameters.GetValue("@NumberOfCount") == DBNull.Value ? 0 : (int)outputParameters.GetValue("@NumberOfCount");
            }
                                               );

            return(list);
        }
Example #9
0
        internal static List <SpamKeyword> GetPagedSpamKeywords(PagingContext pager)
        {
            List <SpamKeyword> list = new List <SpamKeyword>(pager.RecordsPerPage);

            SafeProcedure.ExecuteAndMapRecords(Database.GetDatabase(D4DDefine.DBInstanceName),
                                               "dbo.SpamKeywords_GetPaged",
                                               delegate(IParameterSet parameters)
            {
                //parameters.AddWithValue("@PublishStatus", publishStatus);
                parameters.AddWithValue("@PageIndex", pager.CurrentPageNumber);
                parameters.AddWithValue("@PageSize", pager.RecordsPerPage);
                parameters.AddWithValue("@NumberOfCount", 0, ParameterDirectionWrap.Output);
            },
                                               delegate(IRecord record)
            {
                MapList(record, list);
            },
                                               delegate(IParameterSet outputParameters)
            {
                pager.TotalRecordCount = outputParameters.GetValue("@NumberOfCount") == DBNull.Value ? 0 : (int)outputParameters.GetValue("@NumberOfCount");
            }
                                               );

            return(list);
        }
Example #10
0
        internal static List <ShopTradelist> GetPagedTradelist(PagingContext pager, int orderid)
        {
            List <ShopTradelist> list = new List <ShopTradelist>(pager.RecordsPerPage);

            SafeProcedure.ExecuteAndMapRecords(Database.GetDatabase(JaneDefine.DBInstanceName),
                                               "dbo.Shop_tradelist_GetPaged",
                                               delegate(IParameterSet parameters)
            {
                parameters.AddWithValue("@orderid", orderid);
                parameters.AddWithValue("@PageIndex", pager.CurrentPageNumber);
                parameters.AddWithValue("@PageSize", pager.RecordsPerPage);
                parameters.AddWithValue("@NumberOfCount", 0, ParameterDirectionWrap.Output);
            },
                                               delegate(IRecord record)
            {
                MapList(record, list);
            },
                                               delegate(IParameterSet outputParameters)
            {
                pager.TotalRecordCount = outputParameters.GetValue("@NumberOfCount") == DBNull.Value ? 0 : (int)outputParameters.GetValue("@NumberOfCount");
            }
                                               );

            return(list);
        }
Example #11
0
        internal static Album GetAlbum(int albumId)
        {
            Album m = new Album(albumId);

            if (albumId > 0)
            {
                SafeProcedure.ExecuteAndMapRecords(
                    Database.GetDatabase(D4DDefine.DBInstanceName),
                    "dbo.Album_Get",
                    delegate(IRecord record)
                {
                    m.Title        = record.GetStringOrEmpty(1);
                    m.BandId       = record.GetInt32OrDefault(2, 0);
                    m.PublishDate  = record.GetDateTime(3);
                    m.PublishYear  = record.GetInt32OrDefault(4, 0);
                    m.PublishMonth = record.GetInt32OrDefault(5, 0);
                    m.AddUserID    = record.GetInt32OrDefault(6, 0);
                    m.AddDate      = record.GetDateTime(7);
                    m.Status       = (PublishStatus)(record.GetInt32OrDefault(8, 0));
                    m.TotalCount   = record.GetInt32OrDefault(9, 0);
                    m.SImage       = record.GetStringOrEmpty(10);
                    m.LImage       = record.GetStringOrEmpty(11);
                },
                    albumId);
            }
            return(m);
        }
Example #12
0
        internal static List <ShopItem> GetPagedShopItemByPublishDate(PagingContext pager, int publishStatus,
                                                                      DateTime sTime, DateTime eTime)
        {
            List <ShopItem> list = new List <ShopItem>(pager.RecordsPerPage);

            SafeProcedure.ExecuteAndMapRecords(Database.GetDatabase(JaneDefine.DBInstanceName),
                                               "dbo.Shop_items_GetPagedByPublishDate",
                                               delegate(IParameterSet parameters)
            {
                parameters.AddWithValue("@STime", sTime);
                parameters.AddWithValue("@ETime", eTime);
                parameters.AddWithValue("@PublishStatus", publishStatus);
                parameters.AddWithValue("@PageIndex", pager.CurrentPageNumber);
                parameters.AddWithValue("@PageSize", pager.RecordsPerPage);
                parameters.AddWithValue("@NumberOfCount", 0, ParameterDirectionWrap.Output);
            },
                                               delegate(IRecord record)
            {
                MapList(record, list);
            },
                                               delegate(IParameterSet outputParameters)
            {
                pager.TotalRecordCount = outputParameters.GetValue("@NumberOfCount") == DBNull.Value ? 0 : (int)outputParameters.GetValue("@NumberOfCount");
            }
                                               );

            return(list);
        }
Example #13
0
        internal static Show GetShow(int showId)
        {
            Show m = new Show(showId);

            if (showId > 0)
            {
                SafeProcedure.ExecuteAndMapRecords(
                    Database.GetDatabase(D4DDefine.DBInstanceName),
                    "dbo.Show_Get",
                    delegate(IRecord record)
                {
                    m.Title     = record.GetStringOrEmpty(1);
                    m.Body      = record.GetStringOrEmpty(2);
                    m.SImage    = record.GetStringOrEmpty(3);
                    m.LImage    = record.GetStringOrEmpty(4);
                    m.BandId    = record.GetInt32OrDefault(5, 0);
                    m.ShowDate  = record.GetDateTime(6);
                    m.ShowPlace = record.GetStringOrEmpty(7);
                    m.AddUserID = record.GetInt32OrDefault(8, 0);
                    m.AddDate   = record.GetDateTime(9);
                    m.Status    = (PublishStatus)(record.GetInt32OrDefault(10, 0));
                    m.EndDate   = record.GetDateTime(11);
                },
                    showId);
            }
            return(m);
        }
Example #14
0
        internal static ShopOrder GetShopOrder(int id)
        {
            ShopOrder m = new ShopOrder(id);

            if (id > 0)
            {
                SafeProcedure.ExecuteAndMapRecords(
                    Database.GetDatabase(JaneDefine.DBInstanceName),
                    "dbo.Shop_orders_Get",
                    delegate(IRecord record)
                {
                    m.Id          = record.GetInt32OrDefault(0, 0);
                    m.UserId      = record.GetInt32OrDefault(1, 0);
                    m.AddDate     = record.GetDateTimeOrEmpty(2);
                    m.Ordertype   = (OrderType)(record.GetInt32OrDefault(3, 0));
                    m.Address     = record.GetStringOrEmpty(4);
                    m.Email       = record.GetStringOrEmpty(5);
                    m.Mobile      = record.GetStringOrEmpty(6);
                    m.Paymoney    = record.GetDouble(7);
                    m.Paytype     = (PayType)(record.GetInt32OrDefault(8, 0));
                    m.Payresult   = (PayResult)(record.GetInt32OrDefault(9, 0));
                    m.Payremark   = record.GetStringOrEmpty(10);
                    m.Paythirdnum = record.GetStringOrEmpty(11);
                    m.Paydate     = record.GetDateTime(12);
                    m.ZipCode     = record.GetStringOrEmpty(13);
                    m.UserName    = record.GetStringOrEmpty(14);
                    m.RegionId    = record.GetInt32OrDefault(15, 0);
                    m.Freight     = record.GetDouble(16);
                    m.RegionStr   = record.GetStringOrEmpty(17);
                },
                    id);
            }
            return(m);
        }
Example #15
0
        internal static List <News> GetPagedNewsByTypeANDPublishDate(PagingContext pager, int newsType, DateTime sTime,
                                                                     DateTime eTime, int publishStatus, int newsRemarkType)
        {
            List <News> list = new List <News>(pager.RecordsPerPage);

            if (newsRemarkType == -1)
            {
                SafeProcedure.ExecuteAndMapRecords(Database.GetDatabase(D4DDefine.DBInstanceName),
                                                   "dbo.News_GetPagedByNewsTypeAndPublishDate",
                                                   delegate(IParameterSet parameters)
                {
                    parameters.AddWithValue("@NewsType", newsType);
                    parameters.AddWithValue("@STime", sTime);
                    parameters.AddWithValue("@ETime", eTime);
                    parameters.AddWithValue("@PublishStatus", publishStatus);
                    parameters.AddWithValue("@PageIndex", pager.CurrentPageNumber);
                    parameters.AddWithValue("@PageSize", pager.RecordsPerPage);
                    parameters.AddWithValue("@NumberOfCount", 0, ParameterDirectionWrap.Output);
                },
                                                   delegate(IRecord record)
                {
                    MapList(record, list);
                },
                                                   delegate(IParameterSet outputParameters)
                {
                    pager.TotalRecordCount = outputParameters.GetValue("@NumberOfCount") == DBNull.Value ? 0 : (int)outputParameters.GetValue("@NumberOfCount");
                }
                                                   );
            }
            else
            {
                SafeProcedure.ExecuteAndMapRecords(Database.GetDatabase(D4DDefine.DBInstanceName),
                                                   "dbo.News_GetPagedByNewsTypeAndPublishDateV2",
                                                   delegate(IParameterSet parameters)
                {
                    parameters.AddWithValue("@RemarkType", newsRemarkType);
                    parameters.AddWithValue("@NewsType", newsType);
                    parameters.AddWithValue("@STime", sTime);
                    parameters.AddWithValue("@ETime", eTime);
                    parameters.AddWithValue("@PublishStatus", publishStatus);
                    parameters.AddWithValue("@PageIndex", pager.CurrentPageNumber);
                    parameters.AddWithValue("@PageSize", pager.RecordsPerPage);
                    parameters.AddWithValue("@NumberOfCount", 0, ParameterDirectionWrap.Output);
                },
                                                   delegate(IRecord record)
                {
                    MapList(record, list);
                },
                                                   delegate(IParameterSet outputParameters)
                {
                    pager.TotalRecordCount = outputParameters.GetValue("@NumberOfCount") == DBNull.Value ? 0 : (int)outputParameters.GetValue("@NumberOfCount");
                }
                                                   );
            }


            return(list);
        }
Example #16
0
        internal static List <SearchResult> GetPagedSearch(PagingContext pager,
                                                           string searchText, ObjectTypeDefine objectType)
        {
            List <SearchResult> list = new List <SearchResult>(pager.RecordsPerPage);

            string SearchSp = string.Empty;

            switch (objectType)
            {
            case ObjectTypeDefine.Show:
                SearchSp = "dbo.Search_GetPagedShow";
                break;

            case ObjectTypeDefine.MusicTitle:
            case ObjectTypeDefine.Song:
                SearchSp = "dbo.Search_GetPagedMusic";
                break;

            case ObjectTypeDefine.Album:
            case ObjectTypeDefine.Image:
                SearchSp = "dbo.Search_GetPagedAlbum";
                break;

            case ObjectTypeDefine.Video:
                SearchSp = "dbo.Search_GetPagedVideoNews";
                break;

            case ObjectTypeDefine.News:
                SearchSp = "dbo.Search_GetPagedNews";
                break;

            default:
                return(list);
            }

            SafeProcedure.ExecuteAndMapRecords(Database.GetDatabase(D4DDefine.DBInstanceName),
                                               SearchSp,
                                               delegate(IParameterSet parameters)
            {
                parameters.AddWithValue("@SearchTxt", searchText);
                parameters.AddWithValue("@PageIndex", pager.CurrentPageNumber);
                parameters.AddWithValue("@PageSize", pager.RecordsPerPage);
                parameters.AddWithValue("@NumberOfCount", 0, ParameterDirectionWrap.Output);
            },
                                               delegate(IRecord record)
            {
                MapSeachResultList(record, list, objectType);
            },
                                               delegate(IParameterSet outputParameters)
            {
                pager.TotalRecordCount = outputParameters.GetValue("@NumberOfCount") == DBNull.Value ? 0 : (int)outputParameters.GetValue("@NumberOfCount");
            }
                                               );

            return(list);
        }
Example #17
0
 static void Main(string[] args)
 {
     SafeProcedure.ExecuteAndMapRecords(Database.GetDatabase("MyTest"),
                                        "dbo.GetMyTest",
                                        delegate(IRecord record)
     {
         Trace.WriteLine(record.GetStringOrEmpty(0));
         Trace.WriteLine(record.GetInt32(1));
         Trace.WriteLine(record.GetStringOrEmpty(2));
         Trace.WriteLine("---------------record-----------------");
     },
                                        "test");//Copy conn.config to build path
 }
Example #18
0
        internal static List <Show> GetShowTagRelation(int currentId, int maxCount)
        {
            List <Show> list = new List <Show>(maxCount);

            SafeProcedure.ExecuteAndMapRecords(Database.GetDatabase(D4DDefine.DBInstanceName),
                                               "dbo.Show_GetTagRelation",
                                               delegate(IRecord record)
            {
                MapList(record, list);
            }, currentId, maxCount
                                               );

            return(list);
        }
Example #19
0
        internal static List <Show> GetShowPreviousNext(int currentId)
        {
            List <Show> list = new List <Show>(2);

            SafeProcedure.ExecuteAndMapRecords(Database.GetDatabase(D4DDefine.DBInstanceName),
                                               "dbo.Show_GetPreviousNext",
                                               delegate(IRecord record)
            {
                MapList(record, list);
            }, currentId
                                               );

            return(list);
        }
Example #20
0
        /// <summary>
        /// 获取tag的top列表
        /// </summary>
        /// <param name="maxCount"></param>
        /// <returns></returns>
        internal static List <SpamKeyword> GetAllSpamKeywords()
        {
            List <SpamKeyword> list = new List <SpamKeyword>();

            SafeProcedure.ExecuteAndMapRecords(
                Database.GetDatabase(D4DDefine.DBInstanceName),
                "dbo.SpamKeywords_GetAll",
                delegate(IRecord record)
            {
                MapList(record, list);
            }, null);

            return(list);
        }
Example #21
0
        /*
         *  USE [newbbs]
         *  GO
         *  SET ANSI_NULLS ON
         *  GO
         *  SET QUOTED_IDENTIFIER ON
         *  GO
         *
         *  CREATE PROCEDURE [newbbs].[dnt_getuidbyusername]
         *  @username nchar(20)
         *  AS
         *  SELECT TOP 1 [uid] FROM [dnt_users] WHERE [username]=@username
         */
        internal static int GetUserIdByUserName(string username)
        {
            int uid = -1;

            SafeProcedure.ExecuteAndMapRecords(
                Database.GetDatabase(D4DDefine.JaneBBSDBInstanceName),
                "newbbs.dnt_getuidbyusername",
                delegate(IRecord record)
            {
                uid = record.GetInt32OrDefault(0, 0);
            },
                username);

            return(uid);
        }
Example #22
0
        internal static List <BandInfo> GetAllBandInfo(int minIndex)
        {
            List <BandInfo> list = new List <BandInfo>();

            SafeProcedure.ExecuteAndMapRecords(
                Database.GetDatabase(D4DDefine.DBInstanceName),
                "dbo.BandInfo_GetAll",
                delegate(IRecord record)
            {
                MapImageList(record, list);
            },
                minIndex);

            return(list);
        }
Example #23
0
        internal static List <Image> GetImagesByAlbumId(int albumId, int publishStatus)
        {
            List <Image> list = new List <Image>();

            if (albumId > 0)
            {
                SafeProcedure.ExecuteAndMapRecords(
                    Database.GetDatabase(D4DDefine.DBInstanceName),
                    "dbo.Image_GetByAlbumId",
                    delegate(IRecord record)
                {
                    MapImageList(record, list);
                },
                    publishStatus, albumId);
            }
            return(list);
        }
Example #24
0
        internal static List <ShopTradelist> GetShopTradelistByOrderId(int orderid)
        {
            List <ShopTradelist> list = new List <ShopTradelist>();

            if (orderid > 0)
            {
                SafeProcedure.ExecuteAndMapRecords(
                    Database.GetDatabase(JaneDefine.DBInstanceName),
                    "dbo.Shop_tradelist_Getbyorderid",
                    delegate(IRecord record)
                {
                    MapList(record, list);
                },
                    orderid);
            }
            return(list);
        }
Example #25
0
        internal static List <MusicSongList> GetMusicSongListByMusicId(int musicId, int publishStatus)
        {
            List <MusicSongList> list = new List <MusicSongList>();

            if (musicId > 0)
            {
                SafeProcedure.ExecuteAndMapRecords(
                    Database.GetDatabase(D4DDefine.DBInstanceName),
                    "dbo.Music_GetMusicSongListByMusicId",
                    delegate(IRecord record)
                {
                    MapMusicSongList(record, list);
                },
                    publishStatus, musicId);
            }
            return(list);
        }
Example #26
0
        internal static List <ShopRegion> GetShopRegionsByParentId(int parentId)
        {
            List <ShopRegion> list = new List <ShopRegion>();

            SafeProcedure.ExecuteAndMapRecords(Database.GetDatabase(JaneDefine.DBInstanceName),
                                               "dbo.Shop_region_GetByParentId",
                                               delegate(IParameterSet parameters)
            {
                parameters.AddWithValue("@ParentId", parentId);
            },
                                               delegate(IRecord record)
            {
                MapList(record, list);
            }
                                               );

            return(list);
        }
Example #27
0
        /// <summary>
        /// 获取已发布商品根据最大点击数倒序排列的商品信息
        /// </summary>
        /// <param name="maxCount"></param>
        /// <returns></returns>
        internal static List <ShopItem> GetTopPublishedShopItemsOrderByHits(int maxCount)
        {
            List <ShopItem> list = new List <ShopItem>(maxCount);

            SafeProcedure.ExecuteAndMapRecords(Database.GetDatabase(JaneDefine.DBInstanceName),
                                               "dbo.Shop_items_GetTopPublishedShopItemsOrderByHits",
                                               delegate(IParameterSet parameters)
            {
                parameters.AddWithValue("@MaxCount", maxCount);
            },
                                               delegate(IRecord record)
            {
                MapList(record, list);
            }
                                               );

            return(list);
        }
Example #28
0
        internal static List <BandInfo> GetAllBandInfos(int minIndex)
        {
            List <BandInfo> list = new List <BandInfo>();

            SafeProcedure.ExecuteAndMapRecords(Database.GetDatabase(D4DDefine.DBInstanceName),
                                               "dbo.BandInfo_GetAll",
                                               delegate(IParameterSet parameters)
            {
                parameters.AddWithValue("@MinIndex", minIndex);
            },
                                               delegate(IRecord record)
            {
                MapBandInfoList(record, list);
            }
                                               );

            return(list);
        }
Example #29
0
        internal static DiscuzPasswordAuthInfo GetPasswordAuthInfo(string username, string password, bool originalpassword)
        {
            DiscuzPasswordAuthInfo p = new DiscuzPasswordAuthInfo();

            SafeProcedure.ExecuteAndMapRecords(
                Database.GetDatabase(D4DDefine.JaneBBSDBInstanceName),
                "newbbs.dnt_checkpasswordbyusername",
                delegate(IRecord record)
            {
                p.Uid     = record.GetInt32OrDefault(0, 0);
                p.Groupid = record.GetInt16OrDefault(1, 0);
                p.Adminid = record.GetInt32OrDefault(2, 0);
            },
                username,
                originalpassword ? Utils.MD5(password) : password);

            return(p);
        }
Example #30
0
        internal static DiscuzUserInfo GetUserInfo(int uid)
        {
            DiscuzUserInfo m = new DiscuzUserInfo();

            if (uid > 0)
            {
                m.Uid = uid;
                SafeProcedure.ExecuteAndMapRecords(
                    Database.GetDatabase(D4DDefine.JaneBBSDBInstanceName),
                    "newbbs.dnt_getuserinfo",
                    delegate(IRecord record)
                {
                    MapUserInfo(record, m);
                },
                    uid);
            }
            return(m);
        }