74 lines
2.7 KiB
C#
74 lines
2.7 KiB
C#
using AllBase;
|
|
using AllBase.DouYinModel.Result;
|
|
using AllBase.Helper;
|
|
using AllBase.Model.Result;
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Linq;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using Work;
|
|
using Work.Api;
|
|
using Work.BaseForms;
|
|
|
|
namespace _29WxOrder.OrderForms
|
|
{
|
|
public partial class RemarkEditForm : BaseGeneralForm
|
|
{
|
|
string orderId = null;
|
|
public string NewRemark = null;
|
|
public RemarkEditForm(string _orderId, string remark)
|
|
{
|
|
InitializeComponent();
|
|
|
|
this.orderId = _orderId;
|
|
this.tbremark.Text = NewRemark = remark;
|
|
}
|
|
|
|
private void btsave_Click(object sender, EventArgs e)
|
|
{
|
|
var sb = new StringBuilder();
|
|
sb.Append("&order_id=" + orderId);
|
|
string upjmurl = BaseClass.Build29WxObjString("order&act=get_detail");
|
|
string html = GetHtml.PostUtf8(upjmurl, UserLogin.GetSignaturex() + sb.ToString());
|
|
string data = JObject.Parse(html)["data"].ToString();
|
|
DouYinOrderModel douYinOrderModel = JsonConvert.DeserializeObject<DouYinOrderModel>(data.Replace("\r\n", ""));
|
|
if (douYinOrderModel == null)
|
|
{
|
|
BaseMsgForm.ShowError("订单不存在!");
|
|
return;
|
|
}
|
|
|
|
ShopLoginInfo shop = GlobalConfig.ShopLoginList.FirstOrDefault(x => x.ShopId == douYinOrderModel.shop_id.ToString());
|
|
if (shop != null)
|
|
{
|
|
douYinOrderModel.remark = tbremark.Text.ToString();
|
|
Dictionary<string, string> dic = new Dictionary<string, string>() { };
|
|
dic.Add("remark", tbremark.Text.ToString());
|
|
dic.Add("order_id", douYinOrderModel.order_id);
|
|
DouyinApi apix = new DouyinApi(shop);
|
|
apix.JsonData = dic;
|
|
string updateDyResult = apix.AddOrderRemark();
|
|
|
|
NewRemark = tbremark.Text;
|
|
sb = new StringBuilder();
|
|
sb.Append("&order_id=" + douYinOrderModel.order_id);
|
|
sb.Append("&remark=" + tbremark.Text);
|
|
var url = BaseClass.Build29WxObjString("order&act=update");
|
|
string updateServerResult = GetHtml.PostUtf8(url, UserLogin.GetSignaturex() + sb.ToString());
|
|
|
|
if ((updateDyResult.Contains("\"message\":\"success\"") || updateDyResult.Contains("\"code\":10000")) && updateServerResult.Contains("\"code\":200") )
|
|
{
|
|
BaseMsgForm.ShowInfo("备注修改成功!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|