Exemplo n.º 1
0
        /// <summary>
        /// 添加商家关注
        /// </summary>
        public void AddAttentionMer(decimal MerId)
        {
            DAL.AttentionDAL dal = new DAL.AttentionDAL();
            DataTable        dt  = dal.GetList("  UserId='" + Common.CookieSings.GetCurrentUserId() + "' and AttentionMerId= '" + MerId + "'").Tables[0];

            if (!IsAttentionMer(MerId))
            {
                Model.AttentionModel model = new AttentionModel();
                model.AttentionMerId  = MerId;
                model.AttentionType   = 2;
                model.AttentionUserId = "";
                model.DynamicLv       = 1;
                model.FlagInvalid     = false;
                model.UserId          = Common.CookieSings.GetCurrentUserId();
                dal.Add(model);
            }
            else
            {
                throw new Exception("您已经关注了这个商家!");
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 添加用户关注
        /// </summary>
        public void AddAttentionUser(string AttentionUserId)
        {
            DAL.AttentionDAL dal = new DAL.AttentionDAL();
            DataTable        dt  = dal.GetList("  ").Tables[0];

            if (!IsAttentionUser(AttentionUserId))
            {
                Model.AttentionModel model = new AttentionModel();
                model.AttentionMerId  = 0;
                model.AttentionType   = 1;
                model.AttentionUserId = AttentionUserId;
                model.DynamicLv       = 1;
                model.FlagInvalid     = false;
                model.UserId          = Common.CookieSings.GetCurrentUserId();
                dal.Add(model);
            }
            else
            {
                throw new Exception("您已经关注了这个用户!");
            }
        }