示例#1
0
        //保存设置信息
        public void SaveMessageSetInfo()
        {
            string msg  = string.Empty;
            var    list = TuanDai.SMS.Client.MessageSetClient.GetMsgSetInfoListByUserId(WebUserAuth.UserId.Value, ref msg);

            TuanDai.SMS.Client.MsgSetInfo item = null;
            if (list != null && list.Count > 0)
            {
                item = list.FirstOrDefault();
            }

            string notices = Tool.WEBRequest.GetString("notices");

            string preMessage = item != null ? item.CategoryNotices :"";

            if (!string.IsNullOrEmpty(preMessage) && preMessage.Contains("chk4_6"))
            {
                notices += ",chk4_6";
            }
            var isUpdate = TuanDai.SMS.Client.MessageSetClient.UpdateMsgSetInfoCategoryNotices(WebUserAuth.UserId.Value, notices,
                                                                                               PlatformSource.WeiXin, ref msg);

            if (isUpdate)
            {
                WebLog log = new WebLog();
                log.AddDate        = DateTime.Now;
                log.BusinessId     = WebUserAuth.UserId.ToString();
                log.BusinessTypeId = (int)ConstString.LogBusinessType.Edit;
                log.UserId         = WebUserAuth.UserId.ToString();
                log.UserTypeId     = (int)ConstString.LogUserType.WebUser;
                log.HandlerTypeId  = (int)ConstString.LogType.InformSetting;
                log.Content1       = "信息设置,修改之前:" + preMessage + ";修改之后:" + notices;
                log.Id             = Guid.NewGuid().ToString();
                WebLogInfo.WriteLoginHandler(log);

                PrintJson("1", "设置成功");
            }

            else
            {
                PrintJson("0", "设置失败" + msg);
            }
        }
示例#2
0
        public void GetMessageSetInfo()
        {
            Guid userId = WebUserAuth.UserId.Value;

            if (userId == Guid.Empty)
            {
                PrintJson("-99", "登录已失效");
            }
            string msg  = string.Empty;
            var    list = TuanDai.SMS.Client.MessageSetClient.GetMsgSetInfoListByUserId(WebUserAuth.UserId.Value, ref msg);

            TuanDai.SMS.Client.MsgSetInfo item = null;
            if (list != null && list.Count > 0)
            {
                item = list.FirstOrDefault();
            }

            if (item == null)
            {
                PrintJson("0", "无设置数据");
            }
            PrintJson("1", JsonConvert.SerializeObject(item));
        }