protected void Page_Load(object sender, EventArgs e)
        {
            FavoriteBll   fbll     = new FavoriteBll();
            FavoriteModel favModel = new FavoriteModel();

            favModel.ContentId    = int.Parse(ReqParas["cid"]);
            favModel.UserId       = CurrentUser.UserId;
            favModel.ContentType  = (ContentType)int.Parse(ReqParas["ctype"]);
            favModel.FavoriteName = "";
            favModel.FavoriteUrl  = "";
            fbll.Add(favModel);
            Response.Redirect("MyFavorite.aspx");
        }
        private string AddFavorite(HttpContext context)
        {
            NameValueCollection nv = GetParas(context);
            bool   result          = false;
            string code            = "";
            string message         = "";

            if (context.User.Identity.IsAuthenticated && ((ShopIdentity)context.User.Identity) != null)
            {
                FavoriteBll   fbll     = new FavoriteBll();
                FavoriteModel favModel = new FavoriteModel();

                favModel.ContentId   = int.Parse(nv["cid"]);
                favModel.UserId      = ((ShopIdentity)context.User.Identity).UserId;
                favModel.ContentType = (ContentType)int.Parse(nv["ctype"]);

                switch (favModel.ContentType)
                {
                case ContentType.Product:
                    NoName.NetShop.Product.BLL.ProductModelBll pbll   = new NoName.NetShop.Product.BLL.ProductModelBll();
                    NoName.NetShop.Product.Model.ProductModel  pmodel = pbll.GetModel(favModel.ContentId);
                    favModel.FavoriteName = pmodel.ProductName;
                    favModel.FavoriteUrl  = pmodel.ProductUrl;
                    break;

                case ContentType.Solution:
                    NoName.NetShop.Solution.BLL.SuiteBll     sbll   = new NoName.NetShop.Solution.BLL.SuiteBll();
                    NoName.NetShop.Solution.Model.SuiteModel smodel = sbll.GetModel(favModel.ContentId);
                    favModel.FavoriteName = smodel.SuiteName;
                    favModel.FavoriteUrl  = ConfigurationManager.AppSettings["siteurl"] + "/solution/suitedetail.aspx?suite=" + smodel.SuiteId;
                    break;
                }
                fbll.Add(favModel);
                result  = true;
                message = "收藏成功";
            }
            else
            {
                result  = false;
                message = "您还没有登录,请先登录!";
            }
            return(GetJsonResult(result, code, message));
        }