public static void SendConsume(string openid, string first, string name, string num, string addtime, string remark, string hotelcode) { var paramData = new { first = new { value = "您好票券核销成功", color = "#173177", }, keyword1 = new { value = name, color = "#173177", }, keyword2 = new { value = "1", color = "#173177", }, keyword3 = new { value = addtime, color = "#173177", }, reamrk = new { value = "期待您的下次光临!", color = "#173177", }, }; var json = JsonConvert.SerializeObject(paramData); var TemplateData = "hotelcode=" + hotelcode + "&openid=" + openid + "¶m=" + json + "&templateName=consume"; var result = HttpHepler.SendPost(Config.SendTemplateUrl, TemplateData); }
protected void Page_Load(object sender, EventArgs e) { Dictionary <string, string> p = new Dictionary <string, string>(); p.Add("v", "3.0"); p.Add("hotelGroupCode", "YMJDJTG"); p.Add("usercode", "wubiaoteng"); p.Add("method", "user.login"); p.Add("local", "zh_CN"); p.Add("format", "json"); p.Add("password", "r3qt8fY5fHj9s"); p.Add("appKey", "10029"); var sign = DESEncrypt.getSign(p, "5a993a1588a30b48e476bab058c34e22"); p.Add("sign", sign); var post = ""; foreach (var item in p) { post += item.Key + "=" + item.Value + "&"; } Response.Write(post); // post = post.Substring(0, post.Length - 1); var lvresult = HttpHepler.SendPost("http://115.159.81.168:8100/ipmsgroup/router", post); //var SessionId = JsonConvert.DeserializeObject<SessionIdJson>(lvresult).resultInfo; }
/// <summary> /// 查询微信订单号 /// </summary> /// <param name="hotelcode"></param> /// <param name="trade_no"></param> /// <param name="notify"></param> /// <param name="url"></param> /// <returns></returns> public static QueryTradeNoModel QueryTradeNo(string hotelcode, string trade_no, string notify, string url) { var obj = new QueryTradeNoModel(); try { if (trade_no != "") { var postData = "hotelcode=" + hotelcode + "&trade_no=" + trade_no + "&Notify=" + notify; var result = HttpHepler.SendPost(url, postData); //var obj = JsonConvert.DeserializeObject<QueryTradeNoModel>(result) var transaction_id = JsonHelper.GetJsonValue(result, "transaction_id"); if (transaction_id != "") { obj.transaction_id = transaction_id; obj.code = StatusCode.成功; obj.msg = "成功"; } return(obj); } obj.code = StatusCode.参数不全; return(obj); } catch (Exception ex) { obj.msg = ex.ToString(); obj.code = StatusCode.序异常; return(obj); } }
public static void SendWx(string hotelcode, string channelCode, string system, string ex, string method) { var paramData = new { first = new { value = "有一条新的bug,嘻嘻", color = "#173177", }, keyword1 = new { value = system + Environment.MachineName, color = "#173177", }, keyword2 = new { value = DateTime.Now.ToString("yyyy-MM-dd"), color = "#173177", }, keyword3 = new { value = ex, color = "#173177", }, reamrk = new { value = ex, color = "#173177", }, }; var json = JsonConvert.SerializeObject(paramData); var TemplateData = "hotelcode=KSHZ&openid=oypMdv1H5RuTAQafJzjQ6SJ4glpw¶m=" + json + "&templateName=Exception"; var result = HttpHepler.SendPost(Config.SendTemplateUrl, TemplateData); }
public lytest(string url, string hotelcode) { //var postData = "hotelcode=" + hotelcode; //var result = HttpHepler.SendPost(URL, postData); // info = JsonConvert.DeserializeObject<HotelInfoJson>(result); Dictionary <string, string> p = new Dictionary <string, string>(); p.Add("v", "3.0"); p.Add("hotelGroupCode", "GCBZG"); p.Add("usercode", "gcbzg0"); p.Add("method", "user.login"); p.Add("local", "zh_CN"); p.Add("format", "json"); p.Add("password", "89kjanJD1k02b"); p.Add("appKey", "10003"); var sign = DESEncrypt.getSign(p, APPSECRET); p.Add("sign", sign); var post = ""; foreach (var item in p) { post += item.Key + "=" + item.Value + "&"; } post = post.Substring(0, post.Length - 1); var lvresult = HttpHepler.SendPost(url, post); SessionId = JsonConvert.DeserializeObject <SessionIdJson>(lvresult).resultInfo; }
public ly(string url, string hotelcode) { var postData = "hotelcode=" + hotelcode; var result = HttpHepler.SendPost(URL, postData); info = JsonConvert.DeserializeObject <HotelInfoJson>(result); Dictionary <string, string> p = new Dictionary <string, string>(); p.Add("v", "3.0"); p.Add("hotelGroupCode", info.data.FirstOrDefault().LvyunHotelDm); p.Add("usercode", "wubiaoteng"); p.Add("method", "user.login"); p.Add("local", "zh_CN"); p.Add("format", "json"); p.Add("password", "r3qt8fY5fHj9s"); p.Add("appKey", "10029"); var sign = DESEncrypt.getSign(p, "5a993a1588a30b48e476bab058c34e22"); p.Add("sign", sign); var post = ""; foreach (var item in p) { post += item.Key + "=" + item.Value + "&"; } post = post.Substring(0, post.Length - 1); var lvresult = HttpHepler.SendPost(url, post); SessionId = JsonConvert.DeserializeObject <SessionIdJson>(lvresult).resultInfo; }
/// <summary> /// 获取管理员列表 /// </summary> /// <param name="hotelcode"></param> /// <param name="type"></param> /// <param name="action"></param> /// <returns></returns> private static GetServiceListModel GetServiceList(string hotelcode, string type, string action) { var postData = "hotelcode=" + hotelcode + "&type=" + type; var result = HttpHepler.SendPost(Config.BookingUrl + "?action=" + action, postData); var list = JsonConvert.DeserializeObject <GetServiceListModel>(result); return(list); }
protected void Page_Load(object sender, EventArgs e) { { var postData = "hotelcode=KSHZ"; var result = HttpHepler.SendPost(URL, postData); Response.Write(result); } }
public string GetRoomsByDate(string date, string hotelcode) { var url = "https://interface.hanibabyppo.com/Booking/API/Reserve.ashx?action=GetRoomsByDate"; var postData = "hotelcode=" + hotelcode + "&date=" + date + "&type=0"; var result = HttpHepler.SendPost(Config.BookingUrl + "?action=GetRoomsByDate", postData); var obj = JsonConvert.DeserializeObject <GetRoomsByDateResult>(result); return(JsonConvert.SerializeObject(obj)); }
public string GetRateCodexzByRoomtype(string roomtype, string starttime, string endtime, string hotelcode) { var url = "https://interface.hanibabyppo.com/Booking/API/Reserve.ashx?action=GetRateCodexzByRoomtype"; var postData = "hotelcode=" + hotelcode + "&starttime=" + starttime + "&roomtype=" + roomtype + "&endtime=" + endtime + "&type=0"; var result = HttpHepler.SendPost(Config.BookingUrl + "?action=GetRateCodexzByRoomtype", postData); if (result != "ERROR_404") { // var obj = JsonConvert.DeserializeObject<> } return(HttpHepler.SendPost(url, postData)); }
public string Cancel(Dictionary <string, string> parms, string url) { parms.Add("hotelGroupId", info.data.FirstOrDefault().LvyunHotelgroupId); parms.Add("sessionid", SessionId); parms.Add("appKey", "10029"); var sign = DESEncrypt.getSign(parms, APPSECRET); parms.Add("sign", sign); var post = ""; foreach (var item in parms) { post += item.Key + "=" + item.Value + "&"; } return(HttpHepler.SendPost(info.data.FirstOrDefault().orderUrl + "ipmsgroup/CRS/cancelbook", post)); }
/// <summary> /// 商城购买成功 /// </summary> /// <param name="shopname"></param> /// <param name="total"></param> /// <param name="tel"></param> /// <param name="payway"></param> /// <param name="hotelcode"></param> /// <param name="guestname"></param> /// <param name="Template"></param> /// <param name="first"></param> public static void SendTempPaySuccess(string shopname, string total, string tel, string payway, string hotelcode, string guestname, string Template, string first) { string TemplateData = ""; var paramData = new { first = new { value = first, color = "#173177", }, keyword1 = new { value = shopname, color = "#173177", }, keyword2 = new { value = total, color = "#173177", }, keyword3 = new { value = DateTime.Now.ToString("yyyy-MM-dd"), color = "#173177", }, remark = new { value = "如有疑问请及时联系我们:" + tel, color = "#173177", }, }; var json = JsonConvert.SerializeObject(paramData); TemplateData = "hotelcode=" + hotelcode + "&openid=" + guestname + "¶m=" + json + "&templateName=PaySuccess"; if (hotelcode != "YLHCSD" && hotelcode != "JINLANJIA") { HttpHepler.SendPost(Config.SendTemplateUrl, TemplateData); } else { CommonApi.SendMsg("", "GMCG", "", hotelcode); } }
/// <summary> /// 发送核销 /// </summary> /// <param name="hotelcode"></param> /// <param name="openid"></param> /// <param name="ticketname"></param> /// <param name="num"></param> public static string SendTemplateMsg(string hotelcode, string openid, string ticketname, string num) { try { var paramData = new { first = new { value = "你好,优惠券核销成功", color = "#173177", }, keyword1 = new { value = ticketname, color = "#173177", }, keyword2 = new { value = num, color = "#173177", }, keyword3 = new { value = DateTime.Now.ToString("yyyy-MM-dd"), color = "#173177", }, reamrk = new { value = "", color = "#173177", }, }; var postJson = JsonConvert.SerializeObject(paramData); var postData = "hotelcode=" + hotelcode + "&openid=" + openid + "¶m=" + postJson + "&templateName=consume"; var result = HttpHepler.SendPost(Config.SendTemplateUrl, postData); return(result); } catch (Exception ex) { return("false"); } }
public string xiadan(Dictionary <string, string> parms, string url) { parms.Add("hotelGroupId", info.data.FirstOrDefault().LvyunHotelgroupId); parms.Add("hotelId", info.data.FirstOrDefault().LvyunHotelId); parms.Add("sessionid", SessionId); parms.Add("appKey", "10029"); parms.Add("rsvType", "010"); var sign = DESEncrypt.getSign(parms, APPSECRET); parms.Add("sign", sign); var post = ""; foreach (var item in parms) { post += item.Key + "=" + item.Value + "&"; } //return post; return(HttpHepler.SendPost(url, post)); }
public string GetOrderInfo(Dictionary <string, string> parms, string url) { parms.Add("sessionid", SessionId); parms.Add("v", ""); parms.Add("n", ""); parms.Add("f", "800"); parms.Add("q", ",,XYGMS,W1709120025"); parms.Add("s", ""); parms.Add("c", "c"); var sign = DESEncrypt.getSign(parms, APPSECRET); parms.Add("sign", sign); var post = ""; foreach (var item in parms) { post += item.Key + "=" + item.Value + "&"; } return(HttpHepler.SendPost(url, post)); }
//绑定openid //public static CheckOpenidResult Checkopenidandcardbyhotelcode_new_source(string openid, string mobile, string type, string hotelcode, string name, string source) //{ // var result = myservice.Checkopenidandcardbyhotelcode_new_source(openid, mobile, type, hotelcode, name, source); // result = CommonFunction.Replacebracket(result); // var obj = JsonConvert.DeserializeObject<List<CheckOpenidResult>>(result)[0]; // return obj; //} public static void SendXf(string openid, string productType, string name, string accountType, string account, string time, string remark, string hotelcode) { var paramData = new { productType = new { value = productType, color = "#1C1C1C", }, name = new { value = name, color = "#1C1C1C", }, accountType = new { value = accountType, color = "#1C1C1C", }, account = new { value = account, color = "#1C1C1C", }, time = new { value = time, color = "#1C1C1C", }, remark = new { value = remark, color = "#1C1C1C", } }; var json = JsonConvert.SerializeObject(paramData); var TemplateData = "hotelcode=" + hotelcode + "&openid=" + openid + "¶m=" + json + "&templateName=xiaofei"; var result = HttpHepler.SendPost(Config.SendTemplateUrl, TemplateData); }
protected void Page_Load(object sender, EventArgs e) { var res = new net.kuaishun.ticketmk.Service(); var s = res.Getmember_bymobile_json("", "", "15", "18989841642"); var paramData = new { first = new { value = "ceshi", color = "#173177", }, keyword1 = new { value = "ceshi", color = "#173177", }, keyword2 = new { value = "ceshi", color = "#173177", }, keyword3 = new { value = DateTime.Now.ToString("yyyy-MM-dd"), color = "#173177", }, reamrk = new { value = "如有疑问请及时联系我们:", color = "#173177", }, }; var json = JsonConvert.SerializeObject(paramData); var a = "hotelcode=HZKYJD&openid=oCVOQjvJtjbRR2nQ4o-8Gw1Z3OcI¶m=" + json + "&templateName=PaySuccess"; var r = HttpHepler.SendPost("https://ks.kuaishun.net/WxAPI/API/Template/SendTemplateMsg.ashx", a); }
public static List <RateXzByRmType> GetRateCodexzByRoomtype(yudingEntities db, string starttimeStr, string endtimeStr, string roomtype, string hotelcode, int type) { db = new yudingEntities(); var time = DateTime.Parse(starttimeStr); var week = (int)time.DayOfWeek; var end = DateTimeHelper.GetTimeStamp(DateTime.Parse(endtimeStr)); var XzList = db.GetRcListByRoomType(roomtype, hotelcode, DateTime.Parse(starttimeStr)).ToList().GroupBy(x => x.xz_code).OrderByDescending(x => x.FirstOrDefault().px); var yuanjia = db.newroom_t.Where(x => x.roomtype == roomtype).FirstOrDefault(); var list = new List <RateXzByRmType>(); var d = db.ratecode_t.Where(x => x.hotelid == hotelcode && x.scenario == 1 && x.flag == 0 && x.type == type).FirstOrDefault().ratecode; string URL = Config.WxAPIUrl + "/API/GetWX.ashx?action=GetGZHxx"; var postData = "hotelcode=" + hotelcode; var result = HttpHepler.SendPost(URL, postData); HotelInfoJson info = JsonConvert.DeserializeObject <HotelInfoJson>(result); var data = info.data[0]; GetRoomAvailResult room = null; if (info.data[0].LvyunHotelgroupId != "" && info.data[0].LvyunHotelgroupId != null) { //var data = info.data[0]; room = PmsAPI.GetRoomAvail(data.orderUrl, data.LvyunHotelgroupId, data.LvyunHotelId, time.ToString("yyyy-MM-dd"), time.ToString("yyyy-MM-dd"), yuanjia.pms); } foreach (var item in XzList) { var xzcode = item.FirstOrDefault().xz_code; var rate = db.rateroom_xz.Where(x => x.xz_code == xzcode).FirstOrDefault(); var c = db.xztimestart_t.Where(x => x.startdate <= time && x.enddate >= time && x.xz_code == xzcode && x.flag == 0 && x.week == week.ToString()).FirstOrDefault(); //c.starttime // if (rate.ratecode == d && item.FirstOrDefault().price != 0) { if (c != null) { var m1 = c.starttime == "" ? "00:00" : c.starttime; var m2 = c.endtime == "" ? "23:59" : c.endtime; var t1 = DateTime.Parse(m1); var t2 = DateTime.Parse(m2); if (DateTime.Now >= t1 && DateTime.Now <= t2) { //if(DateTime.Now>=DateTime.Parse(c.starttime)&&DateTime.Now<=DateTime.Parse(c.endtime)) Nullable <int> sum = 0; foreach (var item1 in XzList) { sum += item1.FirstOrDefault().ordernum; } var price = db.everydate_price_t.Where(x => x.xz_code == xzcode && x.everydate == time).FirstOrDefault(); if (price != null) { var num = price.num; var ordernum = price.ordernum; var miaosha = db.miaosha_t.Where(x => x.xz_code == xzcode).FirstOrDefault(); var starttime = ""; var endtime = ""; if (miaosha != null) { starttime = DateTimeHelper.GetTimeStamp(DateTime.Parse(miaosha.starttime)).ToString(); endtime = DateTimeHelper.GetTimeStamp(DateTime.Parse(miaosha.endtime)).ToString(); } var ass = db.associateds.Where(x => x.xz_code == xzcode).FirstOrDefault(); var baojia = db.baojia_t.Where(x => x.xz_code == xzcode).FirstOrDefault(); var baojiaid = ""; if (baojia != null) { baojiaid = baojia.formulaid.ToString(); } object rules = null; object rulesname = null; if (ass != null) { if (ass.rules == "early") { var id = int.Parse(ass.codeid); rulesname = "early"; var early = db.earlies.Where(x => x.id == id).FirstOrDefault(); rules = early.code; } if (ass.rules == "live") { var id = int.Parse(ass.codeid); rulesname = "live"; var live = db.lives.Where(x => x.id == id).FirstOrDefault(); rules = live.code; } } var activty = db.activity_link.Where(x => x.xz_code == xzcode).FirstOrDefault(); var dis = ""; var aStarttime = ""; var aEndtime = ""; if (activty != null) { var act = db.Activities.Where(x => x.Code == activty.activitycode).FirstOrDefault(); if (act.starttime != null && act.endtime != null) { aStarttime = DateTimeHelper.GetTimeStamp(act.starttime).ToString(); aEndtime = DateTimeHelper.GetTimeStamp(act.endtime).ToString(); } dis = db.Activities.Where(x => x.Code == activty.activitycode).FirstOrDefault().discount; } var formula = db.price_formulaid.Where(x => x.xz_code == xzcode).ToList(); List <System.String> listS = new List <System.String>(); string str = ""; if (formula.Count > 0) { foreach (var item1 in formula) { listS.Add(item1.formulaid + ":" + item1.categoryid + ":" + item1.type); } listS.ToArray(); } str = string.Join(",", listS); Nullable <int> physicalnum = item.FirstOrDefault().pnum; var a = new RateXzByRmType { onsalecode = rate.onsalecode, chaifen = item.FirstOrDefault().chaifen.Value, xzcode = xzcode, islock = item.FirstOrDefault().islock, package = item.FirstOrDefault().package, payway = item.FirstOrDefault().payway, pay = item.FirstOrDefault().pay.ToString(), xzname = item.FirstOrDefault().xz_name, yuanjia = item.FirstOrDefault().yuanjia, ordersum = sum, ordernum = ordernum, pnum = physicalnum, num = num, baojia = baojiaid, price = item.FirstOrDefault().price, starttime = starttime, endtime = endtime, startdate = DateTimeHelper.GetTimeStamp(time).ToString(), enddate = end, rulesname = rulesname == null ? "" : rulesname, rules = rules == null ? "" : rules, activty = dis, formula = str, roomtype = roomtype, lvyunnum = room, activtyStarttime = aStarttime, activtyEndtime = aEndtime, }; list.Add(a); } } } } } return(list); //throw new NotImplementedException(); }
private void GetRoomList() { var postData = "hotelcode=KSHZ"; var result = HttpHepler.SendPost(URL, postData); }