Esempio n. 1
0
 public DBHelper(ILogInfoService logInfoService,
                 IProjectInfoService projectInfoService,
                 IProjectOwnerService projectOwnerService)
 {
     _logInfoService      = logInfoService;
     _projectInfoService  = projectInfoService;
     _projectOwnerService = projectOwnerService;
 }
Esempio n. 2
0
 public AuthenticationService(IUserRepository userRepository, ILogInfoService logInfoService,
                              IMessengerService messengerService, IJwtTokenProvider jwtTokenProvider, IMapper mapper, IActionContextAccessor actionContext)
 {
     _userRepository   = userRepository;
     _logInfoService   = logInfoService;
     _messengerService = messengerService;
     _jwtTokenProvider = jwtTokenProvider;
     _mapper           = mapper;
     _actionContext    = actionContext;
 }
 public LogInfoController(ILogInfoService logInfoService, ILogInfoAPIController logInfoAPIController)
 {
     _loginfoService       = logInfoService;
     _loginfoAPIController = logInfoAPIController;
     if (System.Web.HttpContext.Current.Request.UrlReferrer != null && System.Web.HttpContext.Current.Request.UrlReferrer.AbsoluteUri != null)
     {
         str = System.Web.HttpContext.Current.Request.UrlReferrer.AbsoluteUri.ToString();
         string Fullurl = str + "api/PatientsAPI/GetPatients";
         ViewBag.TempUrl = Fullurl;
     }
 }
Esempio n. 4
0
        public ActionResult Index()
        {
            string echostr = Function.GetRequestString("echostr");//微信后台绑定验证

            if (!string.IsNullOrEmpty(echostr))
            {
                return(Content(echostr));
            }

            var weiXinInfo = new WeiXin.APIClient.WechatService.weixin();

            if (weiXinInfo.CheckSignature() && !string.IsNullOrEmpty(echostr))
            {
                return(Content(echostr));
            }
            if (Request.HttpMethod.ToLower() != "post")
            {
                return(Content("只接受post请求"));
            }

            System.IO.Stream s = Request.InputStream;
            byte[]           b = new byte[s.Length];
            s.Read(b, 0, (int)s.Length);
            var postStr = System.Text.Encoding.UTF8.GetString(b);

            if (!string.IsNullOrEmpty(postStr))
            {
                LogInfo info = new LogInfo();
                info.Category = "ResponseWechatMsg";
                info.UserName = "******";
                info.AddDate  = DateTime.Now;
                info.Serious  = 1;
                info.UserName = "";
                try
                {
                    string Result = weiXinInfo.Handle(postStr);
                    return(Content(Result));
                }
                catch (Exception ex)
                {
                    info.Detail += "||||ex.Message" + ex.Message;
                    //new LogInfoService().Create(info);
                    ILogInfoService LogBLL = AbstractFactory.CreateLogInfoService();
                    LogBLL.Create(info);
                }
            }


            return(Content("空白请求"));
        }
Esempio n. 5
0
            //public bool ResponseTemplateMsg(ResearchPlanUserInfo infoPlanUser, string TargetOpenID)
            //{
            //    WechatTemplateMsgInfo infoTemplateMsg = new WechatTemplateMsgInfo();
            //    infoTemplateMsg.TouserOpenID = string.Empty;
            //    infoTemplateMsg.Template_id = WechatTemplateMsgInfo.GetTemplateMsgID课程提醒(WeiXinConst.AppId);
            //    infoTemplateMsg.URL = ConfigHelper.GetAppendSettingValue(ConfigHelper.WEBDoMain) + "/Wechat/ResearchPlanUser/Confirm?PlanID=" +infoPlanUser.ResearchPlanID;
            //    WechatTemplateMsgItemInfo info = new WechatTemplateMsgItemInfo();
            //    info.DataKey = "first";
            //    info.DataValue = "组织调研参与确认函";
            //    infoTemplateMsg.Data.Add(info);

            //    info = new WechatTemplateMsgItemInfo();
            //    info.DataKey = "keyword1"; //预约项目
            //    info.DataValue = infoPlanUser.ResearchPlanInfo.Name;
            //    infoTemplateMsg.Data.Add(info);

            //    info = new WechatTemplateMsgItemInfo();
            //    info.DataKey = "keyword2"; //预约时间
            //    info.DataValue = infoPlanUser.ResearchPlanInfo.DateBegin.ToString("yyyy-MM-dd");
            //    infoTemplateMsg.Data.Add(info);

            //    info = new WechatTemplateMsgItemInfo();
            //    info.DataKey = "remark"; //remark
            //    info.DataValue = "请及时回复是否参与。";
            //    infoTemplateMsg.Data.Add(info);


            //    infoTemplateMsg.TouserOpenID = TargetOpenID;
            //    return ResponseTemplateMsg(infoTemplateMsg);

            //}

            #endregion

            /// <summary>
            /// 推送模板消息
            /// </summary>
            /// <returns>微信推送完成后的消息ID</returns>
            public bool ResponseTemplateMsg(WechatTemplateMsgInfo infoMsg)
            {
                string URL        = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + GetAccessTonken();
                string DataResult = DataHelper.PostHttpData(URL, infoMsg.ToJson());

                LogInfo infoLog = new LogInfo();

                infoLog.Category = "ResponseTemplateMsg";
                infoLog.UserName = DataResult.Length > 50?DataResult.Substring(0, 49):DataResult;
                infoLog.Detail   = infoMsg.ToJson();
                infoLog.AddDate  = DateTime.Now;
                infoLog.Serious  = 0;
                ILogInfoService LogBLL = AbstractFactory.CreateLogInfoService();

                LogBLL.Create(infoLog);

                return(DataResult.Contains("\"errcode\":0,"));
            }
        public override string Handle()
        {
            IUserInfoService     UserBLL     = AbstractFactory.CreateUserInfoService();
            ILogInfoService      LogBLL      = AbstractFactory.CreateLogInfoService();
            IProfilesInfoService ProfilesBLL = AbstractFactory.CreateProfilesInfoService();

            if (Event == "subscribe")
            {
                string SubcribeContent = string.Empty;// ProfilesBLL.GetValue(ProfilesInfo.Wechat.SubcribeContent);
                if (string.IsNullOrEmpty(SubcribeContent))
                {
                    SubcribeContent = "欢迎关注!";
                }
                return(ResponseText(SubcribeContent));
            }
            else
            {
                return(string.Empty);
            }
        }
 public HomeController(IUserInfoService service, ILogInfoService serviceLogInfo)
 {
     this._service        = service;
     this._serviceLogInfo = serviceLogInfo;
 }
Esempio n. 8
0
 public LogInfoController(ILogInfoService logInfoService, IMapper mapper)
 {
     _logInfoService = logInfoService;
     _mapper         = mapper;
 }
 public LogInfoController(ILogInfoService service)
 {
     this._service = service;
 }