/// <summary> /// 获取官方公告 /// </summary> public void GetNotice() { string res = HtmlEngine.CetHtml("http://www.lebi.cn/support/notice/index.html"); Response.Write(res); }
/// <summary> /// 返回快递100物流数据 /// </summary> /// <param name="to"></param> /// <returns></returns> public static KuaiDi100 GetKuaiDi100(Lebi_Transport_Order torder) { string json; KuaiDi100 log = new KuaiDi100(); BaseConfig conf = ShopCache.GetBaseConfig(); JavaScriptSerializer jss = new JavaScriptSerializer(); if (torder.Type_id_TransportOrderStatus == 223) { json = torder.Log; log = jss.Deserialize <KuaiDi100>(json); } else { try { string url = "http://www.kuaidi100.com/api?id=" + conf.KuaiDi100 + "&com=" + torder.Transport_Code + "&nu=" + torder.Code + "&show=0&muti=1"; json = HtmlEngine.CetHtml(url); log = jss.Deserialize <KuaiDi100>(json); switch (log.state) { case "1": torder.Type_id_TransportOrderStatus = 221; break; case "2": torder.Type_id_TransportOrderStatus = 222; break; case "3": torder.Type_id_TransportOrderStatus = 223; try { torder.Time_Received = Convert.ToDateTime(log.data.FirstOrDefault().time); } catch { torder.Time_Received = System.DateTime.Now; } break; case "4": torder.Type_id_TransportOrderStatus = 224; break; //default: // //torder.Type_id_TransportOrderStatus = 220; // break; } if (log.message != "ok") { //没有成功获取到json数据 url = "http://www.kuaidi100.com/applyurl?key=" + conf.KuaiDi100 + "&com=" + torder.Transport_Code + "&nu=" + torder.Code; string html = HtmlEngine.CetHtml(url); //html = HtmlEngine.CetHtml(html); torder.HtmlLog = html; } torder.Log = json; B_Lebi_Transport_Order.Update(torder); UpdateShouHuoCount(torder); } catch (Exception) { log = new KuaiDi100(); } } if (log == null) { log = new KuaiDi100(); } if (log.data == null) { log.data = new List <KuaiDi100.KuaiDi100data>(); } return(log); }
/// <summary> /// 解压部署文件 /// </summary> public void Version_FileUpdate() { if (!EX_Admin.Power("version", "版本管理")) { AjaxNoPower(); return; } int id = RequestTool.RequestInt("id"); int IsUpdated = RequestTool.RequestInt("IsUpdated", 0); Lebi_Version model = B_Lebi_Version.GetModel(id); if (model == null) { Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}"); return; } if (!Shop.LebiAPI.Service.Instanse.ISRightVersion(SYS, model)) { Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}"); return; } //if (IsUpdated == 0) //{ if (model.Path_rar != "") { //文件解包+部署文件 string nistring = HtmlEngine.ReadTxt("/config/noupdate.txt"); UpDate.DecompressFile(model.Path_rar, "/", nistring); //执行更新程序 try { string url = "http://" + HttpContext.Current.Request.Url.Authority + "/update/update.aspx"; string res = HtmlEngine.CetHtml(url); if (res.Contains("OK")) { string ServerPath = System.Web.HttpContext.Current.Server.MapPath("~/"); string fileUrl = ServerPath + "/update/update.aspx"; if (File.Exists(fileUrl)) { File.Delete(fileUrl); } //fileUrl = ServerPath + "/update.aspx.cs"; //if (File.Exists(fileUrl)) //{ // File.Delete(fileUrl); //} } } catch { } //执行sql string sqlfile = WebPath + "/update/update.sql"; if (LB.DataAccess.DB.BaseUtilsInstance.DBType == "access") { sqlfile = WebPath + "/update/update_access.sql"; } //string sql = HtmlEngine.ReadTxt(sqlfile); //if (sql != null) //{ // if (sql != "") // Common.ExecuteSql(sql); //} string fileName = HttpContext.Current.Server.MapPath(@"~/" + sqlfile); if (File.Exists(fileName)) { using (FileStream fs = new FileStream(fileName, FileMode.Open)) { using (StreamReader reader = new StreamReader(fs, Encoding.UTF8)) { string text = string.Empty; while (!reader.EndOfStream) { try { text = reader.ReadLine(); if (text != "") { Common.ExecuteSql(text); } } catch { } } } } } } //} //if (model.IsTypeUpdate == 1) //{ // //更新type表 // Thread thread = new Thread(new ThreadStart(Shop.LebiAPI.Service.Instanse.UpdateType)); // thread.IsBackground = true; // thread.Start(); //} //if (model.IsDBStructUpdate == 1) //{ // //更新数据库结构 // Thread thread = new Thread(new ThreadStart(Shop.LebiAPI.Service.Instanse.UpdateDBBody)); // thread.IsBackground = true; // thread.Start(); //} //if (model.IsSystemMenuUpdate == 1) //{ // //更新系统菜单 // Thread thread = new Thread(new ThreadStart(Shop.LebiAPI.Service.Instanse.UpdateMenu)); // thread.IsBackground = true; // thread.Start(); //} //if (model.IsThemePageUpdate == 1) //{ // //更新系统页面 // Thread thread = new Thread(new ThreadStart(Shop.LebiAPI.Service.Instanse.UpdateThemePage)); // thread.IsBackground = true; // thread.Start(); //} //if (model.IsNodeUpdate == 1) //{ // //更新系统结点 // Thread thread = new Thread(new ThreadStart(Shop.LebiAPI.Service.Instanse.UpdateNode)); // thread.IsBackground = true; // thread.Start(); //} //if (model.IsSystemPageUpdate == 1) //{ // //更新系统页面 // Thread thread = new Thread(new ThreadStart(SystemTheme.CreateSystemPage)); // thread.IsBackground = true; // thread.Start(); //} //if (model.IsPageUpdate == 1) //{ // //更新所有前台页面 // Thread thread = new Thread(new ThreadStart(Shop.Bussiness.Theme.CreateThemeALL)); // thread.IsBackground = true; // thread.Start(); //} //更新版本号 BaseConfig cf = new BaseConfig(); cf.Version_Son = model.Version_Son.ToString(); cf.Version = model.Version.ToString(); B_BaseConfig bcf = new B_BaseConfig(); bcf.SaveConfig(cf); model.IsUpdate = 1; model.Time_Update = System.DateTime.Now; B_Lebi_Version.Update(model); //同步版本号 Shop.LebiAPI.Service.Instanse.UpdateVersionCode(); Response.Write("{\"msg\":\"OK\"}"); }