Ejemplo n.º 1
0
        /// <summary>
        /// 检查是否关注了这个用户
        /// </summary>
        /// <param name="AttentionUserId"></param>
        /// <returns></returns>
        public bool IsAttentionUser(string AttentionUserId)
        {
            DAL.AttentionDAL dal = new DAL.AttentionDAL();

            int i = dal.ExInt(" UserId='" + Common.CookieSings.GetCurrentUserId() + "' and AttentionUserId= '" + AttentionUserId + "' ");

            if (i > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
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("您已经关注了这个商家!");
            }
        }
Ejemplo n.º 3
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("您已经关注了这个用户!");
            }
        }
Ejemplo n.º 4
0
 public void DeleteAttention(string strWhere)
 {
     DAL.AttentionDAL dal = new DAL.AttentionDAL();
     dal.DeleteList(strWhere);
 }