ch
2022-11-29 33641eb36f27b95c3cc676948043f57f56cb4e4a
WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -1,6 +1,7 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using RestSharp;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -306,7 +307,7 @@
                }
                if (bResult)
                {
                    objJsonResult.code = "0";
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
                    //WebAPIController.Add_Log("送货单下推", UserName, "生成送货单");
@@ -345,6 +346,16 @@
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (user == "10000")//api同步方式
                {
                    oCN.RunProc("delete from Gy_Material where HERPItemID=" + HItemID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "* 数据删除成功!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                //删除权限
                if (!DBUtility.ClsPub.Security_Log("Gy_Material_Delete", 1, false, user))
                {
@@ -354,8 +365,6 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (string.IsNullOrWhiteSpace(HItemID))
                {
                    objJsonResult.code = "0";
@@ -1340,5 +1349,25 @@
            }
        }
        #endregion
        public void cs(string msg)
        {
            var client = new RestSharp.RestClient("http://47.96.97.237/api/");
            var requestPost = new RestRequest("Gy_Material/SaveGy_MaterialList", Method.POST);
            Info info = new Info();
            info.msg = msg;
            var json = JsonConvert.SerializeObject(info);
            requestPost.AddParameter("application/json", json, ParameterType.RequestBody);
            IRestResponse responsePost = client.Execute(requestPost);
            var contentPost = responsePost.Content;
            Console.WriteLine("POST方式获取结果:" + contentPost);
            Console.Read();
        }
        public class Info
        {
            public string msg { get; set; }   //末级标志
        }
    }
}