public static string apply_taoke_url(CmsForm cmsForm, ContentItem contentItem, string url, string pid) { if (!string.IsNullOrEmpty(url)) { string out_log; int n = 0; apply_click: LogUtil.log_call(cmsForm, "开始转化活动链接:"); string[] pid_list = Regex.Split(pid, "_", RegexOptions.IgnoreCase); string adzoneid = ""; string siteid = ""; if (pid_list.Length > 3) { siteid = pid_list[2]; adzoneid = pid_list[3]; } AlimamaClick alimamaClick = AlimamaUtil.query_taoke_click(cmsForm.appBean.taoke_cookie, url, adzoneid, siteid, out out_log); if (alimamaClick != null) { return(alimamaClick.short_url); } else { if (out_log.Contains("\"wait\"")) { if (n < 10) { n = n + 10; LogUtil.log_call(cmsForm, "申请过快,休息60秒:"); Thread.Sleep(60000); goto apply_click; } else { return(null); } } else if (out_log.Contains("callLocation") || out_log.Contains("gen url item not found on call")) { //LogUtil.log_call(cmsForm, "[该链接转化失败。]"); } else { if (n < 3) { n++; LogUtil.log_call(cmsForm, "检测登录状态:"); AppUtil.alimama_login(cmsForm); Thread.Sleep(1000); goto apply_click; } else { return(null); } } } } return(null); }
public static void alimama_login(CmsForm cmsForm) { int n = 0; while (n < 10) { if (!AlimamaUtil.check_login(cmsForm.appBean.taoke_cookie) && Process.GetProcessesByName(Constants.alimama_login_exe_name).Length <= 0) { LogUtil.log_call(cmsForm, "阿里妈妈登录过期。正在开始重新登录"); if (cmsForm.checkBoxAutoLogin.Checked) { AlimamaLogin.login(cmsForm, 1); } else { LogUtil.log_call(cmsForm, "没有开启阿里妈妈自动登录,无法完成登录"); return; } } else if (AlimamaUtil.check_login(cmsForm.appBean.taoke_cookie)) { LogUtil.log_call(cmsForm, "阿里妈妈登录正常"); return; } else if (Process.GetProcessesByName(Constants.alimama_login_exe_name).Length > 0) { LogUtil.log_call(cmsForm, "登录窗口正在运行中"); Thread.Sleep(3000); } n++; } }
public static void load_weibo(CmsForm cmsForm) { try { string out_log = ""; ArrayList follow_list = cmsForm.sendSqlUtil.query_weibo(0, out out_log); cmsForm.dataGridView_weibo.Rows.Clear(); if (follow_list != null && follow_list.Count > 0) { int i = 0; foreach (WeiboBean weiboBean in follow_list) { DataGridViewRow dataGridViewRow = new DataGridViewRow(); cmsForm.dataGridView_weibo.Rows.Add(dataGridViewRow); cmsForm.dataGridView_weibo.Rows[i].HeaderCell.Value = string.Concat(i + 1, ""); cmsForm.dataGridView_weibo[0, i].Value = weiboBean.user_name; cmsForm.dataGridView_weibo[1, i].Value = (weiboBean.status == 0 ? "未登陆" : "已登陆"); cmsForm.dataGridView_weibo[0, i].Tag = weiboBean; i++; } } cmsForm.appBean.weibo_list = follow_list; } catch { } }
public static string query_ali_api_url(CmsForm cmsForm , string num_iid, string pid, string activity_id) { HttpService httpservice = cmsForm.httpService; //long user_id = cmsForm.appBean.user_id; //string app_id = cmsForm.appBean.cms_app_id; //String user_key = cmsForm.appBean.user_token; //String user_name = cmsForm.appBean.user_name; //String click_url = Constants.goods_api_url; //String body = httpservice.post_http(click_url // , "user_id=" + user_id // + "&app_id=" + app_id // + "&member_token=" + user_key // + "&num_iid=" + num_iid // + "&pid=" + pid // + "&activity_id=" + activity_id // , null); //if (body.Contains("<content>")) //{ // string content = StringUtil.subString(body, 0, "<content>", "</content>"); // return content; //} return(""); }
public EditingSession EditingSession(CmsForm form, WarpCoreEntity entity) { var editingScope = BuildObjectEditingScope(form); var initialValues = entity.GetPropertyValues(x => editingScope.Contains(x.Name)); return(EditingSession(form, entity.GetType(), initialValues)); }
public static void update_weibo_list(CmsForm cmsForm, string user_name, string cookie) { if (!string.IsNullOrEmpty(cookie) && !string.IsNullOrEmpty(user_name)) { int i = 0; while (i < cmsForm.appBean.weibo_list.Count) { WeiboBean item = (WeiboBean)cmsForm.appBean.weibo_list[i]; if (item.user_name.Equals(user_name)) { LogUtil.log_call(cmsForm, "user_name:" + user_name); item.cookie = cookie; item.status = 1; } i = i + 1; } i = 0; while (cmsForm.dataGridView_weibo.Rows.Count > i) { WeiboBean tag = (WeiboBean)cmsForm.dataGridView_weibo[0, i].Tag; if (tag.user_name.Equals(user_name)) { LogUtil.log_call(cmsForm, "user_name:" + user_name); tag.cookie = cookie; tag.status = 1; cmsForm.dataGridView_weibo[1, i].Value = "已经登陆"; } i = i + 1; } } }
public static void login(CmsForm cmsForm) { try { if (Process.GetProcessesByName(Constants.weixin_login_exe_name).Length <= 0) { LogUtil.log_call(cmsForm, "微信助手登陆。。。。请稍候!"); //FormUtil.set_formWindowState(cmsForm, FormWindowState.Minimized); //LogUtil.log_call(cmsForm, "正在打开登录窗口。。。。"); //string str2 = " 0"; //if (!(cmsForm.appBean.uu_username.Equals("") || cmsForm.appBean.uu_pwd.Equals(""))) //{ // str2 = " 1 " + cmsForm.appBean.uu_username + " " + cmsForm.appBean.uu_pwd; //} //string arguments = "\"" + cmsForm.Text + "\" " + str + " " + alimama_acc + " " + alimama_pwd + " " + str2; string arguments = ""; try { Process.Start(cmsForm.app_path + @"\" + Constants.weixin_login_exe_name, arguments); } catch { } } } catch (Exception exception) { LogUtil.log_call(cmsForm, "[openWeixinForm]出错," + exception.ToString()); } }
public static void login(CmsForm cmsForm, WeiboBean weiboBean) { //WeiboLogin.login(cmsForm, weiboBean.user_name.Trim(), weiboBean.pwd.Trim()); string out_cookie = ""; string body = WeiboUtil.login(cmsForm, weiboBean.user_name.Trim(), weiboBean.pwd.Trim(), out out_cookie); if (!string.IsNullOrEmpty(out_cookie)) { WeiboUtil.update_weibo_list(cmsForm, weiboBean.user_name, out_cookie); } //LogUtil.log_call(cmsForm,"----"+ body); //HttpUpload httpUpload = new HttpUpload(); //httpUpload.SetFieldValue("type","json"); //FileStream fs = new FileStream(@"E:\work\cs\好品推\Release\config\临时文件夹\selhotshare\20161101091218\20161102010514273.jpg", FileMode.Open); //byte[] buffer = new byte[fs.Length]; //httpUpload.SetFieldValue("pic", "20161102010514273.jpg", "image/png", buffer); //string cotent = ""; //httpUpload.Upload("http://m.weibo.cn/mblogDeal/addPic", out_cookie, out body); //LogUtil.log_call(cmsForm, "----" + body); //LogUtil.log_call(cmsForm, "----" + fs.Length); //Dictionary<string, string> formDataDic = new Dictionary<string, string>(); //formDataDic.Add("type", "json"); //body = HttpUpload.CreateHttpUploadFile(cmsForm,"http://m.weibo.cn/mblogDeal/addPic", fs, "pic", "image/png" // , out_cookie, formDataDic //); //LogUtil.log_call(cmsForm, "----" + body); ////LogUtil.log_call(cmsForm, "----" + out_cookie); //body = WeiboUtil.post(cmsForm, "aadfasdfsd","", out_cookie); //LogUtil.log_call(cmsForm, "----" + body); }
public static void method_167(CmsForm cmsForm, out string out_log) { out_log = ""; try { if (!cmsForm.InvokeRequired) { cmsForm.Visible = true; cmsForm.WindowState = FormWindowState.Normal; Thread.Sleep(100); cmsForm.Activate(); Thread.Sleep(100); cmsForm.tabControlMain.SelectedIndex = 1; Thread.Sleep(100); } else { GDelegate74 gDelegate74 = new GDelegate74(QqUtil.method_167); cmsForm.BeginInvoke(gDelegate74, new object[] { cmsForm, out_log }); } } catch (Exception exception) { out_log = string.Concat("[WindowNomal]出错:", exception.ToString()); } }
public static void copy_content(CmsForm cmsForm, string content, out string out_log) { out_log = ""; try { if (!cmsForm.InvokeRequired) { //CommonUtil.clipboard("", out out_log); int n = 0; bool flag = false; while (n < 10 && !flag) { flag = CommonUtil.clipboard(content, out out_log); n++; if (!flag) { Thread.Sleep(1000); } } } else { GDelegate69 gDelegate69 = new GDelegate69(QqUtil.copy_content); object[] string96 = new object[] { cmsForm, content, out_log }; cmsForm.Invoke(gDelegate69, string96); //cmsForm.BeginInvoke(gDelegate69, string96); } } catch (Exception exception) { out_log = string.Concat("[CopySndContent]出错:", exception.ToString()); } }
public static void zhuanhua_copy_Click_kouling(CmsForm cmsForm, string content) { try { content = UrlUtil.copyImgContent(cmsForm, content, null); content = UrlUtil.parseContentWenan(cmsForm, content); ContentItem contentItem = UrlUtil.parseContent(cmsForm, content, null, true, true, 0); content = contentItem.content_send; string qq_com_pid = PidUtil.get_qq_com_pid_call(cmsForm, cmsForm.appBean.member_id); string weiba = UrlUtil.parseContent_kouling(cmsForm, contentItem, PidUtil.get_qq_com_pid_call(cmsForm, cmsForm.appBean.member_id), true); if (!string.IsNullOrEmpty(weiba)) { content = content + weiba; } string out_log; QqUtil.copy_content(cmsForm, content, out out_log); if (cmsForm.checkBox_tools_qingkong.Checked) { ((IHTMLDocument2)cmsForm.webBrowser_zhuanhua.Document.DomDocument).body.innerHTML = ""; } LogUtil.log_call(cmsForm, "转换拷贝完成!"); } catch (Exception exception) { //MessageBox.Show("[messageForThread]出错:" + exception.ToString()); } }
public static void login(CmsForm cmsForm, int zoneId) { bool flag = (cmsForm.checkBoxAutoLogin.Checked && !cmsForm.textBoxAlimamaAcc.Text.Trim().Equals("")) && !cmsForm.textBoxAlimamaPwd.Text.Trim().Equals(""); bool alimama_scanLogin = cmsForm.checkBoxAutoLogin.Checked; AlimamaLogin.login(cmsForm, alimama_scanLogin, flag); }
public static ArrayList query_order(CmsForm cmsForm, string cookie, int queryType) { ArrayList arrayLists = new ArrayList(); try { int days = 2; days = cmsForm.appBean.ali_order_days; string startTime = DateTime.Now.AddDays(-days).ToString("yyyy-MM-dd"); string endTime = DateTime.Now.ToString("yyyy-MM-dd"); DateTime now = DateTime.Now; string str = string.Concat("temp", now.ToString("yyyyMMddHHmmss"), ".xls"); string str1 = string.Concat(cmsForm.app_path, "\\config\\", str); if (File.Exists(str1)) { File.Delete(str1); } int type = 1; string str2 = "http://pub.alimama.com/report/getTbkPaymentDetails.json?queryType=1&payStatus=&DownloadID=DOWNLOAD_REPORT_INCOME_NEW&startTime={startTime}&endTime={endTime}"; if (queryType == 1) { str2 = "http://pub.alimama.com/report/getTbkPaymentDetails.json?queryType=3&payStatus=3&DownloadID=DOWNLOAD_REPORT_INCOME_NEW&startTime={startTime}&endTime={endTime}"; } if (queryType == 2) { << << << < HEAD type = 0;
public static bool submit_taoke_item_plan(CmsForm cmsForm, TaokeItem taokeItem) { HttpService httpservice = cmsForm.httpService; //long user_id = cmsForm.appBean.user_id; //string app_id = cmsForm.appBean.cms_app_id; //String user_key = cmsForm.appBean.user_token; //String user_name = cmsForm.appBean.user_name; //String user_taoke_create_url_plan = Constants.user_taoke_create_url_plan; //string datastr = String.Concat( // "user_id=" + user_id // , "&member_token=" + user_key // , "&app_id=" + app_id // , "&num_iid=" + taokeItem.num_iid // , "&pid=" + taokeItem.pid // , "&url=" + taokeItem.short_url // , "&tao_token=" + taokeItem.tao_token // , "&market_create_date=" + taokeItem.couponEffectiveStartTime // , "&market_end_date=" + taokeItem.couponEffectiveEndTime //); ////LogUtil.log_cms_call(cmsForm, datastr); //String body = httpservice.post_http(user_taoke_create_url_plan, datastr, null); ////CmsUtil.add_queue_taoke_plan_url(cmsForm, taokeItem); return(true); }
public static bool submit_taoke_items(CmsForm cmsForm, ArrayList items) { HttpService httpservice = cmsForm.httpService; long user_id = cmsForm.appBean.user_id; string app_id = cmsForm.appBean.cms_app_id; String user_key = cmsForm.appBean.user_token; String user_name = cmsForm.appBean.user_name; //String user_taoke_create_url = Constants.user_taoke_create_url; //string datastr = String.Concat( // "user_id=" + user_id // , "&member_token=" + user_key // , "&app_id=" + app_id //); // for (int i = 0; i < items.Count; i++) //{ // AlimamaClick item = (AlimamaClick)items[i]; // datastr = String.Concat( // datastr // , "&num_iid[]=" + item.num_iid // , "&url[]=" + item.url // , "&coupon_url[]=" + item.coupon_url // , "&short_url[]=" + item.short_url // , "&tao_token[]=" + item.tao_token // , "&coupon_link_tao_token[]=" + item.coupon_link_tao_token // ); //} // //LogUtil.log_cms_call(cmsForm, datastr); //String body = httpservice.post_http(user_taoke_create_url, datastr, null); ////LogUtil.log_cms_call(cmsForm, body); return(true); }
public static bool submit_taoke_item(CmsForm cmsForm, AlimamaClick alimamaClick) { HttpService httpservice = cmsForm.httpService; long user_id = cmsForm.appBean.user_id; string app_id = cmsForm.appBean.cms_app_id; String user_key = cmsForm.appBean.user_key; String user_name = cmsForm.appBean.user_name; String user_taoke_create_url = Constants.user_taoke_create_url; string datastr = String.Concat( "user_id=" + user_id , "&user_key=" + user_key , "&user_token=" , "&app_id=" + app_id , "&num_iid=" + alimamaClick.num_iid , "&url=" + alimamaClick.url , "&coupon_url=" + alimamaClick.coupon_url , "&short_url=" + alimamaClick.short_url , "&tao_token=" + alimamaClick.tao_token , "&coupon_link_tao_token=" + alimamaClick.coupon_link_tao_token ); //LogUtil.log_str(cmsForm, datastr); String body = httpservice.post_http(user_taoke_create_url, datastr, null); return(true); }
public static string query_click_url(CmsForm cmsForm , string pid, string id, string url) { HttpService httpservice = cmsForm.httpService; //long user_id = cmsForm.appBean.user_id; //string app_id = cmsForm.appBean.cms_app_id; //String user_key = cmsForm.appBean.user_token; //String user_name = cmsForm.appBean.user_name; //String click_url = Constants.user_goods_click_url; //String body = httpservice.post_http(click_url // , "user_id=" + user_id // + "&app_id=" + app_id // + "&member_token=" + user_key // + "&pid=" + pid // + "&id=" + id // + "&url=" + System.Web.HttpUtility.UrlEncode(url, System.Text.Encoding.Unicode) // , null); //if (body.Contains("<content>")) //{ // string content = StringUtil.subString(body, 0, "<content>", "</content>"); // return content; //} return(""); }
public static ArrayList query_cms_list(CmsForm cmsForm) { HttpService httpservice = cmsForm.httpService; long user_id = cmsForm.appBean.user_id; //String user_key = cmsForm.appBean.user_token; //String user_name = cmsForm.appBean.user_name; //String cms_url = Constants.cms_url; //String body = httpservice.post_http(cms_url, "user_id=" + user_id + "&user_name=" + user_name + "&member_token=" + user_key, null); ////LogUtil.log_call(cmsForm, "query_cms_list:" + body); //UnicodeEncoding unicodeEncoding = new UnicodeEncoding(); ArrayList list = new ArrayList(); //for (int i = body.IndexOf("items"); (i = body.IndexOf("\"app_id\"",i)) != -1; i++) //{ // UserCms userCms = new UserCms(); // userCms.app_id = StringUtil.subString(body, i, "\"app_id\":\"", "\""); // userCms.user_id = StringUtil.subString(body, i, "\"user_id\":\"", "\""); // String cms_title = StringUtil.subString(body, i, "\"title\":\"", "\""); // cms_title = UnicodeUtil.Unicode2String(cms_title); // userCms.title = cms_title; // list.Add(userCms); //} return(list); }
public static string query_ali_api_url(CmsForm cmsForm , string num_iid, string pid, string activity_id) { HttpService httpservice = cmsForm.httpService; long user_id = cmsForm.appBean.user_id; string app_id = cmsForm.appBean.cms_app_id; String user_key = cmsForm.appBean.user_key; String user_name = cmsForm.appBean.user_name; String click_url = Constants.goods_api_url; String body = httpservice.post_http(click_url , "user_id=" + user_id + "&app_id=" + app_id + "&user_key=" + user_key + "&user_token=" + "&num_iid=" + num_iid + "&pid=" + pid + "&activity_id=" + activity_id , null); if (body.Contains("<content>")) { string content = StringUtil.subString(body, 0, "<content>", "</content>"); return(content); } return(""); }
public static CouponStatusBean query_coupon_status(CmsForm cmsForm) { CouponStatusBean couponStatusBean = new CouponStatusBean(); try { HttpService httpservice = cmsForm.httpService; long user_id = cmsForm.appBean.user_id; string app_id = cmsForm.appBean.cms_app_id; String user_key = cmsForm.appBean.user_key; String user_name = cmsForm.appBean.user_name; String user_coupon_status_url = Constants.user_coupon_status_url; String body = httpservice.post_http(user_coupon_status_url, "user_id=" + user_id + "&app_id=" + app_id + "&user_key=" + user_key + "&user_token=", null); //LogUtil.log_cms_call(cmsForm, "user_coupon_status_url:" + body); if (!string.IsNullOrEmpty(body)) { //couponStatusBean.app_id = app_id; //couponStatusBean.user_id = "" + user_id; JsonData jo = JsonMapper.ToObject(body.Trim()); couponStatusBean.activity_id = (String)jo["result"]["map"]["item"]["activity_id"]; couponStatusBean.user_num_id = (String)jo["result"]["map"]["item"]["user_num_id"]; couponStatusBean.num_iid = (String)jo["result"]["map"]["item"]["num_iid"]; couponStatusBean.times = (int)jo["result"]["map"]["times"]; } } catch (Exception exception) { //LogUtil.log_call(cmsForm, "" + exception.ToString()); } return(couponStatusBean); }
public static ContentItem parseContent(CmsForm cmsForm, string content, string qun_pid, bool zhuan_pid_boolean, bool apply_jihua, int url_type) { ContentItem contentItem = new ContentItem(); contentItem.content = content; contentItem.memo = TaobaoUtil.toText(content); ArrayList urlList = UrlHptUtil.parseContentUrlList(contentItem, cmsForm, content, qun_pid, zhuan_pid_boolean, apply_jihua, url_type); contentItem.urlList = urlList; if (urlList != null) { string content_send = content; if (zhuan_pid_boolean) { try { foreach (UrlItem urlItem in urlList) { if (!string.IsNullOrEmpty(urlItem.ori_url) && !string.IsNullOrEmpty(urlItem.click_url)) { content_send = content_send.Replace(urlItem.ori_url, urlItem.click_url); } } } catch (Exception exception) { } } contentItem.content_send = content_send; } return(contentItem); }
public static string query_click_url(CmsForm cmsForm , string pid, string id, string url) { HttpService httpservice = cmsForm.httpService; long user_id = cmsForm.appBean.user_id; string app_id = cmsForm.appBean.cms_app_id; String user_key = cmsForm.appBean.user_key; String user_name = cmsForm.appBean.user_name; String click_url = Constants.user_goods_click_url; String body = httpservice.post_http(click_url , "user_id=" + user_id + "&app_id=" + app_id + "&user_key=" + user_key + "&pid=" + pid + "&id=" + id + "&user_token=" + "&url=" + System.Web.HttpUtility.UrlEncode(url, System.Text.Encoding.Unicode) , null); //LogUtil.log_call(cmsForm, "query_click_url——啊啊啊:" + "user_id=" + user_id // + "&app_id=" + app_id // + "&user_key=" + user_key // + "&pid=" + pid // + "&id=" + id // + "&user_token=" // + "&url=" + System.Web.HttpUtility.UrlEncode(url, System.Text.Encoding.Unicode)); //LogUtil.log_call(cmsForm, "query_click_url:" + body); if (body.Contains("<content>")) { string content = StringUtil.subString(body, 0, "<content>", "</content>"); return(content); } return(""); }
public static void send_houtai(CmsForm cmsForm, string content, string content_img, ArrayList imgList) { LogUtil.log_call(cmsForm, "开始微信后台发送商品!"); content = content.Replace("<BR>", "\n"); int count = 0; if (imgList != null && imgList.Count > 0) { count = imgList.Count; } JsonData jd = new JsonData(); jd["content"] = content; jd["imgs"] = new JsonData();//**新添加一层关系时,需要再次 new** JsonData() jd["imgs"]["count"] = "" + count; if (imgList != null && imgList.Count > 0) { jd["imgs"]["items"] = new JsonData(); foreach (string key in imgList) { JsonData jd_item = new JsonData(); jd_item["url"] = key; jd["imgs"]["items"].Add(jd_item); } } string content_json = JsonMapper.ToJson(jd); //LogUtil.log_call(cmsForm, "content_json:" + content_json); WeixinUtil.sendForm(cmsForm, content_json); }
public static UserCmsTongji query_user_cms_tongji(CmsForm cmsForm, out string out_log) { try { HttpService httpservice = cmsForm.httpService; long user_id = cmsForm.appBean.user_id; //string app_id = cmsForm.appBean.cms_app_id; //String user_key = cmsForm.appBean.user_token; //String user_name = cmsForm.appBean.user_name; //String cms_tongji_url = Constants.cms_tongji_url; //String body = httpservice.post_http(cms_tongji_url, "user_id=" + user_id + "&app_id=" + app_id + "&member_token=" + user_key, null); ////LogUtil.log_cms_call(cmsForm, "body:" + body); //if (body.Contains("\"all\":")) //{ // UserCmsTongji userCmsTongji = new UserCmsTongji(); // userCmsTongji.all = int.Parse(StringUtil.subString(body, 0, "\"all\":\"", "\",")); // userCmsTongji.have = int.Parse(StringUtil.subString(body, 0, "\"have\":\"", "\"")); // out_log = ""; // return userCmsTongji; //} //out_log = body; out_log = ""; return(null); } catch (Exception exception) { //LogUtil.log_cms_call(cmsForm, "query_goods:" + "出错啦!!!" + exception.ToString()); out_log = "出错啦!!!" + exception.ToString(); return(null); } }
public static void load(CmsForm cmsForm) { try { string out_log = ""; ArrayList follow_list = cmsForm.sendSqlUtil.query_send(0, out out_log); cmsForm.dataGridViewFollowSnd.Rows.Clear(); if (follow_list != null && follow_list.Count > 0) { int i = 0; foreach (SendItem sendItem in follow_list) { DataGridViewRow dataGridViewRow = new DataGridViewRow(); cmsForm.dataGridViewFollowSnd.Rows.Add(dataGridViewRow); cmsForm.dataGridViewFollowSnd.Rows[i].HeaderCell.Value = string.Concat(i + 1, ""); cmsForm.dataGridViewFollowSnd[0, i].Value = sendItem.create_date_str; cmsForm.dataGridViewFollowSnd[1, i].Value = sendItem.from; cmsForm.dataGridViewFollowSnd[2, i].Value = sendItem.memo; cmsForm.dataGridViewFollowSnd[3, i].Value = (sendItem.status == 0 ? "未发送" : "已发送"); //LogUtil.log_call(this, "sendItem.create_date:" + sendItem.create_date); //this.dataGridViewFollowSnd[2, string0].Value = GClass13.smethod_15(arrayList26.string_2); //this.dataGridViewFollowSnd[2, string0].Style.ForeColor = GClass13.smethod_16(arrayList26.string_2); cmsForm.dataGridViewFollowSnd[0, i].Tag = sendItem; i++; } } } catch { } }
public static void set_formWindowState(CmsForm cmsForm, FormWindowState formWindowState) { try { if (cmsForm.InvokeRequired) { formWindowState method = new formWindowState(FormUtil.set_formWindowState); cmsForm.BeginInvoke(method, new object[] { cmsForm, formWindowState }); } else { //cmsForm.WindowState = formWindowState; if (formWindowState == FormWindowState.Normal) { cmsForm.Activate(); cmsForm.Show(); } else if (formWindowState == FormWindowState.Minimized) { cmsForm.Hide(); } } } catch (Exception exception) { LogUtil.log_call(cmsForm, "[SetFormState]出错," + exception.ToString()); } }
public static AlimamaQueryBean get_img_url(CmsForm cmsForm, string url, string cookie, out string sessionid) { sessionid = ""; AlimamaQueryBean alimamaQueryBean = null; try { WebClient client = new WebClient(); client.Headers.Clear(); client.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01"); client.Headers.Add("X-Requested-With", "XMLHttpRequest"); client.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36"); client.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); client.Headers.Add("Referer", "http://pub.alimama.com/promo/search/index.htm"); client.Headers.Add("Accept-Encoding", "gzip,deflate,sdch"); client.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8"); client.Headers.Add("Cookie", cookie); string str4 = ""; byte[] buffer = client.DownloadData(url); string str5 = client.ResponseHeaders["Content-Encoding"]; if ("gzip".Equals(str5)) { str4 = GzipUtil.zip_to_string(buffer, Encoding.UTF8); } else { str4 = Encoding.UTF8.GetString(buffer); } if (str4.Contains("sessionid: '")) { alimamaQueryBean = new AlimamaQueryBean(); sessionid = StringUtil.subString(str4, 0, "sessionid: '", "'"); if (!string.IsNullOrEmpty(sessionid)) { alimamaQueryBean.sessionid = sessionid; alimamaQueryBean.img_url = "http://pin.aliyun.com/get_img?identity=sm-union-pub&sessionid=" + sessionid + "&type=number&t=1497692646342"; alimamaQueryBean.action = StringUtil.subString(str4, 0, "action: '", "'"); alimamaQueryBean.event_submit_do_unique = StringUtil.subString(str4, 0, "event_submit_do_unique: '", "'"); alimamaQueryBean.smPolicy = StringUtil.subString(str4, 0, "smPolicy: '", "'"); alimamaQueryBean.smApp = StringUtil.subString(str4, 0, "smApp: '", "'"); alimamaQueryBean.smReturn = StringUtil.subString(str4, 0, "smReturn: '", "'"); alimamaQueryBean.smCharset = StringUtil.subString(str4, 0, "smCharset: '", "'"); alimamaQueryBean.smTag = StringUtil.subString(str4, 0, "smTag: '", "'"); alimamaQueryBean.captcha = StringUtil.subString(str4, 0, "captcha: '", "'"); alimamaQueryBean.smSign = StringUtil.subString(str4, 0, "smSign: '", "'"); alimamaQueryBean.identity = StringUtil.subString(str4, 0, "identity: '", "'"); return(alimamaQueryBean); } } return(null); } catch (Exception exception) { return(null); } }
public static ShareItem query_share(CmsForm cmsForm, string num_iid, String pid) { try { HttpService httpservice = cmsForm.httpService; long user_id = cmsForm.appBean.user_id; String user_key = cmsForm.appBean.user_token; String user_name = cmsForm.appBean.user_name; String user_goods_url = "http://" + Constants.api_url + "/zhushou/goods/share"; String body = httpservice.post_http(user_goods_url, "user_id=" + user_id + "&num_iid=" + num_iid + "&pid=" + pid + "&member_token=" + user_key, null); //LogUtil.log_cms_call(cmsForm, "body:" + body); body = body.Trim(); ShareItem shareItem = new ShareItem(); JsonData jo = JsonMapper.ToObject(body); if (jo["data"] != null && jo["data"]["share"] != null) { shareItem.title = jo["data"]["share"]["title"].ToString(); try { shareItem.tao_token = jo["data"]["share"]["tao_token"].ToString(); } catch (Exception) { } try { shareItem.coupon_money = double.Parse(jo["data"]["share"]["coupon_money"].ToString()); } catch (Exception) { } try { shareItem.short_url = jo["data"]["share"]["short_url"].ToString(); } catch (Exception) { } try { shareItem.uland_url = jo["data"]["share"]["taoke_url"].ToString(); } catch (Exception) { } try { shareItem.price = double.Parse(jo["data"]["share"]["price"].ToString()); } catch (Exception) { } try { shareItem.user_type_name = jo["data"]["share"]["user_type_name"].ToString(); } catch (Exception) { } } return(shareItem); } catch (Exception exception) { //LogUtil.log_call(cmsForm, "---------------35555-----------"+exception.ToString()); return(null); } }
public ILookup <string, CmsPageContent> GetClientSideWidgetLookup(CmsForm form) { var clientSide = GetClientSideWidets(form); return(clientSide .Where(x => x.Parameters.ContainsKey(nameof(BlazorToolboxItem.PropertyName))) .ToLookup(x => x.Parameters[nameof(BlazorToolboxItem.PropertyName)])); }
public static UserCmsBean query_taoke_item_list_html_online(CmsForm cmsForm) { UserCmsBean userCmsBean = new UserCmsBean(); try { HttpService httpservice = cmsForm.httpService; long user_id = cmsForm.appBean.user_id; string app_id = cmsForm.appBean.cms_app_id; String user_key = cmsForm.appBean.user_token; String user_name = cmsForm.appBean.user_name; String user_taoke_url = "http://" + Constants.api_url + "/" + app_id + "_.html"; //LogUtil.log_str(cmsForm, "user_id=" + user_id + "&app_id=" + app_id + "&member_token=" + user_key ); String body = httpservice.get(user_taoke_url, null); //LogUtil.log_cms_call(cmsForm, "query_taoke_item_list:" + body); string code = StringUtil.subString(body, 0, "<data>", "</data>"); //LogUtil.log_cms_call(cmsForm, "code:" + code); if (!string.IsNullOrEmpty(code)) { userCmsBean.app_id = app_id; userCmsBean.user_id = "" + user_id; ArrayList itemList = new ArrayList(); JsonData jo = JsonMapper.ToObject(code); //string app_id = (String)jo["app_id"]; //string user_id = (String)jo["user_id"]; JsonData itemsList = jo["items_pid"]; for (int i = 0; i < itemsList.Count; i++) { //JsonData jo_item = (String)itemsList[i]; JsonData jo_item = itemsList[i]; string num_iid = (string)jo_item["num_iid"]; string pid = (string)jo_item["pid"]; CmsPlanItem cmsPlanItem = new CmsPlanItem(); cmsPlanItem.num_iid = num_iid; cmsPlanItem.pid = pid; string out_log; ArrayList arrayList = cmsForm.sendSqlUtil.query_cms_item_plan(cmsPlanItem.num_iid + cmsPlanItem.pid, 6, out out_log); if (arrayList.Count <= 0) { //itemList.Add(jo_item.ToString()); itemList.Add(cmsPlanItem); } //LogUtil.log_cms_call(cmsForm, "jo_item:" + jo_item); } userCmsBean.items = itemList; } } catch (Exception) { } cmsForm.appBean.userCmsBean_user = userCmsBean; return(userCmsBean); }