Example #1
0
        private bool DoEdit()
        {
            BLL.wx_crm_users_tag tagBll = new BLL.wx_crm_users_tag();

            int tagId = int.Parse(hidtagId.Value);

            Model.wx_crm_users_tag tagEntity = new Model.wx_crm_users_tag();

            if (tagId > 0)
            { //修改
                tagEntity     = tagBll.GetModel(tagId);
                tagEntity.tag = txtTag.Text.Trim();
                return(tagBll.Update(tagEntity));
            }
            else
            {   //新增
                tagEntity.wid        = int.Parse(hidWid.Value);
                tagEntity.openid     = hidOpenid.Value;
                tagEntity.tag        = txtTag.Text.Trim();
                tagEntity.createDate = DateTime.Now;
                int ret = tagBll.Add(tagEntity);
                if (ret > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
Example #2
0
        private void ShowInfo(int _id)
        {
            BLL.wx_crm_users   uBll = new BLL.wx_crm_users();
            Model.wx_crm_users user = uBll.GetModel(_id);

            BLL.wx_crm_group   gBll  = new BLL.wx_crm_group();
            Model.wx_crm_group group = gBll.GetModel(user.groupId.Value);

            BLL.wx_crm_users_tag   tBll      = new BLL.wx_crm_users_tag();
            Model.wx_userweixin    weixin    = GetWeiXinCode();
            Model.wx_crm_users_tag tagEntity = tBll.GetModelByWidAndOpenid(weixin.id, user.openid);



            lblnickname.Text  = user.nickname;
            imgPhoto.ImageUrl = user.headimgurl;

            lblSex.Text = GetUserSex(int.Parse(user.sex));

            lblArea.Text           = user.country + " " + user.province + " " + user.city;
            lblsubscribe_time.Text = MyCommFun.GetTime(user.subscribe_time).ToString();

            prov = user.province;


            if (group != null)
            {
                lblGroupName.Text = group.name;
            }

            if (tagEntity != null)
            {
                hidtagId.Value = tagEntity.id.ToString();
                txtTag.Text    = tagEntity.tag;
            }

            hidWid.Value    = user.wid.ToString();
            hidOpenid.Value = user.openid;
        }