예제 #1
0
        /// <summary>
        /// 获取指定userid的店铺信息
        /// </summary>
        /// <param name="userid">用户id</param>
        /// <returns>店铺信息</returns>
        public static Shopinfo GetShopByUserId(int userId)
        {
            Shopinfo shopinfo = DTO.GetShopInfo(DbProvider.GetInstance().GetShopByUserId(userId));

            //当无该店铺时, 则创建该店铺
            if (shopinfo == null)
            {
                shopinfo                = new Shopinfo();
                shopinfo.Bulletin       = "";
                shopinfo.Createdatetime = DateTime.Now;
                shopinfo.Introduce      = "";
                shopinfo.Lid            = -1;
                shopinfo.Locus          = "";
                shopinfo.Logo           = "";
                shopinfo.Shopname       = "";
                shopinfo.Themeid        = 0;
                shopinfo.Themepath      = "";
                shopinfo.Uid            = userId;
                shopinfo.Username       = "";
                Shops.CreateShop(shopinfo);

                shopinfo = Shops.GetShopByUserId(userId);
            }
            return(shopinfo);
        }