private bool CurrentUserPermissionCheck() { if (!string.IsNullOrWhiteSpace(ViewBag.LillyId)) { try { var lst = new List <KeyValuePair <string, string> >(); lst.Add(new KeyValuePair <string, string>("LillyId", ViewBag.LillyId)); string strUrl = string.Format("{0}/WeChatO2O/Interface/GetCurrentUser?{1}", IDoctorHost, ParaTools.GetParas(lst)); log.Debug(strUrl); var data = WebRequest.GetHtmlFromUrl(strUrl); if (string.IsNullOrWhiteSpace(data) || "[]".Equals(data)) { return(false); } } catch (Exception e) { _Logger.Error("CurrentUserPermissionCheck failed ,{0},{1}", e, IDoctorHost); return(false); } } return(true); }
public ContentResult GetShareQRCode(string ids, int personid) { //string strUrl = string.Format(string.Format("{0}/WeChatO2O/Interface/GetShareQRCode?newsIds={1}&dctrId={2}&SalesID={3}", // IDoctorHost, ids, personid, ViewBag.LillyId)); if (string.IsNullOrEmpty(ids)) { return(Content("参数错误,请检查文章是否选择!ids:" + ids, "application/json")); } var lst = new List <KeyValuePair <string, string> >(); lst.Add(new KeyValuePair <string, string>("SalesID", ViewBag.LillyId)); lst.Add(new KeyValuePair <string, string>("dctrId", personid.ToString())); lst.Add(new KeyValuePair <string, string>("newsIds", ids)); string strUrl = string.Format("{0}/WeChatO2O/Interface/GetShareQRCode?{1}", IDoctorHost, ParaTools.GetParas(lst)); log.Debug(strUrl); var data = WebRequest.GetHtmlFromUrl(strUrl); return(Content(data, "application/json")); }
public ContentResult GetDoctorListByNewsId() { string lillyId = ViewBag.LillyId; var pageindex = string.IsNullOrEmpty(Request["Pageindex"]) ? 1 : int.Parse(Request["Pageindex"]); var pagesize = string.IsNullOrEmpty(Request["Pagesize"]) ? 8 : int.Parse(Request["Pagesize"]); var newsId = string.IsNullOrEmpty(Request["NewsId"]) ? 0 : int.Parse(Request["NewsId"]); string tiers = Request["Tiers"]; string strSearch = Request["SearchStr"]; string strStatus = Request["status"]; var lst = new List <KeyValuePair <string, string> >(); lst.Add(new KeyValuePair <string, string>("userId", lillyId)); lst.Add(new KeyValuePair <string, string>("pageIndex", pageindex.ToString())); lst.Add(new KeyValuePair <string, string>("pageCnt", pagesize.ToString())); lst.Add(new KeyValuePair <string, string>("filter", strSearch)); lst.Add(new KeyValuePair <string, string>("level", tiers)); lst.Add(new KeyValuePair <string, string>("newsId", newsId.ToString())); lst.Add(new KeyValuePair <string, string>("status", strStatus)); //string strUrl = string.Format(string.Format("{0}/WeChatO2O/Interface/GetDoctorReadCountByNewsId?userId={1}&newsId={6}&pageIndex={2}&pageCnt={3}&filter={4}&level={5}", // IDoctorHost, lillyId, pageindex, pagesize, strSearch, tiers, newsId)); string strUrl = string.Format("{0}/WeChatO2O/Interface/GetDoctorReadCountByNewsId?{1}", IDoctorHost, ParaTools.GetParas(lst)); log.Debug(strUrl); var data = WebRequest.GetHtmlFromUrl(strUrl); return(Content(data, "application/json")); }
public ContentResult GetRankingInfo(int?iTop, string BU = null) { iTop = iTop ?? 0; BU = string.IsNullOrEmpty(BU) ? DIA : BU; string strKey = "IDoctor_GetRankingInfo_" + ViewBag.LillyId.ToString() + BU; //缓存四个小时 //var data = cacheManager.Get<string>(strKey, () => //{ var lst = new List <KeyValuePair <string, string> >(); lst.Add(new KeyValuePair <string, string>("BU", BU.ToString())); lst.Add(new KeyValuePair <string, string>("DoctorID", ViewBag.LillyId)); lst.Add(new KeyValuePair <string, string>("iTop", iTop.ToString())); string strUrl = string.Format("{0}/WeChatO2O/Interface/GetRankingInfo?{1}", IDoctorHost, ParaTools.GetParas(lst)); log.Debug(strUrl); var data = WebRequest.GetHtmlFromUrl(strUrl); //}); return(Content(data, "application/json")); }
public ContentResult GetArticleList() { string lillyId = ViewBag.LillyId; ViewBag.HostUrl = IDoctorHost; var pageindex = string.IsNullOrEmpty(Request["Pageindex"]) ? 1 : int.Parse(Request["Pageindex"]); var pagesize = string.IsNullOrEmpty(Request["Pagesize"]) ? 6 : int.Parse(Request["Pagesize"]); string strBU = Request["BU"]; if (string.IsNullOrEmpty(strBU)) { strBU = DIA; } //var data = cacheManager.Get<string>("IDoctor_GetArticleList", () => //{ //var lst = new List<KeyValuePair<string, string>>(); //lst.Add(new KeyValuePair<string, string>("userId", lillyId)); //lst.Add(new KeyValuePair<string, string>("pageIndex", pageindex.ToString())); //lst.Add(new KeyValuePair<string, string>("pageCnt", pagesize.ToString())); //lst.Add(new KeyValuePair<string, string>("filter", "")); //// string strUrl = string.Format("{0}/WeChatO2O/Interface/GetAticleList?userId={1}&pageIndex={2}&pageCnt={3}&filter={4}", ////IDoctorHost, lillyId, pageindex, pagesize, ""); //string strUrl = string.Format("{0}/WeChatO2O/Interface/GetAticleList?{1}", IDoctorHost, ParaTools.GetParas(lst)); //log.Debug(strUrl); //var data = WebRequest.GetHtmlFromUrl(strUrl); //}); var lst = new List <KeyValuePair <string, string> >(); lst.Add(new KeyValuePair <string, string>("userId", lillyId)); lst.Add(new KeyValuePair <string, string>("BU", strBU)); lst.Add(new KeyValuePair <string, string>("pageIndex", pageindex.ToString())); lst.Add(new KeyValuePair <string, string>("pageCnt", pagesize.ToString())); lst.Add(new KeyValuePair <string, string>("filter", "")); // string strUrl = string.Format("{0}/WeChatO2O/Interface/GetAticleList?userId={1}&pageIndex={2}&pageCnt={3}&filter={4}", //IDoctorHost, lillyId, pageindex, pagesize, ""); string strUrl = string.Format("{0}/WeChatO2O/Interface/GetAticleList?{1}", IDoctorHost, ParaTools.GetParas(lst)); log.Debug(strUrl); var data = WebRequest.GetHtmlFromUrl(strUrl); return(Content(data.Replace("ImgType=2", "ImgType=1"), "application/json")); }