You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.3 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TradeModel;
using TradeData;
using NetLibrary.OnlineTrade;
using NetLibrary.Log;
namespace TradeManageNew
{
public partial class ShopifyImport : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
JC_Shop model = JC_ShopService.GetModel(56);
if (!string.IsNullOrEmpty(model.AccessToken) && !string.IsNullOrEmpty(model.Appkey) && !string.IsNullOrEmpty(model.DeveKey))
{
Shopify obj = new Shopify();
obj.ShopName = model.ShopNo;
obj.AccessToken = model.AccessToken;
obj.AppKey = model.Appkey;
obj.AppSecret = model.DeveKey;
string error="";
string mess="";
//obj.GetLoanOrder(StartDate, StopDate, out error);
try
{
List<OrderModel> ListOrderModel = obj.GetOrdersNew(out error);
//List<OrderModel> ListOrderModel = obj.GetPayMoneyGoods(true, out error);
if (string.IsNullOrEmpty(error) == false)
{
mess="导入订单失败" + error;
Response.Write("<script>alert('"+mess+"')</script>");
}
string einfo = "";
if (ListOrderModel == null)
{
einfo = "采集到账订单0";
Response.Write("<script>alert('" + einfo + "')</script>");
}
else
{
einfo = "采集到账订单:" + ListOrderModel.Count;
API_OrderInfoService.SaveOrderModel(1, 56, obj.ShopName, 15, 0, ListOrderModel);
Response.Write("<script>alert('" + einfo + "')</script>");
}
}
catch (Exception ex)
{
Response.Write("<script>alert('" + ex.Message + "')</script>");
}
}
}
}
}