智云SRM-WEBAPI(目前客户通用API)
jingh
2021-02-28 a8f9f1ab0b29f22ad27bb6da013d80dd03e8de7a
添加项目文件。
63个文件已添加
7162 ■■■■■ 已修改文件
DAL/DataBaseServices.cs 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/POInStockBillServices.cs 185 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/SQLHelpers.cs 675 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI.sln 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/App_Start/SwaggerConfig.cs 213 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/App_Start/WebApiConfig.cs 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/BLL/WebServer.cs 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Code/Common.cs 127 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Code/Test2.cs 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Code/TestDAL.cs 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BarCodeController.cs 1167 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/EntrustOrderController.cs 271 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/PODemandPlanController.cs 271 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/POInStockBackController.cs 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/POInStockController.cs 628 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/POOrderController.cs 271 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/ReportController.cs 232 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/WebAPIController.cs 700 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL.zip 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/BLL.dll 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/DAL.dll 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/DBUtility.dll 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/Kingdee.BOS.WebApi.Client.dll 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/Kingdee.BOS.WebApi.FormService.dll 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/Kingdee.BOS.WebApi.ServicesStub.dll 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/Newtonsoft.Json.Net35.dll 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/Pub_Class.dll 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/Pub_Control.dll 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/SQLHelper.dll 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/System.Net.Http.Formatting.dll 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/System.Web.Http.WebHost.dll 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/System.Web.Http.dll 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Global.asax 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Global.asax.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Index.html 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/ListModels.cs 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Metadata/deploymentTemplates/apiappconfig.azureresource.json 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/ClsCg_POInStockBill.cs 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/JsonResult.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/Pensen.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/json.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Properties/AssemblyInfo.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Web.Debug.config 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Web.Release.config 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Web.config 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 250 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/apiapp.json 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/packages.config 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WindowsFormsApp1/App.config 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WindowsFormsApp1/Program.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WindowsFormsApp1/Properties/AssemblyInfo.cs 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WindowsFormsApp1/Properties/Resources.Designer.cs 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WindowsFormsApp1/Properties/Resources.resx 117 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WindowsFormsApp1/Properties/Settings.Designer.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WindowsFormsApp1/Properties/Settings.settings 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WindowsFormsApp1/TestAPI.Designer.cs 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WindowsFormsApp1/TestAPI.cs 152 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WindowsFormsApp1/TestAPI.csproj 185 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WindowsFormsApp1/TestAPI.resx 120 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
加载失败.txt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
物料条码.grf 452 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
输出-生成.txt 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/DataBaseServices.cs
New file
@@ -0,0 +1,70 @@
using Model;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebAPI.DAL
{
    public class DataBaseServices : DBUtility.ClsXt_BaseBill
    {
        public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        /// <summary>
        /// æ–°å¢žé€è´§å•
        /// </summary>
        /// <param name="GroupName">班级名称</param>
        /// <param name="isModify">是否修改状态</param>
        /// <returns></returns>
        public int SavePOInStockBill(string POInStock)
        {
            return 0;
            //string sql = "";
            //string sReturn = "";
            //JObject job = JObject.Parse(POInStock);
            //try
            //{
            //    //得到mainid
            //    Int64 HInterID = DBUtility.ClsPub.CreateBillID("1103", ref DBUtility.ClsPub.sExeReturnInfo);
            //    //若MAINDI重复则重新获取
            //    oCn.BeginTran();
            //    //主表
            //    oCn.RunProc("Insert Into Cg_POInStockBillMain     " +
            //    "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
            //    ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
            //    ",HAddress,HSupID,HCurID,HWHID,HExRate" +
            //    ",HEmpID,HManagerID,HDeptID,HExplanation,HInnerBillNo" +
            //    ") " +
            //    " values('1103','11251'," + HInterID.ToString() + ",'" + job["单据号"].ToString() + "','" + job["日期"].ToString() + "'" +
            //    ",'2019',12,'" + job["表头备注"].ToString() + "','admin',getdate()" +
            //    ",'null'," + job["hsubid"].ToString() + "," + job["hcurid"].ToString() + ",'null','null'"+
            //    ", " + job["HEmpID"].ToString() + "," + job["hmanagerid"].ToString() + "," + job["HDeptID"].ToString() + ",'null','null'" +
            //    ") ");
            //    //插入子表
            //    foreach (Model.ClsCg_POInStockBill oSub in )
            //    {
            //        oCn.RunProc("Insert into Cg_POInStockBillSub " +
            //          " (HInterID,HEntryID,HRemark,HDate" +
            //          ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
            //          ",HMaterID,HUnitID,HQty,HPrice,HMoney,HWHID" +
            //          ",HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo,HCheckQty,HPassQty,HBadQty" +
            //          ") values("
            //          + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HRemark + "','" +oSub.HDate +
            //          "'," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
            //          "," + oSub.HMaterID.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HWHID.ToString() +
            //          "," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'," + oSub.HCheckQty.ToString() +","+oSub.HPassQty.ToString() +"," +oSub.HBadQty.ToString() +
            //          ") ");
            //    }
            //    oCn.Commit();
            //    return 1;
            //}
            //catch (Exception e)
            //{
            //    sReturn = e.Message;
            //    oCn.RollBack();
            //    throw (e);
            //}
        }
    }
}
DAL/POInStockBillServices.cs
New file
@@ -0,0 +1,185 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
using System.Web.Script.Serialization;
using Newtonsoft.Json.Linq;
using Model;
using DBUtility;
namespace DAL
{
    public class POInStockBillServices
    {
        public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        /// <summary>
        /// è¦è´§é€šçŸ¥å•
        /// </summary>
        /// <returns></returns>
        public DataSet GetPOInStockBill()
        {
            try
            {
                DataSet dataSet = oCn.RunProcReturn("select * from h_v_Cg_POInStockBillList ", "ClsCg_POInStockBill"); //where hmaterid=" + sqlWhere
                return dataSet;
            }
            catch (Exception)
            {
                throw;
            }
        }
        /// <summary>
        /// é‡‡è´­è®¢å•列表
        /// </summary>
        /// <returns></returns>
        public DataSet GetPOOrderBill()
        {
            try
            {
                DataSet dataSet = oCn.RunProcReturn("select * from h_v_Cg_POOrderBillList ", "h_v_Cg_POOrderBillList"); //where hmaterid=" + sqlWhere
                return dataSet;
            }
            catch (Exception)
            {
                throw;
            }
        }
        /// <summary>
        /// å§”外订单列表
        /// </summary>
        /// <returns></returns>
        public DataSet GetICSubContractBill()
        {
            try
            {
                DataSet dataSet = oCn.RunProcReturn("select * from h_v_Kf_EntrustInBillList ", "h_v_Kf_EntrustInBillList"); //where hmaterid=" + sqlWhere
                return dataSet;
            }
            catch (Exception)
            {
                throw;
            }
        }
        /// <summary>
        /// æ¡ç æ¡£æ¡ˆåˆ—表
        /// </summary>
        /// <returns></returns>
        public DataSet GetBarCodeBill()
        {
            try
            {
                DataSet dataSet = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill ", "h_v_Gy_BarCodeBill"); //where hmaterid=" + sqlWhere
                return dataSet;
            }
            catch (Exception)
            {
                throw;
            }
        }
        public List<ClsCg_POInStockBill> GetLabelPrintDetail(long sqlWhere)
        {
            List<ClsCg_POInStockBill> POInStockBillList = new List<ClsCg_POInStockBill>();
            try
            {
                SqlParameter[] param = new SqlParameter[]
                    {
                       //new SqlParameter("@sqlWhere", sqlWhere)
                        //new SqlParameter("@JDInterID",""),
                        //new SqlParameter("@JDEntryID","")
                    };
                SqlDataReader reader = SQLHelpers.GetReaderByProcedure("ClsCg_POInStockBill", param);
                while (reader.Read())
                {
                    POInStockBillList.Add(new ClsCg_POInStockBill()
                    {
                        HInterID = DBUtility.ClsPub.isLong(reader["HInterID"]),
                        HEntryID = DBUtility.ClsPub.isLong(reader["HEntryID"]),
                        HDateForWeb = DBUtility.ClsPub.isStrNull(reader["HDateForWeb"]),
                        HAddress = DBUtility.ClsPub.isStrNull(reader["HAddress"]),//     varchar(200)                --交货地点
                        HSupID = DBUtility.ClsPub.isLong(reader["HSupID"]),//      int                 --供应商 ï¼ˆGy_Supplier)
                        HCurID = DBUtility.ClsPub.isLong(reader["HCurID"]),//    int                  --币别 (Gy_Currency)
                        HWHID = DBUtility.ClsPub.isLong(reader["HWHID"]),//      int     --仓库
                        HExRate = DBUtility.ClsPub.isLong(reader["HExRate"]),//    money                  --汇率  (选择完币别带出)
                        HEmpID = DBUtility.ClsPub.isLong(reader["HEmpID"]),//     int                   --业务员  (Gy_Employee)
                        HMangerID = DBUtility.ClsPub.isLong(reader["HMangerID"]),//  int                 --主管    (Gy_Employee)
                        HDeptID = DBUtility.ClsPub.isLong(reader["HDeptID"]),//     int                 --部门    (Gy_Employee)
                        HExplanation = DBUtility.ClsPub.isStrNull(reader["HExplanation"]),//  varchar(200)             --摘要
                        HInnerBillNo = DBUtility.ClsPub.isStrNull(reader["HInnerBillNo"]),//  varchar(50)             --内部单据号
                        HMaterID = DBUtility.ClsPub.isLong(reader["HMaterID"]),//  int      --物料ID (Gy_Material)
                        HUnitID = DBUtility.ClsPub.isLong(reader["HUnitID"]),//    int    --计量单位 (Gy_Unit)
                        HQty = DBUtility.ClsPub.isLong(reader["HQty"]),//     dec(18,8)         --要货数量
                        HCheckQty = DBUtility.ClsPub.isLong(reader["HCheckQty"]),        //检验数
                        HPassQty = DBUtility.ClsPub.isLong(reader["HPassQty"]),         //合格数
                        HBadQty = DBUtility.ClsPub.isLong(reader["HBadQty"]),          //不合格数
                        HPrice = DBUtility.ClsPub.isLong(reader["HPrice"]),//   dec(18,8)         --原币单价
                        HMoney = DBUtility.ClsPub.isLong(reader["HMoney"]),//   dec(18,8)         --原币金额
                        //  HWHID//              --收料仓库
                        HPOOrderInterID = DBUtility.ClsPub.isLong(reader["HPOOrderInterID"]),//
                        HPOOrderEntryID = DBUtility.ClsPub.isLong(reader["HPOOrderEntryID"]),//
                        HPOOrderBillNo = DBUtility.ClsPub.isStrNull(reader["HPOOrderBillNo"]),//
                        HDate = DBUtility.ClsPub.isDate(reader["HDate"]),   //要货时间
                        HState = DBUtility.ClsPub.isLong(reader["HState"]),
                        HBackDate = DBUtility.ClsPub.isStrNull(reader["HBackDate"]),
                        HBacker = DBUtility.ClsPub.isStrNull(reader["HBacker"]),
                        HBillerID = DBUtility.ClsPub.isLong(reader["HBillerID"]),
                        HBillNo = DBUtility.ClsPub.isStrNull(reader["HBillNo"]),
                        HBillStatus = DBUtility.ClsPub.isInt(reader["HBillStatus"]),
                        HBillSubType = DBUtility.ClsPub.isStrNull(reader["HBillSubType"]),
                        HBillType = DBUtility.ClsPub.isStrNull(reader["HBillType"]),
                        HCheckDate = DBUtility.ClsPub.isStrNull(reader["HCheckDate"]),
                        HChecker = DBUtility.ClsPub.isStrNull(reader["HChecker"]),
                        HCheckFlowID = DBUtility.ClsPub.isLong(reader["HCheckFlowID"]),
                        HCheckItemNextID = DBUtility.ClsPub.isLong(reader["HCheckItemNextID"]),
                        HCheckItemNowID = DBUtility.ClsPub.isLong(reader["HCheckItemNowID"]),
                        HCloseDate = DBUtility.ClsPub.isStrNull(reader["HCloseDate"]),
                        // HCloseMan= DBUtility.ClsPub.isLong(reader["HEntryID"]),
                        HCloseType = DBUtility.ClsPub.isBool(reader["HCloseType"]),
                        //HDate= DBUtility.ClsPub.isLong(reader["HEntryID"]),
                        HDeleteDate = DBUtility.ClsPub.isStrNull(reader["HDeleteDate"]),
                        HDeleteMan = DBUtility.ClsPub.isStrNull(reader["HDeleteMan"]),
                        HEmpCode = DBUtility.ClsPub.isStrNull(reader["HEmpCode"]),
                        HMainSourceBillNo = DBUtility.ClsPub.isStrNull(reader["HMainSourceBillNo"]),
                        HMainSourceBillType = DBUtility.ClsPub.isStrNull(reader["HMainSourceBillType"]),
                        HMainSourceEntryID = DBUtility.ClsPub.isLong(reader["HMainSourceEntryID"]),
                        HMainSourceInterID = DBUtility.ClsPub.isLong(reader["HMainSourceInterID"]),
                        HMakeDate = DBUtility.ClsPub.isStrNull(reader["HMakeDate"]),
                        HMaker = DBUtility.ClsPub.isStrNull(reader["HMaker"]),
                        HPeriod = DBUtility.ClsPub.isLong(reader["HPeriod"]),
                        HRemark = DBUtility.ClsPub.isStrNull(reader["HRemark"]),
                        HUpDateDate = DBUtility.ClsPub.isStrNull(reader["HUpDateDate"]),
                        HUpDater = DBUtility.ClsPub.isStrNull(reader["HUpDater"]),
                        HYear = DBUtility.ClsPub.isLong(reader["HYear"]),
                        // HCloseMan= DBUtility.ClsPub.isLong(reader["HEntryID"]),
                        //  HCloseType= DBUtility.ClsPub.isLong(reader["HEntryID"]),
                        HEntryCloseDate = DBUtility.ClsPub.isDate(reader["HEntryCloseDate"]),
                        HRelationMoney = DBUtility.ClsPub.isLong(reader["HRelationMoney"]),
                        HRelationQty = DBUtility.ClsPub.isLong(reader["HRelationQty"]),
                        //  HRemark= DBUtility.ClsPub.isStrNull(reader["HEntryID"]),
                        HSourceBillNo = DBUtility.ClsPub.isStrNull(reader["HSourceBillNo"]),
                        HSourceBillType = DBUtility.ClsPub.isStrNull(reader["HSourceBillType"]),
                        HSourceEntryID = DBUtility.ClsPub.isLong(reader["HSourceEntryID"]),
                        HSourceInterID = DBUtility.ClsPub.isLong(reader["HSourceInterID"]),
                    });
                }
                reader.Close();
                return POInStockBillList;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
DAL/SQLHelpers.cs
New file
@@ -0,0 +1,675 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Data;
using System.Data.SqlClient;
namespace DAL
{
    public class SQLHelpers
    {
        /***连接数据库****/
        public static string connectionString = "User ID=HX_User;Password=lc@841022;Data Source=.;Initial Catalog=HX_APSsys_WDR";
      //  PublicFunc publicFunc = new PublicFunc();
        #region  æ‰§è¡Œç®€å•SQL语句
        public static SqlDataReader GetReader(string sql)
        {
            SqlConnection conn = new SqlConnection(connectionString);
            SqlCommand cmd = new SqlCommand(sql, conn);
            try
            {
                conn.Open();
                SqlDataReader objReader =
                    cmd.ExecuteReader(CommandBehavior.CloseConnection);
                return objReader;
            }
            catch (Exception ex)
            {
                conn.Close();
                throw ex;
            }
        }
        public static SqlDataReader GetReader(string sql, SqlParameter[] param)
        {
            SqlConnection conn = new SqlConnection(connectionString);
            SqlCommand cmd = new SqlCommand(sql, conn);
            try
            {
                conn.Open();
                cmd.Parameters.AddRange(param);
                SqlDataReader objReader =
                    cmd.ExecuteReader(CommandBehavior.CloseConnection);
                return objReader;
            }
            catch (Exception ex)
            {
                conn.Close();
                throw ex;
            }
        }
        /// <summary>
        /// æ‰§è¡ŒSQL语句,返回影响的记录数
        /// </summary>
        /// <param name="SQLString">SQL语句</param>
        /// <returns>影响的记录数</returns>
        public static int ExecuteSql(string SQLString)
        {
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                using (SqlCommand cmd = new SqlCommand(SQLString, connection))
                {
                    try
                    {
                        connection.Open();
                        int rows = cmd.ExecuteNonQuery();
                        return rows;
                    }
                    catch (System.Data.SqlClient.SqlException e)
                    {
                        connection.Close();
                        throw e;
                    }
                }
            }
        }
        /// <summary>
        /// æŸ¥è¯¢å•一结果
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        public static object GetSingleResult(string sql)
        {
            SqlConnection conn = new SqlConnection(connectionString);
            SqlCommand cmd = new SqlCommand(sql, conn);
            try
            {
                conn.Open();
                return cmd.ExecuteScalar();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                conn.Close();
            }
        }
        public static object GetSingleResult(string sql, SqlParameter[] param)
        {
            SqlConnection conn = new SqlConnection(connectionString);
            SqlCommand comm = new SqlCommand(sql, conn);
            try
            {
                conn.Open();
                comm.Parameters.AddRange(param);
                return comm.ExecuteScalar();
            }
            catch (Exception ex)
            {
                WriteLog(ex.Message);
                throw new Exception("在调用public static object GetSingleResult(string sql,SqlParameter[] param)方法时出错,错误信息" + ex.Message);
            }
            finally
            {
                conn.Close();
            }
        }
        /// <summary>
        /// æ‰§è¡Œå¤šç»“果查询(select)
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        public static int ExecuteSqlByTime(string SQLString, int Times)
        {
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                using (SqlCommand cmd = new SqlCommand(SQLString, connection))
                {
                    try
                    {
                        connection.Open();
                        cmd.CommandTimeout = Times;
                        int rows = cmd.ExecuteNonQuery();
                        return rows;
                    }
                    catch (System.Data.SqlClient.SqlException e)
                    {
                        connection.Close();
                        throw e;
                    }
                }
            }
        }
        public static int ExecuteSqlTran(List<String> SQLStringList)
        {
            using (SqlConnection conn = new SqlConnection(connectionString))
            {
                conn.Open();
                SqlCommand cmd = new SqlCommand();
                cmd.Connection = conn;
                SqlTransaction tx = conn.BeginTransaction();
                cmd.Transaction = tx;
                try
                {
                    int count = 0;
                    for (int n = 0; n < SQLStringList.Count; n++)
                    {
                        string strsql = SQLStringList[n];
                        if (strsql.Trim().Length > 1)
                        {
                            cmd.CommandText = strsql;
                            count += cmd.ExecuteNonQuery();
                        }
                    }
                    tx.Commit();
                    return count;
                }
                catch
                {
                    tx.Rollback();
                    return 0;
                }
            }
        }
        /// <summary>
        /// æ‰§è¡Œå¸¦ä¸€ä¸ªå­˜å‚¨è¿‡ç¨‹å‚数的的SQL语句。
        /// </summary>
        /// <param name="SQLString">SQL语句</param>
        /// <param name="content">参数内容,比如一个字段是格式复杂的文章,有特殊符号,可以通过这个方式添加</param>
        /// <returns>影响的记录数</returns>
        public static int ExecuteSql(string SQLString, string content)
        {
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                SqlCommand cmd = new SqlCommand(SQLString, connection);
                System.Data.SqlClient.SqlParameter myParameter = new System.Data.SqlClient.SqlParameter("@content", SqlDbType.NText);
                myParameter.Value = content;
                cmd.Parameters.Add(myParameter);
                try
                {
                    connection.Open();
                    int rows = cmd.ExecuteNonQuery();
                    return rows;
                }
                catch (System.Data.SqlClient.SqlException e)
                {
                    throw e;
                }
                finally
                {
                    cmd.Dispose();
                    connection.Close();
                }
            }
        }
        #region æ‰§è¡Œå¸¦å‚æ•°çš„SQL语句
        /// <summary>
        /// æ‰§è¡ŒSQL语句,返回影响的记录数
        /// </summary>
        /// <param name="SQLString">SQL语句</param>
        /// <returns>影响的记录数</returns>
        public static int ExecuteSql(string SQLString, params SqlParameter[] cmdParms)
        {
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    try
                    {
                        PrepareCommand(cmd, connection, null, SQLString, cmdParms);
                        int rows = cmd.ExecuteNonQuery();
                        cmd.Parameters.Clear();
                        return rows;
                    }
                    catch (System.Data.SqlClient.SqlException e)
                    {
                        // WriteLog(e.Message);
                        throw e;
                    }
                }
            }
        }
        #endregion
        private static void PrepareCommand(SqlCommand cmd, SqlConnection conn, SqlTransaction trans, string cmdText, SqlParameter[] cmdParms)
        {
            if (conn.State != ConnectionState.Open)
                conn.Open();
            cmd.Connection = conn;
            cmd.CommandText = cmdText;
            if (trans != null)
                cmd.Transaction = trans;
            cmd.CommandType = CommandType.Text;//cmdType;
            if (cmdParms != null)
            {
                foreach (SqlParameter parameter in cmdParms)
                {
                    if ((parameter.Direction == ParameterDirection.InputOutput || parameter.Direction == ParameterDirection.Input) &&
                        (parameter.Value == null))
                    {
                        parameter.Value = DBNull.Value;
                    }
                    cmd.Parameters.Add(parameter);
                }
            }
        }
        /// <summary>
        /// æ‰§è¡Œå¸¦ä¸€ä¸ªå­˜å‚¨è¿‡ç¨‹å‚数的的SQL语句。
        /// </summary>
        /// <param name="SQLString">SQL语句</param>
        /// <param name="content">参数内容,比如一个字段是格式复杂的文章,有特殊符号,可以通过这个方式添加</param>
        /// <returns>影响的记录数</returns>
        public static object ExecuteSqlGet(string SQLString, string content)
        {
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                SqlCommand cmd = new SqlCommand(SQLString, connection);
                System.Data.SqlClient.SqlParameter myParameter = new System.Data.SqlClient.SqlParameter("@content", SqlDbType.VarChar);
                myParameter.Value = content;
                cmd.Parameters.Add(myParameter);
                try
                {
                    connection.Open();
                    object obj = cmd.ExecuteScalar();
                    if ((Object.Equals(obj, null)) || (Object.Equals(obj, System.DBNull.Value)))
                    {
                        return null;
                    }
                    else
                    {
                        return obj;
                    }
                }
                catch (System.Data.SqlClient.SqlException e)
                {
                    throw e;
                }
                finally
                {
                    cmd.Dispose();
                    connection.Close();
                }
            }
        }
        /// <summary>
        /// å‘数据库里插入图像格式的字段(和上面情况类似的另一种实例)
        /// </summary>
        /// <param name="strSQL">SQL语句</param>
        /// <param name="fs">图像字节,数据库的字段类型为image的情况</param>
        /// <returns>影响的记录数</returns>
        /// <summary>
        /// æ‰§è¡ŒæŸ¥è¯¢è¯­å¥ï¼Œè¿”回SqlDataReader ( æ³¨æ„ï¼šè°ƒç”¨è¯¥æ–¹æ³•后,一定要对SqlDataReader进行Close )
        /// </summary>
        /// <param name="strSQL">查询语句</param>
        /// <returns>SqlDataReader</returns>
        public static SqlDataReader ExecuteReader(string strSQL)
        {
            SqlConnection connection = new SqlConnection(connectionString);
            SqlCommand cmd = new SqlCommand(strSQL, connection);
            try
            {
                connection.Open();
                SqlDataReader myReader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
                return myReader;
            }
            catch (System.Data.SqlClient.SqlException e)
            {
                throw e;
            }
        }
        public static int ExecuteSqlInsertImg(string strSQL, byte[] fs)
        {
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                SqlCommand cmd = new SqlCommand(strSQL, connection);
                System.Data.SqlClient.SqlParameter myParameter = new System.Data.SqlClient.SqlParameter("@fs", SqlDbType.Image);
                myParameter.Value = fs;
                cmd.Parameters.Add(myParameter);
                try
                {
                    connection.Open();
                    int rows = cmd.ExecuteNonQuery();
                    return rows;
                }
                catch (System.Data.SqlClient.SqlException e)
                {
                    throw e;
                }
                finally
                {
                    cmd.Dispose();
                    connection.Close();
                }
            }
        }
        #endregion
        /// <summary>
        /// æ‰§è¡ŒæŸ¥è¯¢è¯­å¥ï¼Œè¿”回DataSet
        /// </summary>
        /// <param name="SQLString">查询语句</param>
        /// <returns>DataSet</returns>
        public static DataSet Query(string SQLString)
        {
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                DataSet ds = new DataSet();
                try
                {
                    connection.Open();
                    SqlDataAdapter command = new SqlDataAdapter(SQLString, connection);
                    command.Fill(ds, "ds");
                }
                catch (System.Data.SqlClient.SqlException ex)
                {
                    throw new Exception(ex.Message);
                }
                return ds;
            }
        }
        /// <summary>
        /// æ‰§è¡Œè¿”回结果集的操作
        /// </summary>
        /// <returns></returns>
        public static SqlDataReader GetReaderByProcedure(string storeProduceName, SqlParameter[] param)
        {
            SqlConnection conn = new SqlConnection(connectionString);
            SqlCommand comm = new SqlCommand();
            comm.Connection = conn;
            comm.CommandType = CommandType.StoredProcedure;
            comm.CommandText = storeProduceName;
            try
            {
                conn.Open();
                if (param != null)
                {
                    comm.Parameters.AddRange(param);
                }
                return comm.ExecuteReader(CommandBehavior.CloseConnection);
            }
            catch (Exception ex)
            {
                ///将错误信息写入日志
                //WriteLog("执行GetReaderByProcedure(string storeProduceName, SqlParameter[] param)时发生错误,错误信息" + ex);
                throw ex;
            }
        }
        /// <summary>
        /// æ‰§è¡Œå¢žåˆ æ”¹æ–¹æ³•(insert、update、delete类型的SQL语句)
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        public static int Update(string sql)
        {
            SqlConnection conn = new SqlConnection(connectionString);
            SqlCommand cmd = new SqlCommand(sql, conn);
            try
            {
                conn.Open();
                return cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                conn.Close();
            }
        }
        /// <summary>
        /// æ‰§è¡Œå¸¦å‚æ•°çš„SQL语句或存储过程
        /// </summary>
        /// <param name="sqlOrProcedure">sql语句或存储过程名称</param>
        /// <param name="param">参数</param>
        /// <param name="isProcedure">是否为存储过程</param>
        /// <returns></returns>
        public static int Update(string sqlOrProcedure, SqlParameter[] param, bool isProcedure)
        {
            SqlConnection conn = new SqlConnection(connectionString);
            SqlCommand cmd = new SqlCommand(sqlOrProcedure, conn);
            if (isProcedure)
            {
                cmd.CommandType = CommandType.StoredProcedure;
            }
            try
            {
                conn.Open();
                cmd.Parameters.AddRange(param);
                return cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                //WriteErrLog("执行 public static int Update(string sqlOrProcedure,SqlParameter[] param,bool isProcedure)方法时出错,错误信息" + ex.Message);
                throw ex;
            }
            finally
            {
                conn.Close();
            }
        }
        /// <summary>
        /// æ‰§è¡Œå­˜å‚¨è¿‡ç¨‹
        /// </summary>
        /// <param name="storedProcName">存储过程名</param>
        /// <param name="parameters">存储过程参数</param>
        /// <param name="tableName">DataSet结果中的表名</param>
        /// <returns>DataSet</returns>
        public static DataSet RunProcedure(string storedProcName, IDataParameter[] parameters, string tableName)
        {
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                DataSet dataSet = new DataSet();
                connection.Open();
                SqlDataAdapter sqlDA = new SqlDataAdapter();
                sqlDA.SelectCommand = BuildQueryCommand(connection, storedProcName, parameters);
                sqlDA.Fill(dataSet, tableName);
                connection.Close();
                return dataSet;
            }
        }
        /// <summary>
        /// æž„建 SqlCommand å¯¹è±¡(用来返回一个结果集,而不是一个整数值)
        /// </summary>
        /// <param name="connection">数据库连接</param>
        /// <param name="storedProcName">存储过程名</param>
        /// <param name="parameters">存储过程参数</param>
        /// <returns>SqlCommand</returns>
        private static SqlCommand BuildQueryCommand(SqlConnection connection, string storedProcName, IDataParameter[] parameters)
        {
            SqlCommand command = new SqlCommand(storedProcName, connection);
            command.CommandType = CommandType.StoredProcedure;
            foreach (SqlParameter parameter in parameters)
            {
                if (parameter != null)
                {
                    // æ£€æŸ¥æœªåˆ†é…å€¼çš„输出参数,将其分配以DBNull.Value.
                    if ((parameter.Direction == ParameterDirection.InputOutput || parameter.Direction == ParameterDirection.Input) &&
                        (parameter.Value == null))
                    {
                        parameter.Value = DBNull.Value;
                    }
                    command.Parameters.Add(parameter);
                }
            }
            return command;
        }
        //用存储过程插入数据
        public static DataSet GetDataSetByProcedure(string spName, SqlParameter[] param)
        {
            SqlConnection conn = new SqlConnection(connectionString);
            SqlCommand cmd = new SqlCommand(spName, conn);
            cmd.CommandType = CommandType.StoredProcedure;
            try
            {
                conn.Open();
                cmd.Parameters.AddRange(param);
                SqlDataAdapter sda = new SqlDataAdapter();
                sda.SelectCommand = cmd;
                DataSet ds = new DataSet();
                sda.Fill(ds, "ds");
                cmd.Parameters.Clear();
                return ds;
            }
            catch (Exception ex)
            {
                //将错误信息写入系统日志
                string info = "调用GetReaderByProcedure(string spName, SqlParameter[] param)方法时发生错误:" + ex.Message;
                WriteLog(ex.Message);
                throw new Exception(info);
            }
        }
        public static SqlDataReader MyReader(string strSQL)
        {
            SqlConnection connection = new SqlConnection(connectionString);
            SqlCommand cmd = new SqlCommand(strSQL, connection);
            try
            {
                connection.Open();
                SqlDataReader myReader = cmd.ExecuteReader();
                return myReader;
            }
            catch (System.Data.SqlClient.SqlException e)
            {
                throw new Exception(e.Message);
            }
            finally
            {
                cmd.Dispose();
                //connection.Close();
            }
        }
        public static int ExecuteSql1(string SQLString, params SqlParameter[] myParameter)
        {
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                SqlCommand cmd = new SqlCommand(SQLString, connection);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddRange(myParameter);
                try
                {
                    connection.Open();
                    int rows = cmd.ExecuteNonQuery();
                    return rows;
                }
                catch (System.Data.SqlClient.SqlException e)
                {
                    WriteLog(e.Message);
                    throw e;
                }
                finally
                {
                    cmd.Dispose();
                    connection.Close();
                }
            }
        }
        /// <summary>
        /// ä½¿ç”¨äº‹åŠ¡æäº¤å¸¦å‚æ•°çš„SQL语句
        /// </summary>
        /// <param name="mainSql">主SQL语句</param>
        /// <param name="mainparam">主SQL参数</param>
        /// <param name="detailSql">明细SQL</param>
        /// <param name="detailparam">明细SQL语句对应的参数数组集合</param>
        /// <returns>返回事务是否成功</returns>
        public static bool UpdateByTran(string mainSql, SqlParameter[] mainparam, string detailSql, List<SqlParameter[]> detailparam)
        {
            SqlConnection conn = new SqlConnection(connectionString);
            SqlCommand comm = new SqlCommand();
            comm.Connection = conn;
            try
            {
                conn.Open();
                comm.Transaction = conn.BeginTransaction();//开启事务
                if (mainSql != null && mainSql.Length != 0)
                {
                    comm.CommandText = mainSql;
                    if (mainparam != null)
                        comm.Parameters.AddRange(mainparam);
                    comm.ExecuteNonQuery();
                }
                if (detailparam != null)
                {
                    foreach (SqlParameter[] param in detailparam)
                    {
                        comm.CommandText = detailSql;
                        comm.Parameters.Clear();//清空参数
                        comm.Parameters.AddRange(param);
                        comm.ExecuteNonQuery();
                    }
                }
                comm.Transaction.Commit();//提交事务
                return true;
            }
            catch (Exception ex)
            {
                if (comm.Transaction != null)
                {
                    comm.Transaction.Rollback();//回滚事务
                }
                WriteLog(ex.Message);
                throw new Exception("在调用 public static bool UpdateByTran(string mainSql,SqlParameter[] mainparam,string detailSql,List<SqlParameter[]> detailparam)方法时出错,错误信息" + ex.Message);
            }
            finally
            {
                if (comm.Transaction != null)
                {
                    comm.Transaction = null;
                }
            }
        }
        #region SQL错误日志记录
        /// <summary>
        /// SQL错误日志记录
        /// </summary>
        public static void WriteLog(string loginfo)
        {
            FileStream fs = new FileStream("SQLHelper.Log", FileMode.Append);
            StreamWriter sw = new StreamWriter(fs);
            string Log = GetDBSqlDateTime() + "  é”™è¯¯ä¿¡æ¯: " + loginfo;
            sw.WriteLine(Log);
            sw.Close();
            fs.Close();
        }
        #endregion
        /// <summary>
        /// èŽ·å–æœåŠ¡å™¨æ—¶é—´
        /// </summary>
        /// <returns></returns>
        public static DateTime GetDBSqlDateTime()
        {
            return Convert.ToDateTime(GetSingleResult("select getdate()"));
        }
    }
}
WebAPI.sln
New file
@@ -0,0 +1,41 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebAPI", "WebAPI\WebAPI.csproj", "{5B60CE0C-963C-4DC2-91B3-0B471AAC5438}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestAPI", "WindowsFormsApp1\TestAPI.csproj", "{FFED17B5-612D-404C-A9B8-628BA6DC3257}"
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Any CPU = Debug|Any CPU
        Debug|x86 = Debug|x86
        Release|Any CPU = Release|Any CPU
        Release|x86 = Release|x86
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {5B60CE0C-963C-4DC2-91B3-0B471AAC5438}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {5B60CE0C-963C-4DC2-91B3-0B471AAC5438}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {5B60CE0C-963C-4DC2-91B3-0B471AAC5438}.Debug|x86.ActiveCfg = Debug|x86
        {5B60CE0C-963C-4DC2-91B3-0B471AAC5438}.Debug|x86.Build.0 = Debug|x86
        {5B60CE0C-963C-4DC2-91B3-0B471AAC5438}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {5B60CE0C-963C-4DC2-91B3-0B471AAC5438}.Release|Any CPU.Build.0 = Release|Any CPU
        {5B60CE0C-963C-4DC2-91B3-0B471AAC5438}.Release|x86.ActiveCfg = Release|x86
        {5B60CE0C-963C-4DC2-91B3-0B471AAC5438}.Release|x86.Build.0 = Release|x86
        {FFED17B5-612D-404C-A9B8-628BA6DC3257}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {FFED17B5-612D-404C-A9B8-628BA6DC3257}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {FFED17B5-612D-404C-A9B8-628BA6DC3257}.Debug|x86.ActiveCfg = Debug|x86
        {FFED17B5-612D-404C-A9B8-628BA6DC3257}.Debug|x86.Build.0 = Debug|x86
        {FFED17B5-612D-404C-A9B8-628BA6DC3257}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {FFED17B5-612D-404C-A9B8-628BA6DC3257}.Release|Any CPU.Build.0 = Release|Any CPU
        {FFED17B5-612D-404C-A9B8-628BA6DC3257}.Release|x86.ActiveCfg = Release|x86
        {FFED17B5-612D-404C-A9B8-628BA6DC3257}.Release|x86.Build.0 = Release|x86
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
    EndGlobalSection
    GlobalSection(ExtensibilityGlobals) = postSolution
        SolutionGuid = {489992F1-3AD6-473D-8B4C-DBEB71452F7B}
    EndGlobalSection
EndGlobal
WebAPI/App_Start/SwaggerConfig.cs
New file
@@ -0,0 +1,213 @@
using System.Web.Http;
using WebActivatorEx;
using WebAPI;
using Swashbuckle.Application;
[assembly: PreApplicationStartMethod(typeof(SwaggerConfig), "Register")]
namespace WebAPI
{
    public class SwaggerConfig
    {
        public static void Register()
        {
            var thisAssembly = typeof(SwaggerConfig).Assembly;
            GlobalConfiguration.Configuration
                .EnableSwagger(c =>
                    {
                        // By default, the service root url is inferred from the request used to access the docs.
                        // However, there may be situations (e.g. proxy and load-balanced environments) where this does not
                        // resolve correctly. You can workaround this by providing your own code to determine the root URL.
                        //
                        //c.RootUrl(req => GetRootUrlFromAppConfig());
                        // If schemes are not explicitly provided in a Swagger 2.0 document, then the scheme used to access
                        // the docs is taken as the default. If your API supports multiple schemes and you want to be explicit
                        // about them, you can use the "Schemes" option as shown below.
                        //
                        //c.Schemes(new[] { "http", "https" });
                        // Use "SingleApiVersion" to describe a single version API. Swagger 2.0 includes an "Info" object to
                        // hold additional metadata for an API. Version and title are required but you can also provide
                        // additional fields by chaining methods off SingleApiVersion.
                        //
                        c.SingleApiVersion("v1", "WebAPI");
                        // If your API has multiple versions, use "MultipleApiVersions" instead of "SingleApiVersion".
                        // In this case, you must provide a lambda that tells Swashbuckle which actions should be
                        // included in the docs for a given API version. Like "SingleApiVersion", each call to "Version"
                        // returns an "Info" builder so you can provide additional metadata per API version.
                        //
                        //c.MultipleApiVersions(
                        //    (apiDesc, targetApiVersion) => ResolveVersionSupportByRouteConstraint(apiDesc, targetApiVersion),
                        //    (vc) =>
                        //    {
                        //        vc.Version("v2", "Swashbuckle Dummy API V2");
                        //        vc.Version("v1", "Swashbuckle Dummy API V1");
                        //    });
                        // You can use "BasicAuth", "ApiKey" or "OAuth2" options to describe security schemes for the API.
                        // See https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md for more details.
                        // NOTE: These only define the schemes and need to be coupled with a corresponding "security" property
                        // at the document or operation level to indicate which schemes are required for an operation. To do this,
                        // you'll need to implement a custom IDocumentFilter and/or IOperationFilter to set these properties
                        // according to your specific authorization implementation
                        //
                        //c.BasicAuth("basic")
                        //    .Description("Basic HTTP Authentication");
                        //
                        //c.ApiKey("apiKey")
                        //    .Description("API Key Authentication")
                        //    .Name("apiKey")
                        //    .In("header");
                        //
                        //c.OAuth2("oauth2")
                        //    .Description("OAuth2 Implicit Grant")
                        //    .Flow("implicit")
                        //    .AuthorizationUrl("http://petstore.swagger.wordnik.com/api/oauth/dialog")
                        //    //.TokenUrl("https://tempuri.org/token")
                        //    .Scopes(scopes =>
                        //    {
                        //        scopes.Add("read", "Read access to protected resources");
                        //        scopes.Add("write", "Write access to protected resources");
                        //    });
                        // Set this flag to omit descriptions for any actions decorated with the Obsolete attribute
                        //c.IgnoreObsoleteActions();
                        // Each operation be assigned one or more tags which are then used by consumers for various reasons.
                        // For example, the swagger-ui groups operations according to the first tag of each operation.
                        // By default, this will be controller name but you can use the "GroupActionsBy" option to
                        // override with any value.
                        //
                        //c.GroupActionsBy(apiDesc => apiDesc.HttpMethod.ToString());
                        // You can also specify a custom sort order for groups (as defined by "GroupActionsBy") to dictate
                        // the order in which operations are listed. For example, if the default grouping is in place
                        // (controller name) and you specify a descending alphabetic sort order, then actions from a
                        // ProductsController will be listed before those from a CustomersController. This is typically
                        // used to customize the order of groupings in the swagger-ui.
                        //
                        //c.OrderActionGroupsBy(new DescendingAlphabeticComparer());
                        // Swashbuckle makes a best attempt at generating Swagger compliant JSON schemas for the various types
                        // exposed in your API. However, there may be occasions when more control of the output is needed.
                        // This is supported through the "MapType" and "SchemaFilter" options:
                        //
                        // Use the "MapType" option to override the Schema generation for a specific type.
                        // It should be noted that the resulting Schema will be placed "inline" for any applicable Operations.
                        // While Swagger 2.0 supports inline definitions for "all" Schema types, the swagger-ui tool does not.
                        // It expects "complex" Schemas to be defined separately and referenced. For this reason, you should only
                        // use the "MapType" option when the resulting Schema is a primitive or array type. If you need to alter a
                        // complex Schema, use a Schema filter.
                        //
                        //c.MapType<ProductType>(() => new Schema { type = "integer", format = "int32" });
                        //
                        // If you want to post-modify "complex" Schemas once they've been generated, across the board or for a
                        // specific type, you can wire up one or more Schema filters.
                        //
                        //c.SchemaFilter<ApplySchemaVendorExtensions>();
                        // Set this flag to omit schema property descriptions for any type properties decorated with the
                        // Obsolete attribute
                        //c.IgnoreObsoleteProperties();
                        // In a Swagger 2.0 document, complex types are typically declared globally and referenced by unique
                        // Schema Id. By default, Swashbuckle does NOT use the full type name in Schema Ids. In most cases, this
                        // works well because it prevents the "implementation detail" of type namespaces from leaking into your
                        // Swagger docs and UI. However, if you have multiple types in your API with the same class name, you'll
                        // need to opt out of this behavior to avoid Schema Id conflicts.
                        //
                        //c.UseFullTypeNameInSchemaIds();
                        // In accordance with the built in JsonSerializer, Swashbuckle will, by default, describe enums as integers.
                        // You can change the serializer behavior by configuring the StringToEnumConverter globally or for a given
                        // enum type. Swashbuckle will honor this change out-of-the-box. However, if you use a different
                        // approach to serialize enums as strings, you can also force Swashbuckle to describe them as strings.
                        //
                        //c.DescribeAllEnumsAsStrings();
                        // Similar to Schema filters, Swashbuckle also supports Operation and Document filters:
                        //
                        // Post-modify Operation descriptions once they've been generated by wiring up one or more
                        // Operation filters.
                        //
                        //c.OperationFilter<AddDefaultResponse>();
                        //
                        // If you've defined an OAuth2 flow as described above, you could use a custom filter
                        // to inspect some attribute on each action and infer which (if any) OAuth2 scopes are required
                        // to execute the operation
                        //
                        //c.OperationFilter<AssignOAuth2SecurityRequirements>();
                        // Post-modify the entire Swagger document by wiring up one or more Document filters.
                        // This gives full control to modify the final SwaggerDocument. You should have a good understanding of
                        // the Swagger 2.0 spec. - https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md
                        // before using this option.
                        //
                        //c.DocumentFilter<ApplyDocumentVendorExtensions>();
                        // If you annonate Controllers and API Types with
                        // Xml comments (http://msdn.microsoft.com/en-us/library/b2s063f7(v=vs.110).aspx), you can incorporate
                        // those comments into the generated docs and UI. You can enable this by providing the path to one or
                        // more Xml comment files.
                        //
                        //c.IncludeXmlComments(GetXmlCommentsPath());
                        // In contrast to WebApi, Swagger 2.0 does not include the query string component when mapping a URL
                        // to an action. As a result, Swashbuckle will raise an exception if it encounters multiple actions
                        // with the same path (sans query string) and HTTP method. You can workaround this by providing a
                        // custom strategy to pick a winner or merge the descriptions for the purposes of the Swagger docs
                        //
                        //c.ResolveConflictingActions(apiDescriptions => apiDescriptions.First());
                    })
                .EnableSwaggerUi(c =>
                    {
                        // Use the "InjectStylesheet" option to enrich the UI with one or more additional CSS stylesheets.
                        // The file must be included in your project as an "Embedded Resource", and then the resource's
                        // "Logical Name" is passed to the method as shown below.
                        //
                        //c.InjectStylesheet(containingAssembly, "Swashbuckle.Dummy.SwaggerExtensions.testStyles1.css");
                        // Use the "InjectJavaScript" option to invoke one or more custom JavaScripts after the swagger-ui
                        // has loaded. The file must be included in your project as an "Embedded Resource", and then the resource's
                        // "Logical Name" is passed to the method as shown above.
                        //
                        //c.InjectJavaScript(thisAssembly, "Swashbuckle.Dummy.SwaggerExtensions.testScript1.js");
                        // The swagger-ui renders boolean data types as a dropdown. By default, it provides "true" and "false"
                        // strings as the possible choices. You can use this option to change these to something else,
                        // for example 0 and 1.
                        //
                        //c.BooleanValues(new[] { "0", "1" });
                        // Use this option to control how the Operation listing is displayed.
                        // It can be set to "None" (default), "List" (shows operations for each resource),
                        // or "Full" (fully expanded: shows operations and their details).
                        //
                        //c.DocExpansion(DocExpansion.List);
                        // Use the CustomAsset option to provide your own version of assets used in the swagger-ui.
                        // It's typically used to instruct Swashbuckle to return your version instead of the default
                        // when a request is made for "index.html". As with all custom content, the file must be included
                        // in your project as an "Embedded Resource", and then the resource's "Logical Name" is passed to
                        // the method as shown below.
                        //
                        //c.CustomAsset("index", containingAssembly, "YourWebApiProject.SwaggerExtensions.index.html");
                        // If your API has multiple versions and you've applied the MultipleApiVersions setting
                        // as described above, you can also enable a select box in the swagger-ui, that displays
                        // a discovery URL for each version. This provides a convenient way for users to browse documentation
                        // for different API versions.
                        //
                        //c.EnableDiscoveryUrlSelector();
                        // If your API supports the OAuth2 Implicit flow, and you've described it correctly, according to
                        // the Swagger 2.0 specification, you can enable UI support as shown below.
                        //
                        //c.EnableOAuth2Support("test-client-id", "test-realm", "Swagger UI");
                    });
        }
    }
}
WebAPI/App_Start/WebApiConfig.cs
New file
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
namespace WebAPI
{
    public static class WebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {
            // Web API é…ç½®å’ŒæœåŠ¡
            GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear();
            // Web API è·¯ç”±
            config.MapHttpAttributeRoutes();
            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );
            //自定义路由:匹配到action
            config.Routes.MapHttpRoute(
                name: "ActionApi",
                routeTemplate: "actionapi/{controller}/{action}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );
        }
    }
}
WebAPI/BLL/WebServer.cs
New file
@@ -0,0 +1,113 @@
using DAL;
using Kingdee.BOS.WebApi.Client;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
namespace WebAPI.BLL
{
    public class WebServer
    {
        SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM();
        #region  åŸºç¡€èµ„æ–™
        /// <summary>
        /// èŽ·å–ä»“åº“åˆ—è¡¨
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="sErr"></param>
        /// <returns></returns>
        public DataSet GetWarehouseList(string sWhere, ref string sErr)
        {
            DataSet ds = new DataSet();
            ds = oCn.RunProcReturn("select * from h_v_IF_Warehouse " + sWhere, "h_v_IF_Warehouse");
            //DAL.ClsIF_Warehouse_View dal = new DAL.ClsIF_Warehouse_View();
            return ds;
        }
        /// <summary>
        /// èŽ·å–ä»“ä½åˆ—è¡¨
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="sErr"></param>
        /// <returns></returns>
        public DataSet GetStockPlaceList(string sWhere, ref string sErr)
        {
            DataSet ds = new DataSet();
            ds = oCn.RunProcReturn("select * from h_v_IF_StockPlace " + sWhere, "h_v_IF_StockPlace");
            //DAL.ClsIF_StockPlace_View dal = new DAL.ClsIF_StockPlace_View();
            return ds;
        }
        /// <summary>
        /// èŽ·å–éƒ¨é—¨åˆ—è¡¨
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="sErr"></param>
        /// <returns></returns>
        public DataSet GetDepartmentList(string sWhere, ref string sErr)
        {
            DataSet ds = new DataSet();
            ds = oCn.RunProcReturn("select * from h_v_IF_Department " + sWhere, "h_v_IF_Department");
            //DAL.ClsIF_Department_View dal = new DAL.ClsIF_Department_View();
            return ds;
        }
        /// <summary>
        /// èŒå‘˜åˆ—表
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="sErr"></param>
        /// <returns></returns>
        public DataSet GetEmployeeList(string sWhere, ref string sErr)
        {
            DataSet ds = new DataSet();
            ds = oCn.RunProcReturn("select * from h_v_IF_Emp " + sWhere, "h_v_IF_Emp");
            //DAL.ClsIF_Employee_View dal = new DAL.ClsIF_Employee_View();
            return ds;
        }
        /// <summary>
        /// ä¾›åº”商列表
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="sErr"></param>
        /// <returns></returns>
        public DataSet GetSupplierList(string sWhere, ref string sErr)
        {
            DataSet ds = new DataSet();
            ds = oCn.RunProcReturn("select * from h_v_IF_Supplier " + sWhere, "h_v_IF_Supplier");
            //DAL.ClsIF_Supplier_View dal = new DAL.ClsIF_Supplier_View();
            return ds;
        }
        /// <summary>
        /// å®¢æˆ·åˆ—表
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="sErr"></param>
        /// <returns></returns>
        public DataSet GetCustomerList(string sWhere, ref string sErr)
        {
            DataSet ds = new DataSet();
            ds = oCn.RunProcReturn("select * from h_v_IF_Customer " + sWhere, "h_v_IF_Customer");
            //DAL.ClsIF_Customer_View dal = new DAL.ClsIF_Customer_View();
            return ds;
        }
        #endregion
        /// <summary>
        /// æ‰“印模板列表
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="sErr"></param>
        /// <returns></returns>
        public DataSet GetOpenTmpList(string sWhere, ref string sErr)
        {
            DataSet ds = new DataSet();
            ds = oCn.RunProcReturn("select * from h_v_IF_OpenTmpList " + sWhere, "h_v_IF_OpenTmpList");
            return ds;
        }
    }
}
WebAPI/Code/Common.cs
New file
@@ -0,0 +1,127 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
/// <summary>
/// Common çš„æ‘˜è¦è¯´æ˜Ž
/// </summary>
public class Common
{
    public Common()
    {
        //
        // TODO: åœ¨æ­¤å¤„添加构造函数逻辑
        //
    }
    public static string DataTableToJSON(DataTable dt)
    {
        try
        {
            string rowsjson = JsonConvert.SerializeObject(dt, new DataTableConverter());
            string json = @"{""Rows"":" + rowsjson + @",""Total"":""" + dt.Rows.Count.ToString() + @"""}";
            return json;
        }
        catch (Exception err)
        {
            return "{Rows:[],Total:0}";
        }
    }
    public static string DataTableToJSON(DataTable dt,Int64 HRows)
    {
        try
        {
            string rowsjson = JsonConvert.SerializeObject(dt, new DataTableConverter());
            string json = @"{""Rows"":" + rowsjson + @",""Total"":""" + HRows.ToString() + @"""}";
            return json;
        }
        catch (Exception err)
        {
            return "{Rows:[],Total:0}";
        }
    }
    public static Int64 GetRowTotal(string ViewName,string sWhere,ref string sErr)
    {
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        DataSet dsTotal;
        try
        {
            Int64 RowTotal = 0;
            dsTotal = oCn.RunProcReturn("select count(1) HRows from " + ViewName + " " + sWhere + " ", "gy_czygl");
            if (dsTotal == null || dsTotal.Tables[0].Rows.Count == 0)
            {
                RowTotal = 0;
            }
            else
            {
                RowTotal = DBUtility.ClsPub.isLong(dsTotal.Tables[0].Rows[0][0]);
            }
            return RowTotal;
        }
        catch (Exception err)
        {
            sErr = err.Message;
            return 0;
        }
    }
    /// <summary>
    /// SQL字符转换 åŽ»æŽ‰ ç‰¹æ®Šå­—符
    /// </summary>
    /// <returns></returns>
    public static bool SQLtoChange(string OldSQL,ref string ViewSQL,ref string ProcSQL)
    {
        try
        {
            ViewSQL = OldSQL.Replace("^^", "'");
            ViewSQL = ViewSQL.Replace("^*", "%");
            ///////////////////////////
            ProcSQL = OldSQL.Replace("^^", "''");
            ProcSQL = ProcSQL.Replace("^*", "%");
            return true;
        }
        catch (Exception e)
        {
            return false;
        }
    }
    public static string GetSession()
    {
        try
        {
            string s = System.Web.HttpContext.Current.Session["HUserName"].ToString();
            return s;
        }
        catch (Exception e)
        {
            return e.Message;
        }
    }
    public static bool HasSession()
    {
        try
        {
            string s = System.Web.HttpContext.Current.Session["HUserName"].ToString();
            if (s.Trim().Length == 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }
        catch (Exception e)
        {
            return false;
        }
    }
}
WebAPI/Code/Test2.cs
New file
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebAPI.Code
{
    public class Test2
    {
        public int SOrderid;
        public long HMainid;
        public long HSupid;
        public string HDate;
        public string HMaterNumber;
        public string HMaterName;
        public string HMaterModel;
        public string HUnitName;
        public long HQty;
        public long HPrice;
        public long HMoney;
        public string HMTONO;
        public string HDate2;
    }
}
WebAPI/Code/TestDAL.cs
New file
@@ -0,0 +1,78 @@
using SQLHelper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebAPI.Code
{
    public class TestDAL : DBUtility.ClsXt_BaseBill
    {
        public Model.ClsCg_POInStockBillMain omodel = new Model.ClsCg_POInStockBillMain();
        public List<Model.ClsCg_POInStockBillSub> DetailColl = new List<Model.ClsCg_POInStockBillSub>();
        public override bool AddBill(ref string sReturn)
        {
            try
            {
                //得到mainid
                omodel.HInterID = DBUtility.ClsPub.CreateBillID("1103", ref DBUtility.ClsPub.sExeReturnInfo);
                //若MAINDI重复则重新获取
                oCn.BeginTran();
                //主表
                oCn.RunProc("Insert Into Cg_POInStockBillMain     " +
                        "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
                        ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
                        ",HAddress,HSupID,HCurID,HWHID,HExRate" +
                        ",HEmpID,HManagerID,HDeptID,HExplanation,HInnerBillNo,HMainSourceBillType,HMainSourceBillNo,HMainSourceEntryID,HMainSourceInterID" +
                        ",HBillStatus,HCheckItemNowID,HCheckItemNextID,HCheckFlowID,HBacker,HBackDate) " +
                        " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
                        ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
                        ",'" + omodel.HAddress + "'," + omodel.HSupID.ToString() + "," + omodel.HCurID.ToString() + "," + omodel.HWHID.ToString() + "," + omodel.HExRate.ToString() +
                        ", " + omodel.HEmpID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "','" + omodel.HMainSourceBillType + "','" + omodel.HMainSourceBillNo + "'," + omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID +
                        "," + omodel.HBillStatus + "," + omodel.HCheckItemNowID + "," + omodel.HCheckItemNextID + "," + omodel.HCheckFlowID + ",'','" + omodel.HBackDate + "') ");
                //插入子表
                foreach (Model.ClsCg_POInStockBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into Cg_POInStockBillSub " +
                      " (HInterID,HEntryID,HMaterID,HUnitID" +
                      ",HDate,HQty,HCheckQty,HPassQty,HBadQty,HPrice" +
                      ",HMoney,HWHID,HStatus,HSPID,HCloseMan,HEntryCloseDate" +
                      ",HCloseType,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
                      ",HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo,HRelationQty,HRelationMoney" +
                      ",HPropertyID,HSecUnitID,HSecUnitRate,HTaxPrice,HTaxMoney,HMainSourceInterID,HBatChNo" +
                      ",HAuxPropID,HMTONo,HPlanMode,HERPInterID,HERPEntryID,HReturnedQty,HDetailID) values("
                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HMaterID + "," + oSub.HUnitID +
                      ",'" + oSub.HDate.ToString() + "'," + oSub.HQty + "," + oSub.HCheckQty + "," + oSub.HPassQty + "," + oSub.HBadQty.ToString() + "," + oSub.HPrice +
                      "," + oSub.HMoney + "," + oSub.HWHID + "," + oSub.HStatus + "," + oSub.HSPID + ",'','" + oSub.HEntryCloseDate.ToString() +
                      "',0,''," + oSub.HSourceInterID + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo.ToString() + "','" + oSub.HSourceBillType.ToString() +
                      "'," + oSub.HPOOrderInterID + ","+ oSub.HPOOrderEntryID + ",'" + oSub.HPOOrderBillNo.ToString() + "'," + oSub.HRelationQty + "," + oSub.HRelationMoney +
                      "," + oSub.HPropertyID + ",0," + oSub.HSecUnitRate + "," + oSub.HTaxPrice + "," + oSub.HTaxMoney + "," + oSub.HMainSourceInterID + ",'" + oSub.HBatChNo +
                      "'," + oSub.HAuxPropID + ",'" + oSub.HMTONo.ToString() + "'," + oSub.HPlanMode + "," + oSub.HERPInterID + "," + oSub.HERPEntryID + "," + oSub.HReturnedQty + "," + oSub.HDetailID +
                      ") ");
                }
                //
                //foreach (Model.ClsCg_POInStockBillSub oSub in DetailColl)
                //{
                //    Ds = oCn.RunProcReturn("exec h_p_Cg_POInStockBill_Qty " + oSub.HICMOInterID, "");
                //    if (Ds.Tables[0].Rows.Count == 0)
                //        return;
                //    if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y")
                //    {
                //        sReturn = "汇报数量超过计划数量!不允许保存";
                //        return false;
                //    }
                //}
                //
                sReturn = "新增单据成功!";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
    }
}
WebAPI/Controllers/BarCodeController.cs
New file
@@ -0,0 +1,1167 @@
using DBUtility;
using Newtonsoft.Json.Linq;
using SQLHelper;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;
using System.Web.Script.Serialization;
using WebAPI.Code;
using WebAPI.Models;
namespace WebAPI.Controllers
{
    public class BarCodeController : ApiController
    {
        private JsonResult objJsonResult = new JsonResult();
        private json objjson = new json();
        public T ScriptDeserialize<T>(string strJson)
        {
            JavaScriptSerializer js = new JavaScriptSerializer();
            return js.Deserialize<T>(strJson);
        }
        /// <summary>
        /// æ›´æ–°æ‰“印次数
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="msg2"></param>
        /// <returns></returns>
        [Route("UpdateBarcodePrintQty")]
        [HttpPost]
        public object UpdateBarcodePrintQty([FromBody]JObject msg)
        {
            var _value = msg["msg"].ToString();
            string msg1 = _value.ToString();
            try
            {
                SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM();
                oCn.RunProc("exec H_p_SRM_BarCodeBill_PrintQty '" + msg1 + "'");
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "更新打印次数成功!";
                objJsonResult.data = 1;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "更新打印次数失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        [Route("GetBarcodeSaveBillVarieties")]
        [HttpPost]
        /// <summary>
        /// ç”Ÿæˆæ¡ç ï¼ˆå“ç§ç ï¼‰
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="msg2"></param>
        /// <returns></returns>
        public object GetBarcodeSaveBill_Varieties([FromBody]JObject msg)
        {
            var _value = msg["msg"].ToString();
            string msg1 = _value.ToString();
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString();
            string UserName = "";
            ListModels oListModels = new ListModels();
            try
            {
                List<Model.ClsCg_POInStockBillMain> lsmain = new List<Model.ClsCg_POInStockBillMain>();
                msg2 = msg2.Replace("\\", "");
                msg2 = msg2.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_POInStockMain(msg2);
                foreach (Model.ClsCg_POInStockBillMain oItem in lsmain)
                {
                    UserName = oItem.HMaker;
                }
                DAL.ClsWeb_BarCodeBill oBill = new DAL.ClsWeb_BarCodeBill();
                msg3 = msg3.Substring(1, msg3.Length - 2);
                msg3 = msg3.Replace("\\", "");
                msg3 = msg3.Replace("\n", "");  //\n
                List<Model.ClsGy_MaterialList_WMS_Model> ls = new List<Model.ClsGy_MaterialList_WMS_Model>();
                List<Model.ClsGy_BarCodeBill_WMS_Model> ls2 = new List<Model.ClsGy_BarCodeBill_WMS_Model>();
                ls = oListModels.getObjectByJson_MaterialList(msg3);
                foreach (Model.ClsGy_MaterialList_WMS_Model oItemSub in ls)
                {
                    if (oBill.CheckBarCode(oItemSub.HSourceInterID, oItemSub.HSourceEntryID) == false)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "已存在条码,不允许重复生成!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (msg2 != string.Empty)
                    {
                        if (oItemSub.HBQty == 0 || oItemSub.HMinQty == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "条码张数不能为0!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                long linterid = Pub_Class.ClsPub.CreateBillID_SRMProd("8888", ref DBUtility.ClsPub.sExeReturnInfo);
                string TM = "";             //条码
                string HNumber = "";        //物料代码
                double HSumQty = 0;         //产品数量
                double HMinQty = 0;         //最小包装数
                int HBQty = 0;              //箱数
                double HQty = 0;            //数量
                string HMTONO = "";
                string WeiShu = ""; //尾数
                //string sKFDate = DateTime.Now.ToString("yyyy-MM-dd");
                DataSet Ds;
                SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM();
                foreach (Model.ClsGy_MaterialList_WMS_Model oItemSub in ls)
                {
                    if (ClsPub.isLong(oItemSub.HMaterID) != 0)
                    {
                        HNumber = oItemSub.HMaterID.ToString();
                        HMTONO=ClsPub.isStrNull(oItemSub.HMTONO);
                        //
                        HQty = ClsPub.isDoule(oItemSub.HQty);
                        HBQty = ClsPub.isInt(oItemSub.HBQty);
                        HMinQty = ClsPub.isDoule(oItemSub.HMinQty);
                        HSumQty = ClsPub.isDoule(oItemSub.HQty);
                        for (int i = 0; i < HBQty; i++)
                        {
                            //==================================
                            TM = "SRM" + HNumber + ";" + HMTONO;
                            if (HSumQty - HMinQty > 0)
                            {
                                WeiShu = "";
                                HSumQty = HSumQty - HMinQty;
                            }
                            else
                            {
                                if (HSumQty == HMinQty)
                                {
                                    WeiShu = "";
                                }
                                else
                                {
                                    WeiShu = "尾数";
                                }
                                HMinQty = HSumQty;
                            }
                            Model.ClsGy_BarCodeBill_WMS_Model bar = new Model.ClsGy_BarCodeBill_WMS_Model();
                            bar.HBarCode = TM;
                            bar.HMaterID = oItemSub.HMaterID;
                            bar.HUnitID = oItemSub.HUnitID;
                            bar.HQty = HMinQty;
                            bar.HEndQty = WeiShu;
                            bar.HBatchNo = oItemSub.HBatchNo;
                            bar.HKFDate = oItemSub.HKFDate;
                            bar.HKFDQDate = oItemSub.HKFDQDate;
                            bar.HKFPeriod = DBUtility.ClsPub.isInt(oItemSub.HKFPeriod);
                            bar.HSourceBillNo = oItemSub.HSourceBillNo;
                            bar.HSourceInterID = oItemSub.HSourceInterID;
                            bar.HSourceEntryID = oItemSub.HSourceEntryID;
                            bar.HSourceBillType = oItemSub.HSourceBillType;
                            bar.HSupID = oItemSub.HSupID;
                            bar.HMinQty = oItemSub.HMinQty;
                            bar.HMTONO = oItemSub.HMTONO;
                            ls2.Add(bar);
                        }
                    }
                }
                string HBarCode = "";
                string HBarCodeType = "";
                Int64 HMaterID = 0;
                Int64 HUnitID = 0;
                double HQty2 = 0;
                string HBatchNo = "";
                Int64 HSupID = 0;
                Int64 HGroupID = 0;
                Int64 HPrintQty = 0;
                Int64 HSourceInterID = 0;
                Int64 HSourceEntryID = 0;
                string HSourceBillNo = "";
                string HSourceBillType = "";
                Int64 HKFPeriod = 0;
                string HKFDate = "";
                string HKFDQDate = "";
                string HWei = "";
                string HMTONO2 = "";
                oCn.BeginTran();
                foreach (Model.ClsGy_BarCodeBill_WMS_Model oItemSub in ls2)
                {
                    HBarCode = ClsPub.isStrNull(oItemSub.HBarCode);
                    HMTONO2 = ClsPub.isStrNull(oItemSub.HMTONO);
                    HBarCodeType = "品种码";
                    HMaterID = ClsPub.isLong(oItemSub.HMaterID);
                    HUnitID = ClsPub.isLong(oItemSub.HUnitID);
                    HQty2 = ClsPub.isDoule(oItemSub.HQty);
                    HBatchNo = ClsPub.isStrNull(oItemSub.HBatchNo);
                    HSupID = ClsPub.isInt(oItemSub.HSupID);
                    HKFPeriod = ClsPub.isInt(oItemSub.HKFPeriod);
                    HKFDate = ClsPub.isStrNull(oItemSub.HKFDate);
                    HKFDQDate = ClsPub.isStrNull(oItemSub.HKFDQDate);
                    HSourceInterID = ClsPub.isLong(oItemSub.HSourceInterID);
                    HSourceEntryID = ClsPub.isLong(oItemSub.HSourceEntryID);
                    HSourceBillNo = ClsPub.isStrNull(oItemSub.HSourceBillNo);
                    HSourceBillType = ClsPub.isStrNull(oItemSub.HSourceBillType);
                    HWei = ClsPub.isStrNull(oItemSub.HEndQty);
                    oCn.RunProc("insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" +
                                ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" +
                                ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO " +
                                ") values ("
                                + linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate
                                + "','" + HBatchNo + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1"
                                + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO2 + "')");
                    //oBill.SaveBarCode(DBUtility.ClsPub.isLong(oItemSub.HMaterID), DBUtility.ClsPub.isLong(oItemSub.HUnitID), DBUtility.ClsPub.isLong(oItemSub.HSupID), DBUtility.ClsPub.isLong(oItemSub.HBQty)
                    //, DBUtility.ClsPub.isLong(oItemSub.HMinQty), DBUtility.ClsPub.isLong(oItemSub.HSourceInterID), DBUtility.ClsPub.isLong(oItemSub.HSourceEntryID)
                    //, DBUtility.ClsPub.isStrNull(oItemSub.HSourceBillNo), DBUtility.ClsPub.isStrNull(oItemSub.HSourceBillType), DBUtility.ClsPub.isStrNull(oItemSub.HMTONO), DBUtility.ClsPub.isLong(oItemSub.HQty));
                }
                //暂时只回填关联数量
                oCn.RunProc("exec H_p_SRM_BarCodeBill_Update_UpdateBillRelateData " + linterid.ToString());
                oCn.Commit();
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "" + e.Message + DBUtility.ClsPub.sExeReturnInfo;
                objJsonResult.data = null;
                return objJsonResult;
            }
            objJsonResult.code = "0";
            objJsonResult.count = 1;
            objJsonResult.Message = "生成条码成功!";
            WebAPIController.Add_Log("条码下推", UserName, "生成条码");
            objJsonResult.data = null;
            return objJsonResult;
        }
        [Route("GetBarcodeSaveBillOnly")]
        [HttpPost]
        /// <summary>
        /// ç”Ÿæˆæ¡ç å”¯ä¸€ç 
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="msg2"></param>
        /// <returns></returns>
        public object GetBarcodeSaveBill_Only([FromBody]JObject msg)
        {
            var _value = msg["msg"].ToString();
            string msg1 = _value.ToString();
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString();
            string UserName = "";
            ListModels oListModels = new ListModels();
            try
            {
                List<Model.ClsCg_POInStockBillMain> lsmain = new List<Model.ClsCg_POInStockBillMain>();
                msg2 = msg2.Replace("\\", "");
                msg2 = msg2.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_POInStockMain(msg2);
                foreach (Model.ClsCg_POInStockBillMain oItem in lsmain)
                {
                    UserName = oItem.HMaker;
                }
                DAL.ClsWeb_BarCodeBill oBill = new DAL.ClsWeb_BarCodeBill();
                msg3 = msg3.Substring(1, msg3.Length - 2);
                msg3 = msg3.Replace("\\", "");
                msg3 = msg3.Replace("\n", "");  //\n
                List<Model.ClsGy_MaterialList_WMS_Model> ls = new List<Model.ClsGy_MaterialList_WMS_Model>();
                List<Model.ClsGy_BarCodeBill_WMS_Model> ls2 = new List<Model.ClsGy_BarCodeBill_WMS_Model>();
                ls = oListModels.getObjectByJson_MaterialList(msg3);
                foreach (Model.ClsGy_MaterialList_WMS_Model oItemSub in ls)
                {
                    if (oBill.CheckBarCode(oItemSub.HSourceInterID, oItemSub.HSourceEntryID) == false)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "已存在条码,不允许重复生成!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (msg2 != string.Empty)
                    {
                        if (oItemSub.HBQty == 0 || oItemSub.HMinQty == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "条码张数不能为0!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                //int i = 1;
                long linterid = Pub_Class.ClsPub.CreateBillID_SRMProd("8888", ref DBUtility.ClsPub.sExeReturnInfo);
                int LSHlen = 6;             //流水号长度
                int SumLen = 10;            //总长度
                string TM = "";             //条码
                string HNumber = "";        //物料代码
                double HSumQty = 0;         //产品数量
                double HMinQty = 0;         //最小包装数
                int HBQty = 0;              //箱数
                double HQty = 0;            //数量
                int LSH = 0;                //流水号
                string LSH2 = "";           //流水号转换成字符
                string sDate = "";            //日期
                string sYear = "";          //å¹´
                string sPeriod = "";        //月
                string sDay = "";            //日
                int k = 0;
                string WeiShu = ""; //尾数
                //string sKFDate = DateTime.Now.ToString("yyyy-MM-dd");
                DataSet Ds;
                SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM();
                Ds = oCn.RunProcReturn("exec GetLSH '" + DateTime.Today + "'", "GetLSH");
                LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
                foreach (Model.ClsGy_MaterialList_WMS_Model oItemSub in ls)
                {
                    if (ClsPub.isLong(oItemSub.HMaterID) != 0)
                    {
                        HNumber = oItemSub.HMaterID.ToString();
                        //
                        HQty =ClsPub.isDoule(oItemSub.HQty);
                        HBQty =  ClsPub.isInt(oItemSub.HBQty);
                        HMinQty = ClsPub.isDoule(oItemSub.HMinQty);
                        HSumQty = ClsPub.isDoule(oItemSub.HQty);
                        for (int i = 0; i < HBQty; i++)
                        {
                            LSH = LSH + 1;
                            LSH2 = LSH.ToString();
                            while (LSH2.Length < LSHlen)  //如果流水号小于6位数前面补0
                            {
                                LSH2 = "0" + LSH2;
                            }
                            sDate = ClsPub.GetServerDate(0);
                            sYear = ClsPub.isDate(sDate).Year.ToString().Substring(2, 2);
                            sPeriod = "0" + ClsPub.isDate(sDate).Month.ToString();
                            sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2);
                            sDay = "0" + ClsPub.isDate(sDate).Day.ToString();
                            sDay = sDay.Substring(sDay.Length - 2, 2);
                            //==================================
                            TM = HNumber + sYear + sPeriod + sDay + LSH2;
                            while (TM.Length < SumLen)  //如果条码小于12位数前面补0
                            {
                                TM = "0" + TM;
                            }
                           TM = "SRM" + TM;
                            //TM = "B" + TM;
                            if (HSumQty - HMinQty > 0)
                            {
                                WeiShu = "";
                                HSumQty = HSumQty - HMinQty;
                            }
                            else
                            {
                                if (HSumQty == HMinQty)
                                {
                                    WeiShu = "";
                                }
                                else
                                {
                                    WeiShu = "尾数";
                                }
                                HMinQty = HSumQty;
                            }
                            Model.ClsGy_BarCodeBill_WMS_Model bar = new Model.ClsGy_BarCodeBill_WMS_Model();
                            bar.HBarCode = TM;
                            bar.HMaterID = oItemSub.HMaterID;
                            bar.HUnitID = oItemSub.HUnitID;
                            bar.HQty = HMinQty;
                            bar.HEndQty = WeiShu;
                            bar.HBatchNo = oItemSub.HBatchNo;
                            bar.HKFDate = oItemSub.HKFDate;
                            bar.HKFDQDate = oItemSub.HKFDQDate;
                            bar.HKFPeriod = DBUtility.ClsPub.isInt(oItemSub.HKFPeriod);
                            bar.HSourceBillNo = oItemSub.HSourceBillNo;
                            bar.HSourceInterID = oItemSub.HSourceInterID;
                            bar.HSourceEntryID = oItemSub.HSourceEntryID;
                            bar.HSourceBillType = oItemSub.HSourceBillType;
                            bar.HSupID = oItemSub.HSupID;
                            bar.HMinQty = oItemSub.HMinQty;
                            bar.HMTONO = oItemSub.HMTONO;
                            ls2.Add(bar);
                        }
                    }
                }
                string HBarCode = "";
                string HBarCodeType = "";
                Int64 HMaterID = 0;
                Int64 HUnitID = 0;
                double HQty2 = 0;
                string HBatchNo = "";
                Int64 HSupID = 0;
                Int64 HGroupID = 0;
                Int64 HPrintQty = 0;
                Int64 HSourceInterID = 0;
                Int64 HSourceEntryID = 0;
                string HSourceBillNo = "";
                string HSourceBillType = "";
                Int64 HKFPeriod = 0;
                string HKFDate = "";
                string HKFDQDate = "";
                string HWei = "";
                string HMTONO = "";
                oCn.BeginTran();
                foreach (Model.ClsGy_BarCodeBill_WMS_Model oItemSub2 in ls2)
                {
                    if (ClsPub.isLong(oItemSub2.HMaterID) != 0)
                    {
                        HBarCode = oItemSub2.HBarCode;
                        HMTONO = oItemSub2.HMTONO;
                        HBarCodeType = "唯一码";
                        HMaterID = ClsPub.isLong(oItemSub2.HMaterID);
                        HUnitID = ClsPub.isLong(oItemSub2.HUnitID);
                        HQty2 = ClsPub.isDoule(oItemSub2.HQty);
                        HBatchNo = ClsPub.isStrNull(oItemSub2.HBatchNo);
                        HSupID = ClsPub.isInt(oItemSub2.HSupID);
                        HKFPeriod = ClsPub.isInt(oItemSub2.HKFPeriod);
                        HKFDate = ClsPub.isStrNull(oItemSub2.HKFDate);
                        HKFDQDate = ClsPub.isStrNull(oItemSub2.HKFDQDate);
                        HSourceInterID = ClsPub.isLong(oItemSub2.HSourceInterID);
                        HSourceEntryID = ClsPub.isLong(oItemSub2.HSourceEntryID);
                        HSourceBillNo = ClsPub.isStrNull(oItemSub2.HSourceBillNo);
                        HSourceBillType = ClsPub.isStrNull(oItemSub2.HSourceBillType);
                        HWei = ClsPub.isStrNull(oItemSub2.HEndQty);
                        oCn.RunProc("insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" +
                                    ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" +
                                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO " +
                                    ") values ("
                                    + linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate
                                    + "','" + HBatchNo + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1"
                                    + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')");
                        oCn.RunProc("exec setLSH '" + DateTime.Today + "'");
                    }
                }
                //暂时只回填关联数量
                oCn.RunProc("exec H_p_SRM_BarCodeBill_Update_UpdateBillRelateData " + linterid.ToString());
                oCn.Commit();
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "" + e.Message + DBUtility.ClsPub.sExeReturnInfo;
                objJsonResult.data = null;
                return objJsonResult;
            }
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "生成条码成功!";
                WebAPIController.Add_Log("条码下推", UserName, "生成条码");
                objJsonResult.data = null;
                return objJsonResult;
            }
        [Route("GetBarcodeSaveBillBox")]
        [HttpPost]
        /// <summary>
        /// ç”Ÿæˆæ¡ç  å†…外箱
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="msg2"></param>
        /// <returns></returns>
        public object GetBarcodeSaveBill_Box([FromBody]JObject msg)
        {
            var _value = msg["msg"].ToString();
            string msg1 = _value.ToString();
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString();
            string UserName = "";
            ListModels oListModels = new ListModels();
            try
            {
                List<Model.ClsCg_POInStockBillMain> lsmain = new List<Model.ClsCg_POInStockBillMain>();
                msg2 = msg2.Replace("\\", "");
                msg2 = msg2.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_POInStockMain(msg2);
                foreach (Model.ClsCg_POInStockBillMain oItem in lsmain)
                {
                    UserName = oItem.HMaker;
                }
                DAL.ClsWeb_BarCodeBill oBill = new DAL.ClsWeb_BarCodeBill();
                msg3 = msg3.Substring(1, msg3.Length - 2);
                msg3 = msg3.Replace("\\", "");
                msg3 = msg3.Replace("\n", "");  //\n
                List<Model.ClsGy_MaterialList_WMS_Model> ls = new List<Model.ClsGy_MaterialList_WMS_Model>();
                List<Model.ClsGy_BarCodeBill_WMS_Model> ls2 = new List<Model.ClsGy_BarCodeBill_WMS_Model>();
                List<Model.ClsGy_BarCodeBill_WMS_Model> ls3 = new List<Model.ClsGy_BarCodeBill_WMS_Model>();
                ls = oListModels.getObjectByJson_MaterialList(msg3);
                foreach (Model.ClsGy_MaterialList_WMS_Model oItemSub in ls)
                {
                    if (oBill.CheckBarCode(oItemSub.HSourceInterID, oItemSub.HSourceEntryID) == false)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "已存在条码,不允许重复生成!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (msg2 != string.Empty)
                    {
                        if (oItemSub.HBQty == 0 || oItemSub.HMinQty == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "内箱包装数不能为0!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (oItemSub.HWBQty == 0 || oItemSub.HWXQty == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "外箱包装数不能为0!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                long linterid = Pub_Class.ClsPub.CreateBillID_SRMProd("8888", ref DBUtility.ClsPub.sExeReturnInfo);
            int LSHlen = 6;             //流水号长度
            int SumLen = 10;            //总长度
            string TM = "";             //条码
            string HNumber = "";        //物料代码
            double HSumQty = 0;         //产品数量
            double HMinQty = 0;         //最小包装数
            int HBQty = 0;              //箱数
            double HQty = 0;            //数量
            int LSH = 0;                //流水号
            string LSH2 = "";           //流水号转换成字符
            string sDate = "";            //日期
            string sYear = "";          //å¹´
            string sPeriod = "";        //月
            string sDay = "";            //日
            string WeiShu = ""; //尾数
            DataSet Ds;
            SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM();
            Ds = oCn.RunProcReturn("exec GetLSH '" + DateTime.Today + "'", "GetLSH");
            LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
             foreach (Model.ClsGy_MaterialList_WMS_Model oItemSub in ls)
            {
                if (ClsPub.isLong(oItemSub.HMaterID) != 0)
                {
                    HNumber = oItemSub.HMaterID.ToString();
                    //HNumber = HNumber.Replace(".", "");
                    //
                        //HQty = Math.Ceiling(HBQty + ClsPub.isDoule(oItemSub.HWBQty));
                    HQty = ClsPub.isDoule(oItemSub.HWBQty);
                    HBQty = ClsPub.isInt(oItemSub.HWBQty);
                    HMinQty = ClsPub.isDoule(oItemSub.HWXQty);
                    HSumQty = ClsPub.isDoule(oItemSub.HQty);  //HWXQtyCol
                    for (int i = 0; i < HBQty; i++)
                    {
                        LSH = LSH + 1;
                        LSH2 = LSH.ToString();
                        while (LSH2.Length < LSHlen)  //如果流水号小于6位数前面补0
                        {
                            LSH2 = "0" + LSH2;
                        }
                        sDate = ClsPub.GetServerDate(0);
                        sYear = ClsPub.isDate(sDate).Year.ToString().Substring(2, 2);
                        sPeriod = "0" + ClsPub.isDate(sDate).Month.ToString();
                        sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2);
                        sDay = "0" + ClsPub.isDate(sDate).Day.ToString();
                        sDay = sDay.Substring(sDay.Length - 2, 2);
                        //==================================
                        TM = HNumber + sYear + sPeriod + sDay + LSH2;
                        while (TM.Length < SumLen)  //如果条码小于12位数前面补0
                        {
                            TM = "0" + TM;
                        }
                            //TM = "B" + TM;
                            TM = "SRM" + "B" + TM;
                            if (HSumQty - HMinQty > 0)
                            {
                                WeiShu = "";
                                HSumQty = HSumQty - HMinQty;
                            }
                            else
                            {
                                if (HSumQty == HMinQty)
                                {
                                    WeiShu = "";
                                }
                                else
                                {
                                    WeiShu = "尾数";
                                }
                                HMinQty = HSumQty;
                            }
                        Model.ClsGy_BarCodeBill_WMS_Model bar = new Model.ClsGy_BarCodeBill_WMS_Model();
                        bar.HBarCode = TM;
                        bar.HMaterID = oItemSub.HMaterID;
                        //bar.HMaterNumber = oItemSub.HMaterNumber;
                        //bar.HMaterName = oItemSub.HMaterName;
                        //bar.HMaterModel = oItemSub.HMaterModel;
                      //  bar.HModel2 = oItemSub.HModel;
                        bar.HUnitID = oItemSub.HUnitID;
                        //bar.HUnitNumber2 = oItemSub.HUnitNumber;
                        //bar.HUnitName2 = oItemSub.HUnitName;
                        bar.HQty = HMinQty;
                        bar.HBatchNo = oItemSub.HBatchNo;
                        bar.HKFDate = oItemSub.HKFDate;
                        bar.HKFPeriod = oItemSub.HKFPeriod;
                        bar.HKFDQDate = oItemSub.HKFDQDate;
                        bar.HSourceInterID = oItemSub.HSourceInterID;
                        bar.HSourceEntryID = oItemSub.HSourceEntryID;
                        bar.HSourceBillNo = oItemSub.HSourceBillNo;
                        bar.HSourceBillType = oItemSub.HSourceBillType;
                        bar.HMinQty = oItemSub.HMinQty;
                        bar.HSupID = oItemSub.HSupID;
                        bar.HEndQty = WeiShu;
                        bar.HMTONO = oItemSub.HMTONO;
                        ls2.Add(bar);
                    }
                }
            }
            foreach (Model.ClsGy_BarCodeBill_WMS_Model oItemSub2 in ls2)
            {
                if (ClsPub.isLong(oItemSub2.HMaterID) != 0)
                {
                    long sMaterID = ClsPub.isLong(oItemSub2.HMaterID);
                    Ds = oCn.RunProcReturn("exec GetLSH " + sMaterID.ToString(), "GetLSH");
                    string WeiShu1 = ""; //尾数
                    int SumLen2 = 4;
                    string TM2 = "";
                    double HWXQty = 0;
                    LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]) + 1;
                    //
                    HNumber = oItemSub2.HMaterID.ToString();
                    //HMinQty = ClsPub.isDoule(oItemSub2.HMinQtyCol2].Value);
                    HWXQty = ClsPub.isDoule(oItemSub2.HMinQty);
                    HSumQty = ClsPub.isDoule(oItemSub2.HQty);
                    HBQty = ClsPub.isInt(Math.Ceiling(HSumQty / HWXQty));
                    double NXTMQTY = 0;
                    for (int i = 0; i < HBQty; i++)
                    {
                        if (HSumQty <= 0 || HWXQty <= 0)
                        {
                            break;
                        }
                        if (HSumQty - HWXQty > 0)
                        {
                            WeiShu1 = "";
                            NXTMQTY = HWXQty;
                            HSumQty = HSumQty - HWXQty;
                        }
                        else
                        {
                            if (HSumQty == HWXQty)
                            {
                                WeiShu1 = "";
                            }
                            else
                            {
                                WeiShu1 = "尾数";
                            }
                            NXTMQTY = HSumQty;  //HWXQty
                            HWXQty = HSumQty;
                            HSumQty = 0;
                        }
                        sDate = ClsPub.GetServerDate(0);
                        sYear = ClsPub.isDate(sDate).Year.ToString().Substring(2, 2);
                        sPeriod = "0" + ClsPub.isDate(sDate).Month.ToString();
                        sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2);
                        sDay = "0" + ClsPub.isDate(sDate).Day.ToString();
                        sDay = sDay.Substring(sDay.Length - 2, 2);
                        //
                     //   TM = HNumber + sYear + sPeriod + sDay; //条码
                        //
                        Model.ClsGy_BarCodeBill_WMS_Model bar2 = new Model.ClsGy_BarCodeBill_WMS_Model();
                        TM2 = (i + 1).ToString();
                        while (TM2.Length < SumLen2)  //如果条码小于12位数前面补0
                        {
                            TM2 = "0" + TM2;
                        }
                        bar2.HMaterID = oItemSub2.HMaterID;
                        bar2.HBarCode = oItemSub2.HBarCode + "-" + TM2;
                        bar2.HUnitID = oItemSub2.HUnitID;
                        bar2.HQty = HWXQty;
                        bar2.HBatchNo = DBUtility.ClsPub.isStrNull(oItemSub2.HBatchNo);
                        bar2.HKFDate = DBUtility.ClsPub.isStrNull(oItemSub2.HKFDate);
                        bar2.HKFDQDate = DBUtility.ClsPub.isStrNull(oItemSub2.HKFDQDate);
                        bar2.HKFPeriod = DBUtility.ClsPub.isInt(oItemSub2.HKFPeriod);
                        bar2.HSourceInterID = oItemSub2.HSourceInterID;
                        bar2.HSourceEntryID = oItemSub2.HSourceEntryID;
                        bar2.HSourceBillNo = oItemSub2.HSourceBillNo;
                        bar2.HSourceBillType = oItemSub2.HSourceBillType;
                        bar2.HSupID = oItemSub2.HSupID;
                        bar2.HEndQty = WeiShu1;
                        bar2.HMTONO = oItemSub2.HMTONO;
                        ls3.Add(bar2);
                    }
                }
            }
            string HBarCode = "";
            string HBarCodeType = "";
            Int64 HMaterID = 0;
            Int64 HUnitID = 0;
            double HQty2 = 0;
            string HBatchNo = "";
            Int64 HSupID = 0;
            Int64 HGroupID = 0;
            int HPrintQty = 0;
            Int64 HSourceInterID = 0;
            Int64 HSourceEntryID = 0;
            string HSourceBillNo = "";
            string HSourceBillType = "";
            Int64 HKFPeriod = 0;
            string HKFDate = "";
            string HKFDQDate = "";
            string HWei = "";
            string HMTONO = "";
                oCn.BeginTran();
                foreach (Model.ClsGy_BarCodeBill_WMS_Model oItemSub in ls2)
                {
                    if (ClsPub.isLong(oItemSub.HMaterID) != 0)
                    {
                        HBarCode = oItemSub.HBarCode.ToString();
                        HMTONO = ClsPub.isStrNull(oItemSub.HMTONO);
                        HBarCodeType = "箱号条码";
                        HMaterID = ClsPub.isLong(oItemSub.HMaterID);
                        HUnitID = ClsPub.isLong(oItemSub.HUnitID);
                        HQty2 = ClsPub.isDoule(oItemSub.HQty);
                        HBatchNo = ClsPub.isStrNull(oItemSub.HBatchNo);
                        HSupID = ClsPub.isInt(oItemSub.HSupID);
                        HKFPeriod = ClsPub.isInt(oItemSub.HKFPeriod);
                        HKFDate = ClsPub.isStrNull(oItemSub.HKFDate);
                        HKFDQDate = ClsPub.isStrNull(oItemSub.HKFDQDate);
                        HSourceInterID = ClsPub.isLong(oItemSub.HSourceInterID);
                        HSourceEntryID = ClsPub.isLong(oItemSub.HSourceEntryID);
                        HSourceBillNo = ClsPub.isStrNull(oItemSub.HSourceBillNo);
                        HSourceBillType = ClsPub.isStrNull(oItemSub.HSourceBillType);
                        HWei = ClsPub.isStrNull(oItemSub.HEndQty);
                        oCn.RunProc("insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" +
                                    ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" +
                                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO " +
                                    ") values ("
                                    + linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate
                                    + "','" + HBatchNo + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1"
                                    + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')");
                        oCn.RunProc("exec setLSH '" + DateTime.Today + "'");
                    }
                }
                foreach (Model.ClsGy_BarCodeBill_WMS_Model oItemSub in ls3)
                {
                    if (ClsPub.isLong(oItemSub.HMaterID) != 0)
                    {
                        HBarCode = oItemSub.HBarCode.ToString();
                        HMTONO = ClsPub.isStrNull(oItemSub.HMTONO);
                        HBarCodeType = "箱号内条码";
                        HMaterID = ClsPub.isLong(oItemSub.HMaterID);
                        HUnitID = ClsPub.isLong(oItemSub.HUnitID);
                        HQty2 = ClsPub.isDoule(oItemSub.HQty);
                        HBatchNo = ClsPub.isStrNull(oItemSub.HBatchNo);
                        HSupID = ClsPub.isInt(oItemSub.HSupID);
                        HKFPeriod = ClsPub.isInt(oItemSub.HKFPeriod);
                        HKFDate = ClsPub.isStrNull(oItemSub.HKFDate);
                        HKFDQDate = ClsPub.isStrNull(oItemSub.HKFDQDate);
                        HSourceInterID = ClsPub.isLong(oItemSub.HSourceInterID);
                        HSourceEntryID = ClsPub.isLong(oItemSub.HSourceEntryID);
                        HSourceBillNo = ClsPub.isStrNull(oItemSub.HSourceBillNo);
                        HSourceBillType = ClsPub.isStrNull(oItemSub.HSourceBillType);
                        HWei = ClsPub.isStrNull(oItemSub.HEndQty);
                        oCn.RunProc("insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" +
                                    ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" +
                                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO " +
                                    ") values ("
                                    + linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate
                                    + "','" + HBatchNo + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1"
                                    + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')");
                    }
                }
                //暂时只回填关联数量
                oCn.RunProc("exec H_p_SRM_BarCodeBill_Update_UpdateBillRelateData " + linterid.ToString());
                oCn.Commit();
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "" + e.Message + DBUtility.ClsPub.sExeReturnInfo;
                objJsonResult.data = null;
                return objJsonResult;
            }
            objJsonResult.code = "0";
            objJsonResult.count = 1;
            objJsonResult.Message = "生成条码成功!";
            WebAPIController.Add_Log("条码下推", UserName, "生成条码");
            objJsonResult.data = null;
            return objJsonResult;
        }
        [Route("GetHBarCodeShowBillSub2")]
        [HttpGet]
        /// <summary>
        /// æ¡ç åˆ—表
        /// </summary>
        /// <param name="sMsg"></param>
        /// <returns></returns>
        public object GetHBarCodeShowBillSub2(string sMsg)
        {
            try
            {
                DataSet ds;
                string s = "";
                string ShowItem = " * ";//显示的字段
                if (DBUtility.ClsPub.isLong(sMsg) == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                DAL.ClsWeb_BarCodeBill oClsWeb_BarCodeBill = new DAL.ClsWeb_BarCodeBill();
                ds = oClsWeb_BarCodeBill.ShowBillSub4(DBUtility.ClsPub.isLong(sMsg), ShowItem, ref DBUtility.ClsPub.sExeReturnInfo);
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败" + DBUtility.ClsPub.sExeReturnInfo;
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取单据表体失败:" + e.Message;
                objjson.data = null;
                return objjson;
            }
        }
        [Route("GetHBarCodeShowBillSub3")]
        [HttpGet]
        /// <summary>
        /// æ¡ç åˆ—表
        /// </summary>
        /// <param name="sMsg"></param>
        /// <returns></returns>
        public object GetHBarCodeShowBillSub3(string sMsg)
        {
            try
            {
                DataSet ds;
                string s = "";
                string ShowItem = " * ";//显示的字段
                if (DBUtility.ClsPub.isLong(sMsg) == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                DAL.ClsWeb_BarCodeBill oClsWeb_BarCodeBill = new DAL.ClsWeb_BarCodeBill();
                ds = oClsWeb_BarCodeBill.ShowBillSub5(DBUtility.ClsPub.isLong(sMsg), ShowItem, ref DBUtility.ClsPub.sExeReturnInfo);
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败" + DBUtility.ClsPub.sExeReturnInfo;
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取单据表体失败:" + e.Message;
                objjson.data = null;
                return objjson;
            }
        }
        [Route("GetHBarCodeShowBillSub4")]
        [HttpGet]
        /// <summary>
        /// æ¡ç åˆ—表
        /// </summary>
        /// <param name="sMsg"></param>
        /// <returns></returns>
        public object GetHBarCodeShowBillSub4(string sMsg)
        {
            try
            {
                DataSet ds;
                string s = "";
                string ShowItem = " * ";//显示的字段
                if (DBUtility.ClsPub.isLong(sMsg) == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                DAL.ClsWeb_BarCodeBill oClsWeb_BarCodeBill = new DAL.ClsWeb_BarCodeBill();
                ds = oClsWeb_BarCodeBill.ShowBillSub6(DBUtility.ClsPub.isLong(sMsg), ShowItem, ref DBUtility.ClsPub.sExeReturnInfo);
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败" + DBUtility.ClsPub.sExeReturnInfo;
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取单据表体失败:" + e.Message;
                objjson.data = null;
                return objjson;
            }
        }
        [Route("GetHBarCodeShowBillMain")]
        [HttpGet]
        /// <summary>
        /// æ¡ç ç”Ÿæˆè¡¨å¤´
        /// </summary>
        /// <param name="sMsg"></param>
        /// <returns></returns>
        public object GetHBarCodeShowBillMain(string sMsg)
        {
            try
            {
                DataSet ds;
                string s = "";
                string ShowItem = " * ";//显示的字段
                if (DBUtility.ClsPub.isLong(sMsg) == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                DAL.ClsWeb_BarCodeBill oClsWeb_BarCodeBill = new DAL.ClsWeb_BarCodeBill();
                ds = oClsWeb_BarCodeBill.ShowBillMain1(DBUtility.ClsPub.isLong(sMsg), ShowItem, ref DBUtility.ClsPub.sExeReturnInfo);
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        [Route("GetHBarCodeShowBillSub")]
        [HttpGet]
        /// <summary>
        /// æ¡ç ç”Ÿæˆè¡¨ä½“
        /// </summary>
        /// <param name="sMsg"></param>
        /// <returns></returns>
        public object GetHBarCodeShowBillSub(string sMsg)
        {
            try
            {
                DataSet ds;
                string s = "";
                string ShowItem = " * ";//显示的字段
                if (DBUtility.ClsPub.isLong(sMsg) == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                DAL.ClsWeb_BarCodeBill oClsWeb_BarCodeBill = new DAL.ClsWeb_BarCodeBill();
                ds = oClsWeb_BarCodeBill.ShowBillSub(DBUtility.ClsPub.isLong(sMsg), ShowItem, ref DBUtility.ClsPub.sExeReturnInfo);
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// æ¡ç æ¡£æ¡ˆåˆ—表
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="NowPage"></param>
        /// <param name="OnePage"></param>
        /// <returns></returns>
        [Route("GetBarCodeShowList")]
        [HttpGet]
        public object GetBarCodeShowList(string HSupNo, string sqlWhere)
        {
            string msg = "";
            try
            {
                string VsWhere = "";
                string PcWhere = "";
                SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM();
                DataSet ds;
                //其他过滤
                if (msg.Trim() == "")
                {
                    msg = " Where hsupid in (select HItemID from h_v_IF_Supplier where hnumber=''" + HSupNo.Trim() + "'') " + sqlWhere;
                    // msg = " Where   hsupid in (select hsupid from Gy_UserSupplierRelation where HUserID=^^" + System.Web.HttpContext.Current.Session["HUserName"].ToString() + "^^)";
                }
                else
                {
                    msg = msg + " and   hsupid in (select HItemID from h_v_IF_Supplier where hnumber=''" + HSupNo.Trim() + "'') " + sqlWhere;
                    // msg = msg + " Where   hsupid in (select hsupid from Gy_UserSupplierRelation where HUserID=^^" + System.Web.HttpContext.Current.Session["HUserName"].ToString() + "^^)";
                }
                //转换特殊字符
                if (Common.SQLtoChange(msg, ref VsWhere, ref PcWhere) == false)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                //获取总行数
                Int64 RowTotal = Common.GetRowTotal("h_v_SRM_BarCodeBillList", VsWhere, ref DBUtility.ClsPub.sExeReturnInfo);
                //获取返回数据
                ds = oCn.RunProcReturn("exec h_p_SRM_BarCodeBillList '" + PcWhere + "'", "h_v_SRM_BarCodeBillList");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
    }
}
WebAPI/Controllers/EntrustOrderController.cs
New file
@@ -0,0 +1,271 @@
using DBUtility;
using Newtonsoft.Json.Linq;
using SQLHelper;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;
using WebAPI.Code;
using WebAPI.Models;
namespace WebAPI.Controllers
{
    public class EntrustOrderController : ApiController
    {
        private JsonResult objJsonResult = new JsonResult();
        private json objjson = new json();
        /// <summary>
        /// é‡‡è´­å•列表
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="NowPage"></param>
        /// <param name="OnePage"></param>
        /// <returns></returns>
        [Route("GetEntrustOrderBill")]
        [HttpGet]
        //采购订单列表
        public object GetEntrustOrderBill(string HSupNo, string sqlWhere)
        {
            string msg = "";
            try
            {
                string VsWhere = "";
                string PcWhere = "";
                SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM();
                DataSet ds;
                //其他过滤
                if (msg.Trim() == "")
                {
                    msg = " Where hsupid in (select HItemID from h_v_IF_Supplier where hnumber=^^" + HSupNo.Trim() + "^^) " + sqlWhere;
                    // msg = " Where   hsupid in (select hsupid from Gy_UserSupplierRelation where HUserID=^^" + System.Web.HttpContext.Current.Session["HUserName"].ToString() + "^^)";
                }
                else
                {
                    msg = msg + " and   hsupid in (select HItemID from h_v_IF_Supplier where hnumber=^^" + HSupNo.Trim() + "^^) " + sqlWhere;
                    // msg = msg + " Where   hsupid in (select hsupid from Gy_UserSupplierRelation where HUserID=^^" + System.Web.HttpContext.Current.Session["HUserName"].ToString() + "^^)";
                }
                //转换特殊字符
                if (Common.SQLtoChange(msg, ref VsWhere, ref PcWhere) == false)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                //获取总行数
                Int64 RowTotal = Common.GetRowTotal("H_v_SRM_EntrustOrderBillList", VsWhere, ref DBUtility.ClsPub.sExeReturnInfo);
                //获取返回数据
                ds = oCn.RunProcReturn("exec H_p_SRM_EntrustOrderBillList '" + PcWhere + "'", "H_p_SRM_EntrustOrderBillList");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// å§”外订单表头信息
        /// </summary>
        /// <param name="sMsg"></param>
        /// <returns></returns>
        [Route("GetEntrustOrderShowBillMain")]
        [HttpGet]
        public object GetEntrustOrderShowBillMain(string sMsg)
        {
            try
            {
                DataSet ds;
                string ShowItem = " * ";//显示的字段
                if (DBUtility.ClsPub.isLong(sMsg) == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                DAL.ClsWW_EntrustOrderBill oClsWW_EntrustOrderBill = new DAL.ClsWW_EntrustOrderBill();
                ds = oClsWW_EntrustOrderBill.ShowBillMainTo(DBUtility.ClsPub.isLong(sMsg), ShowItem, ref DBUtility.ClsPub.sExeReturnInfo);
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// å§”外订单明细表体信息
        /// </summary>
        /// <param name="sMsg"></param>
        /// <param name="sMsg2"></param>
        /// <returns></returns>
        [Route("GetEntrustOrderShowBillSub")]
        [HttpGet]
        public object GetEntrustOrderShowBillSub(string sMsg)
        {
            try
            {
                DataSet ds = null;
                string ShowItem = " * ";//显示的字段
                if (DBUtility.ClsPub.isLong(sMsg) == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                DAL.ClsWW_EntrustOrderBill oClsWW_EntrustOrderBill = new DAL.ClsWW_EntrustOrderBill();
                ds = oClsWW_EntrustOrderBill.ShowBillSubTo(DBUtility.ClsPub.isLong(sMsg), ShowItem, ref DBUtility.ClsPub.sExeReturnInfo);
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    //return DBUtility.ClsPub.sExeReturnInfo;
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
                //return s;
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        [Route("EntrustOrderAccept")]
        [HttpGet]
        /// <summary>
        /// è®¢å•接受
        /// </summary>
        /// <param name="HInterID"></param>
        /// <returns></returns>
        public object EntrustOrderAccept(string HInterID, string HBillNo, string HUser)
        {
            try
            {
                if (DBUtility.ClsPub.isLong(HInterID) == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "接受失败!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DAL.ClsWW_EntrustOrderBill oBill = new DAL.ClsWW_EntrustOrderBill();
                oBill.WebAccept(DBUtility.ClsPub.isLong(HInterID), DBUtility.ClsPub.isStrNull(HBillNo), DBUtility.ClsPub.isStrNull(HUser), ref DBUtility.ClsPub.sExeReturnInfo);
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "接受成功!";
                objJsonResult.data = 1;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "接受失败!"+e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
            [Route("EntrustOrderRefuse")]
            [HttpGet]
            /// <summary>
            /// è®¢å•拒绝
            /// </summary>
            /// <param name="HInterID"></param>
            /// <returns></returns>
        public object EntrustOrderRefuse(string HInterID, string HBillNo, string HUser, string HBackRemark)
            {
                try
                {
                    if (DBUtility.ClsPub.isLong(HInterID) == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "失败!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    DAL.ClsWW_EntrustOrderBill oBill = new DAL.ClsWW_EntrustOrderBill();
                    oBill.WebRefuse(DBUtility.ClsPub.isLong(HInterID), DBUtility.ClsPub.isStrNull(HBillNo), DBUtility.ClsPub.isStrNull(HUser), DBUtility.ClsPub.isStrNull(HBackRemark), ref DBUtility.ClsPub.sExeReturnInfo);
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "拒绝成功!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                catch (Exception e)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "失败!" + e.ToString();
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
    }
}
WebAPI/Controllers/PODemandPlanController.cs
New file
@@ -0,0 +1,271 @@
using DBUtility;
using Newtonsoft.Json.Linq;
using SQLHelper;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;
using WebAPI.Code;
using WebAPI.Models;
namespace WebAPI.Controllers
{
    public class PODemandPlanController : ApiController
    {
        private JsonResult objJsonResult = new JsonResult();
        private json objjson = new json();
        /// <summary>
        /// é‡‡è´­å•列表
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="NowPage"></param>
        /// <param name="OnePage"></param>
        /// <returns></returns>
        [Route("GetPODemandPlanBill")]
        [HttpGet]
        //采购订单列表
        public object GetPODemandPlanBill(string HSupNo, string sqlWhere)
        {
            string msg = "";
            try
            {
                string VsWhere = "";
                string PcWhere = "";
                SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM();
                DataSet ds;
                //其他过滤
                if (msg.Trim() == "")
                {
                    msg = " Where hsupid in (select HItemID from h_v_IF_Supplier where hnumber=^^" + HSupNo.Trim() + "^^) " + sqlWhere;
                    // msg = " Where   hsupid in (select hsupid from Gy_UserSupplierRelation where HUserID=^^" + System.Web.HttpContext.Current.Session["HUserName"].ToString() + "^^)";
                }
                else
                {
                    msg = msg + " and   hsupid in (select HItemID from h_v_IF_Supplier where hnumber=^^" + HSupNo.Trim() + "^^) " + sqlWhere;
                    // msg = msg + " Where   hsupid in (select hsupid from Gy_UserSupplierRelation where HUserID=^^" + System.Web.HttpContext.Current.Session["HUserName"].ToString() + "^^)";
                }
                //转换特殊字符
                if (Common.SQLtoChange(msg, ref VsWhere, ref PcWhere) == false)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                //获取总行数
                Int64 RowTotal = Common.GetRowTotal("H_v_SRM_PODemandPlanBillList", VsWhere, ref DBUtility.ClsPub.sExeReturnInfo);
                //获取返回数据
                ds = oCn.RunProcReturn("exec H_p_SRM_PODemandPlanBillList '" + PcWhere + "'", "H_p_SRM_PODemandPlanBillList");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// è¦è´§é€šçŸ¥å•表头信息
        /// </summary>
        /// <param name="sMsg"></param>
        /// <returns></returns>
        [Route("GetPODemandPlanShowBillMain")]
        [HttpGet]
        public object GetPODemandPlanShowBillMain(string sMsg)
        {
            try
            {
                DataSet ds;
                string ShowItem = " * ";//显示的字段
                if (DBUtility.ClsPub.isLong(sMsg) == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                DAL.ClsSRM_PODemandPlanBill oClsSRM_PODemandPlanBill = new DAL.ClsSRM_PODemandPlanBill();
                ds = oClsSRM_PODemandPlanBill.ShowBillMainTo(DBUtility.ClsPub.isLong(sMsg), ShowItem, ref DBUtility.ClsPub.sExeReturnInfo);
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// è¦è´§é€šçŸ¥å•明细表体信息
        /// </summary>
        /// <param name="sMsg"></param>
        /// <param name="sMsg2"></param>
        /// <returns></returns>
        [Route("GetPODemandPlanShowBillSub")]
        [HttpGet]
        public object GetPODemandPlanShowBillSub(string sMsg)
        {
            try
            {
                DataSet ds = null;
                string ShowItem = " * ";//显示的字段
                if (DBUtility.ClsPub.isLong(sMsg) == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                DAL.ClsSRM_PODemandPlanBill oClsSRM_PODemandPlanBill = new DAL.ClsSRM_PODemandPlanBill();
                ds = oClsSRM_PODemandPlanBill.ShowBillSubTo(DBUtility.ClsPub.isLong(sMsg), ShowItem, ref DBUtility.ClsPub.sExeReturnInfo);
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    //return DBUtility.ClsPub.sExeReturnInfo;
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
                //return s;
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        [Route("PODemandPlanAccept")]
        [HttpGet]
        /// <summary>
        /// è®¢å•接受
        /// </summary>
        /// <param name="HInterID"></param>
        /// <returns></returns>
        public object PODemandPlanAccept(string HInterID, string HEntryID, string HBillNo, string HUser)
        {
            try
            {
                if (DBUtility.ClsPub.isLong(HInterID) == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "接受失败!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DAL.ClsSRM_PODemandPlanBill oBill = new DAL.ClsSRM_PODemandPlanBill();
                oBill.WebAccept(DBUtility.ClsPub.isLong(HInterID), DBUtility.ClsPub.isLong(HEntryID), DBUtility.ClsPub.isStrNull(HBillNo), DBUtility.ClsPub.isStrNull(HUser), ref DBUtility.ClsPub.sExeReturnInfo);
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "接受成功!";
                objJsonResult.data = 1;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "接受失败!"+e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
            [Route("PODemandPlanRefuse")]
            [HttpGet]
            /// <summary>
            /// è®¢å•拒绝
            /// </summary>
            /// <param name="HInterID"></param>
            /// <returns></returns>
        public object PODemandPlanRefuse(string HInterID, string HEntryID, string HBillNo, string HUser, string HBackRemark)
            {
                try
                {
                    if (DBUtility.ClsPub.isLong(HInterID) == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "失败!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    DAL.ClsSRM_PODemandPlanBill oBill = new DAL.ClsSRM_PODemandPlanBill();
                    oBill.WebRefuse(DBUtility.ClsPub.isLong(HInterID), DBUtility.ClsPub.isLong(HEntryID), DBUtility.ClsPub.isStrNull(HBillNo), DBUtility.ClsPub.isStrNull(HUser), DBUtility.ClsPub.isStrNull(HBackRemark), ref DBUtility.ClsPub.sExeReturnInfo);
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "拒绝成功!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                catch (Exception e)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "失败!" + e.ToString();
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
    }
}
WebAPI/Controllers/POInStockBackController.cs
New file
@@ -0,0 +1,91 @@
using DBUtility;
using Newtonsoft.Json.Linq;
using SQLHelper;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;
using WebAPI.Code;
using WebAPI.Models;
namespace WebAPI.Controllers
{
    public class POInStockBackController : ApiController
    {
        private JsonResult objJsonResult = new JsonResult();
        private json objjson = new json();
        /// <summary>
        /// é€€è´§å•列表
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="NowPage"></param>
        /// <param name="OnePage"></param>
        /// <returns></returns>
        [Route("GetPOInStockBackBillList")]
        [HttpGet]
        public object GetPOInStockBackBillList(string HSupNo, string sqlWhere)
        {
            string msg = "";
            try
            {
                if (msg == null)
                {
                    msg = "";
                }
                string VsWhere = "";
                string PcWhere = "";
                SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM();
                DataSet ds;
                //其他过滤
                if (msg.Trim() == "")
                {
                    msg = " Where hsupid in (select HItemID from h_v_IF_Supplier where hnumber=''" + HSupNo.Trim() + "'') " + sqlWhere;
                    // msg = " Where   hsupid in (select hsupid from Gy_UserSupplierRelation where HUserID=^^" + System.Web.HttpContext.Current.Session["HUserName"].ToString() + "^^)";
                }
                else
                {
                    msg = msg + " and   hsupid in (select HItemID from h_v_IF_Supplier where hnumber=''" + HSupNo.Trim() + "'') " + sqlWhere;
                    // msg = msg + " Where   hsupid in (select hsupid from Gy_UserSupplierRelation where HUserID=^^" + System.Web.HttpContext.Current.Session["HUserName"].ToString() + "^^)";
                }
                //转换特殊字符
                if (Common.SQLtoChange(msg, ref VsWhere, ref PcWhere) == false)
                {
                    return "";
                }
                //获取总行数
                Int64 RowTotal = Common.GetRowTotal("h_v_SRM_POInStockBackBillList", VsWhere, ref DBUtility.ClsPub.sExeReturnInfo);
                //获取返回数据
                ds = oCn.RunProcReturn("exec h_p_SRM_POInStockBackBillList '" + PcWhere + "'", "h_p_SRM_POInStockBackBillList");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
    }
}
WebAPI/Controllers/POInStockController.cs
New file
@@ -0,0 +1,628 @@
using DBUtility;
using Newtonsoft.Json.Linq;
using SQLHelper;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;
using WebAPI.Code;
using WebAPI.Models;
namespace WebAPI.Controllers
{
    public class POInStockController : ApiController
    {
        private JsonResult objJsonResult = new JsonResult();
        private json objjson = new json();
        /// <summary>
        /// æ›´æ–°æ‰“印次数
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="msg2"></param>
        /// <returns></returns>
        [Route("UpdatePOInStockBillPrintQty")]
        [HttpPost]
        public object UpdatePOInStockBillPrintQty([FromBody]JObject msg)
        {
            var _value = msg["msg"].ToString();
            string msg1 = _value.ToString();
            try
            {
                SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM();
                oCn.RunProc("exec H_p_SRM_POInStockBill_PrintQty " + msg1.ToString());
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "更新打印次数成功!";
                objJsonResult.data = 1;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "更新打印次数失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        /// <summary>
        /// ç”Ÿæˆé€è´§å•单据号、日期
        /// </summary>
        /// <param name="sMsg"></param>
        /// <returns></returns>
        [Route("GetNewPOInStockBillNo")]
        [HttpGet]
        public object GetNewPOInStockBillNo(string sMsg, string sMsg3)
        {
            try
            {
                DataSet ds = new DataSet();
                if (DBUtility.ClsPub.isLong(sMsg) == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败!无效的主键";
                    objjson.data = null;
                    return objjson;
                }
                if (DBUtility.ClsPub.isStrNull(sMsg3) == "")
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败!无效的单据类型";
                    objjson.data = null;
                    return objjson;
                }
                string HBillNo,HDate;
                HBillNo = DBUtility.ClsPub.CreateBillCode_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo,true);
                HDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
                //创建临时表
                DataTable dt = new DataTable();
                //创建表中的列
                dt.Columns.Add("HBillNo", typeof(string));//添加列
                dt.Columns.Add("HDate", typeof(string));//添加列
                DataRow row = dt.NewRow();
                //给列赋值
                row["HBillNo"] = HBillNo;
                row["HDate"] = HDate;
                //把有值的列添加到表
                dt.Rows.Add(row);
                //把表添加到dataset
                ds.Tables.Add(dt);
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 1;
                    objjson.Message = "获取失败!没有返回任何记录";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// ç”Ÿæˆé€è´§å•表头信息
        /// </summary>
        /// <param name="sMsg"></param>
        /// <returns></returns>
        [Route("GetNewPOInStockShowBillMain")]
        [HttpGet]
        public object GetNewPOInStockShowBillMain(string sMsg, string sMsg3)
        {
            try
            {
                DataSet ds;
                string ShowItem = " * ";//显示的字段
                if (DBUtility.ClsPub.isLong(sMsg) == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败!无效的主键";
                    objjson.data = null;
                    return objjson;
                }
                if (DBUtility.ClsPub.isStrNull(sMsg3) == "")
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败!无效的单据类型";
                    objjson.data = null;
                    return objjson;
                }
                DAL.ClsCg_POInStockBill oClsCg_POInStockBill = new DAL.ClsCg_POInStockBill();
                ds = oClsCg_POInStockBill.ShowNewBillMainTo(DBUtility.ClsPub.isLong(sMsg), DBUtility.ClsPub.isStrNull(sMsg3), ShowItem, ref DBUtility.ClsPub.sExeReturnInfo);
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 1;
                    objjson.Message = "获取失败!没有返回任何记录";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// ç”Ÿæˆé€è´§å•明细表体信息
        /// </summary>
        /// <param name="sMsg"></param>
        /// <param name="sMsg2"></param>
        /// <returns></returns>
        [Route("GetNewPOInStockShowBillSub")]
        [HttpGet]
        public object GetNewPOInStockShowBillSub(string sMsg, string sMsg2, string sMsg3)
        {
            try
            {
                DataSet ds = null;
                string ShowItem = " * ";//显示的字段
                if (DBUtility.ClsPub.isLong(sMsg) == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败!无效的主键";
                    objjson.data = null;
                    return objjson;
                }
                if (DBUtility.ClsPub.isStrNull(sMsg3) == "")
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败!无效的单据类型";
                    objjson.data = null;
                    return objjson;
                }
                DAL.ClsCg_POInStockBill oClsCg_POInStockBill = new DAL.ClsCg_POInStockBill();
                ds = oClsCg_POInStockBill.ShowNewBillSubTo(DBUtility.ClsPub.isLong(sMsg), DBUtility.ClsPub.isStrNull(sMsg2), DBUtility.ClsPub.isStrNull(sMsg3), ShowItem, ref DBUtility.ClsPub.sExeReturnInfo);
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
                //return s;
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// ä¿å­˜é€è´§å•
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="msg2"></param>
        /// <returns></returns>
        [Route("SaverPOInStock")]
        [HttpPost]
        public object SaverPOInStock([FromBody]JObject msg)
        {
            var _value = msg["msg"].ToString();
            string msg1 = _value.ToString();
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString();
            string UserName="";
            ListModels oListModels = new ListModels();
            try
            {
                DAL.ClsCg_POInStockBill oBill = new DAL.ClsCg_POInStockBill();
                List<Model.ClsCg_POInStockBillMain> lsmain = new List<Model.ClsCg_POInStockBillMain>();
                msg2 = msg2.Replace("\\", "");
                msg2 = msg2.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_POInStockMain(msg2);
                foreach (Model.ClsCg_POInStockBillMain oItem in lsmain)
                {
                    //oItem.HMaker = "";
                    UserName=oItem.HMaker;
                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                    //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
                    oItem.HCurID = 1;
                    oItem.HExRate = 1;
                    oItem.HMainSourceInterID = oItem.HInterID;
                    oItem.HInterID = 0;
                    //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
                    if (DBUtility.ClsPub.isStrNull(oItem.HDHDate)=="")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!没有填写预计到货日期,无法保存!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    oBill.omodel = oItem;
                }
                //表体数据
                //按 },{来拆分数组 //去掉【和】
                msg3 = msg3.Substring(1, msg3.Length - 2);
                msg3 = msg3.Replace("\\", "");
                msg3 = msg3.Replace("\n", "");  //\n
                //msg2 = msg2.Replace("'", "’");
                List<Model.ClsCg_POInStockBillSub> ls = new List<Model.ClsCg_POInStockBillSub>();
                ls = oListModels.getObjectByJson_POInStockSub(msg3);
                int i = 0;
                foreach (Model.ClsCg_POInStockBillSub oItemSub in ls)
                {
                    i++;
                    if (oItemSub.HQty<=0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!第"+ i.ToString()+"行数量不大于0无法保存!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    if (oItemSub.HQty > oItemSub.HRQty)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!第" + i.ToString() + "行数量不能大于未关联数量!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    if (DBUtility.ClsPub.isStrNull(oItemSub.HBatChNo)=="")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!第" + i.ToString() + "行未填写批号!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    oItemSub.HEntryID = i;
                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                    oItemSub.HRemark = "";
                    oItemSub.HCloseMan = "";
                    oItemSub.HCloseType = false;
                    oBill.DetailColl.Add(oItemSub);
                }
                //保存前判断(单据号重复,笔录项目)
                //保存
                //保存完毕后处理
                bool bResult;
                if (oBill.omodel.HInterID == 0)
                {
                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                }
                else
                {
                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                }
                if (bResult)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
                    WebAPIController.Add_Log("送货单下推", UserName, "生成送货单");
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        /// <summary>
        /// é€è´§å•列表
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="NowPage"></param>
        /// <param name="OnePage"></param>
        /// <returns></returns>
        [Route("GetPOInStockBill")]
        [HttpGet]
        //送货单列表
        public object GetPOInStockBill(string HSupNo, string sqlWhere)
        {
            string msg = "";
            try
            {
                string VsWhere = "";
                string PcWhere = "";
                SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM();
                DataSet ds;
                //其他过滤
                if (msg.Trim() == "")
                {
                    msg = " Where hsupid in (select HItemID from h_v_IF_Supplier where hnumber=^^" + HSupNo.Trim() + "^^) " + sqlWhere;
                    // msg = " Where   hsupid in (select hsupid from Gy_UserSupplierRelation where HUserID=^^" + System.Web.HttpContext.Current.Session["HUserName"].ToString() + "^^)";
                }
                else
                {
                    msg = msg + " and   hsupid in (select HItemID from h_v_IF_Supplier where hnumber=^^" + HSupNo.Trim() + "^^) " + sqlWhere;
                    // msg = msg + " Where   hsupid in (select hsupid from Gy_UserSupplierRelation where HUserID=^^" + System.Web.HttpContext.Current.Session["HUserName"].ToString() + "^^)";
                }
                //转换特殊字符
                if (Common.SQLtoChange(msg, ref VsWhere, ref PcWhere) == false)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                //获取总行数
                Int64 RowTotal = Common.GetRowTotal("H_v_SRM_POInStockBillList", VsWhere, ref DBUtility.ClsPub.sExeReturnInfo);
                //获取返回数据
                ds = oCn.RunProcReturn("exec H_p_SRM_POInStockBillList '" + PcWhere + "'", "H_p_SRM_POInStockBillList");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// é€è´§å•表头信息
        /// </summary>
        /// <param name="sMsg"></param>
        /// <returns></returns>
        [Route("GetPOInStockShowBillMain")]
        [HttpGet]
        public object GetPOInStockShowBillMain(string sMsg)
        {
            try
            {
                DataSet ds;
                string s = "";
                string ShowItem = " * ";//显示的字段
                if (DBUtility.ClsPub.isLong(sMsg) == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                DAL.ClsCg_POInStockBill oClsCg_POInStockBill = new DAL.ClsCg_POInStockBill();
                ds = oClsCg_POInStockBill.ShowBillMainTo(DBUtility.ClsPub.isLong(sMsg), ShowItem, ref DBUtility.ClsPub.sExeReturnInfo);
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// é€è´§å•明细表体信息
        /// </summary>
        /// <param name="sMsg"></param>
        /// <param name="sMsg2"></param>
        /// <returns></returns>
        [Route("GetPOInStockShowBillSub")]
        [HttpGet]
        public object GetPOInStockShowBillSub(string sMsg)
        {
            //string sMsg="28";
            //string sMsg2 = "28,5;"
            try
            {
                DataSet ds = null;
                //string s = "";
                //string sMsg3 = "'" + sMsg2 + "'";
                string ShowItem = " * ";//显示的字段
                if (DBUtility.ClsPub.isLong(sMsg) == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                DAL.ClsCg_POInStockBill oClsCg_POInStockBill = new DAL.ClsCg_POInStockBill();
                ds = oClsCg_POInStockBill.ShowBillSubTo(DBUtility.ClsPub.isLong(sMsg), ShowItem, ref DBUtility.ClsPub.sExeReturnInfo);
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    //return DBUtility.ClsPub.sExeReturnInfo;
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
                //return s;
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        //[Route("POInStockAccept")]
        //[HttpGet]
        ///// <summary>
        ///// è®¢å•接受
        ///// </summary>
        ///// <param name="HInterID"></param>
        ///// <returns></returns>
        //public object POInStockAccept(string HInterID,string HEntryID,long HBillType,string HUser)
        //{
        //    try
        //    {
        //        if (DBUtility.ClsPub.isLong(HInterID) == 0)
        //        {
        //            objJsonResult.code = "0";
        //            objJsonResult.count = 0;
        //            objJsonResult.Message = "接受失败!";
        //            objJsonResult.data = null;
        //            return objJsonResult;
        //        }
        //        DAL.ClsSRM_POInStockBill oBill = new DAL.ClsSRM_POInStockBill();
        //        oBill.WebAccept_Sub(DBUtility.ClsPub.isLong(HInterID), DBUtility.ClsPub.isLong(HEntryID), DBUtility.ClsPub.isLong(HBillType), DBUtility.ClsPub.isStrNull(HUser), ref DBUtility.ClsPub.sExeReturnInfo);
        //        objJsonResult.code = "0";
        //        objJsonResult.count = 1;
        //        objJsonResult.Message = "接受成功!";
        //        objJsonResult.data = 1;
        //        return objJsonResult;
        //    }
        //    catch (Exception e)
        //    {
        //        objJsonResult.code = "0";
        //        objJsonResult.count = 0;
        //        objJsonResult.Message = "接受失败!"+e.ToString();
        //        objJsonResult.data = null;
        //        return objJsonResult;
        //    }
        //}
        //    [Route("POInStockRefuse")]
        //    [HttpGet]
        //    /// <summary>
        //    /// è®¢å•拒绝
        //    /// </summary>
        //    /// <param name="HInterID"></param>
        //    /// <returns></returns>
        //    public object POInStockRefuse(string HInterID, string HEntryID,string HBackRemark, long HBillType,string HUser)
        //    {
        //        try
        //        {
        //            if (DBUtility.ClsPub.isLong(HInterID) == 0)
        //            {
        //                objJsonResult.code = "0";
        //                objJsonResult.count = 0;
        //                objJsonResult.Message = "失败!";
        //                objJsonResult.data = null;
        //                return objJsonResult;
        //            }
        //            DAL.ClsSRM_POInStockBill oBill = new DAL.ClsSRM_POInStockBill();
        //            oBill.WebRefuse_Sub(DBUtility.ClsPub.isLong(HInterID), DBUtility.ClsPub.isLong(HEntryID), DBUtility.ClsPub.isStrNull(HBackRemark), DBUtility.ClsPub.isLong(HBillType),DBUtility.ClsPub.isStrNull(HUser), ref DBUtility.ClsPub.sExeReturnInfo);
        //            objJsonResult.code = "0";
        //            objJsonResult.count = 1;
        //            objJsonResult.Message = "拒绝成功!";
        //            objJsonResult.data = 1;
        //            return objJsonResult;
        //        }
        //        catch (Exception e)
        //        {
        //            objJsonResult.code = "0";
        //            objJsonResult.count = 0;
        //            objJsonResult.Message = "失败!" + e.ToString();
        //            objJsonResult.data = null;
        //            return objJsonResult;
        //        }
        //    }
    }
}
WebAPI/Controllers/POOrderController.cs
New file
@@ -0,0 +1,271 @@
using DBUtility;
using Newtonsoft.Json.Linq;
using SQLHelper;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;
using WebAPI.Code;
using WebAPI.Models;
namespace WebAPI.Controllers
{
    public class POOrderController : ApiController
    {
        private JsonResult objJsonResult = new JsonResult();
        private json objjson = new json();
        /// <summary>
        /// é‡‡è´­å•列表
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="NowPage"></param>
        /// <param name="OnePage"></param>
        /// <returns></returns>
        [Route("GetPOOrderBill")]
        [HttpGet]
        //采购订单列表
        public object GetPOOrderBill(string HSupNo, string sqlWhere)
        {
            string msg = "";
            try
            {
                string VsWhere = "";
                string PcWhere = "";
                SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM();
                DataSet ds;
                //其他过滤
                if (msg.Trim() == "")
                {
                    msg = " Where hsupid in (select HItemID from h_v_IF_Supplier where hnumber=^^" + HSupNo.Trim() + "^^) " + sqlWhere;
                    // msg = " Where   hsupid in (select hsupid from Gy_UserSupplierRelation where HUserID=^^" + System.Web.HttpContext.Current.Session["HUserName"].ToString() + "^^)";
                }
                else
                {
                    msg = msg + " and   hsupid in (select HItemID from h_v_IF_Supplier where hnumber=^^" + HSupNo.Trim() + "^^) " + sqlWhere;
                    // msg = msg + " Where   hsupid in (select hsupid from Gy_UserSupplierRelation where HUserID=^^" + System.Web.HttpContext.Current.Session["HUserName"].ToString() + "^^)";
                }
                //转换特殊字符
                if (Common.SQLtoChange(msg, ref VsWhere, ref PcWhere) == false)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                //获取总行数
                Int64 RowTotal = Common.GetRowTotal("H_v_SRM_POOrderBillList", VsWhere, ref DBUtility.ClsPub.sExeReturnInfo);
                //获取返回数据
                ds = oCn.RunProcReturn("exec H_p_SRM_POOrderBillList '" + PcWhere + "'", "H_p_SRM_POOrderBillList");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// é‡‡è´­è®¢å•表头信息
        /// </summary>
        /// <param name="sMsg"></param>
        /// <returns></returns>
        [Route("GetPOOrderShowBillMain")]
        [HttpGet]
        public object GetPOOrderShowBillMain(string sMsg)
        {
            try
            {
                DataSet ds;
                string ShowItem = " * ";//显示的字段
                if (DBUtility.ClsPub.isLong(sMsg) == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                DAL.ClsCg_POOrderBill oClsCg_POOrderBill = new DAL.ClsCg_POOrderBill();
                ds = oClsCg_POOrderBill.ShowBillMainTo(DBUtility.ClsPub.isLong(sMsg), ShowItem, ref DBUtility.ClsPub.sExeReturnInfo);
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// é‡‡è´­è®¢å•明细表体信息
        /// </summary>
        /// <param name="sMsg"></param>
        /// <param name="sMsg2"></param>
        /// <returns></returns>
        [Route("GetPOOrderShowBillSub")]
        [HttpGet]
        public object GetPOOrderShowBillSub(string sMsg)
        {
            try
            {
                DataSet ds = null;
                string ShowItem = " * ";//显示的字段
                if (DBUtility.ClsPub.isLong(sMsg) == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                DAL.ClsCg_POOrderBill oClsCg_POOrderBill = new DAL.ClsCg_POOrderBill();
                ds = oClsCg_POOrderBill.ShowBillSubTo(DBUtility.ClsPub.isLong(sMsg), ShowItem, ref DBUtility.ClsPub.sExeReturnInfo);
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    //return DBUtility.ClsPub.sExeReturnInfo;
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
                //return s;
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        [Route("POOrderAccept")]
        [HttpGet]
        /// <summary>
        /// è®¢å•接受
        /// </summary>
        /// <param name="HInterID"></param>
        /// <returns></returns>
        public object POOrderAccept(string HInterID, string HBillNo,string HUser)
        {
            try
            {
                if (DBUtility.ClsPub.isLong(HInterID) == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "接受失败!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DAL.ClsCg_POOrderBill oBill = new DAL.ClsCg_POOrderBill();
                oBill.WebAccept(DBUtility.ClsPub.isLong(HInterID), DBUtility.ClsPub.isStrNull(HBillNo), DBUtility.ClsPub.isStrNull(HUser), ref DBUtility.ClsPub.sExeReturnInfo);
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "接受成功!";
                objJsonResult.data = 1;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "接受失败!"+e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
            [Route("POOrderRefuse")]
            [HttpGet]
            /// <summary>
            /// è®¢å•拒绝
            /// </summary>
            /// <param name="HInterID"></param>
            /// <returns></returns>
        public object POOrderRefuse(string HInterID, string HBillNo, string HUser, string HBackRemark)
            {
                try
                {
                    if (DBUtility.ClsPub.isLong(HInterID) == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "失败!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    DAL.ClsCg_POOrderBill oBill = new DAL.ClsCg_POOrderBill();
                    oBill.WebRefuse(DBUtility.ClsPub.isLong(HInterID), DBUtility.ClsPub.isStrNull(HBillNo), DBUtility.ClsPub.isStrNull(HUser), DBUtility.ClsPub.isStrNull(HBackRemark), ref DBUtility.ClsPub.sExeReturnInfo);
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "拒绝成功!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                catch (Exception e)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "失败!" + e.ToString();
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
    }
}
WebAPI/Controllers/ReportController.cs
New file
@@ -0,0 +1,232 @@
using DBUtility;
using Newtonsoft.Json.Linq;
using SQLHelper;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;
using WebAPI.Code;
using WebAPI.Models;
namespace WebAPI.Controllers
{
    public class ReportController : ApiController
    {
        private JsonResult objJsonResult = new JsonResult();
        private json objjson = new json();
        /// <summary>
        /// é‡‡è´­è®¢å•跟踪表
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="NowPage"></param>
        /// <param name="OnePage"></param>
        /// <returns></returns>
        [Route("GetPOOrderBillProcReport")]
        [HttpGet]
        //采购订单跟踪表
        public object GetPOOrderBillProcReport(string HSupNo, string sqlWhere)
        {
            string msg = "";
            try
            {
                string VsWhere = "";
                string PcWhere = "";
                SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM();
                DataSet ds;
                //其他过滤
                if (msg.Trim() == "")
                {
                    msg = " Where hsupid in (select HItemID from h_v_IF_Supplier where hnumber=^^" + HSupNo.Trim() + "^^) " + sqlWhere;
                }
                else
                {
                    msg = msg + " and   hsupid in (select HItemID from h_v_IF_Supplier where hnumber=^^" + HSupNo.Trim() + "^^) " + sqlWhere;
                }
                //转换特殊字符
                if (Common.SQLtoChange(msg, ref VsWhere, ref PcWhere) == false)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                //获取总行数
                Int64 RowTotal = Common.GetRowTotal("h_v_SRM_POOrderBillProcReport", VsWhere, ref DBUtility.ClsPub.sExeReturnInfo);
                //获取返回数据
                ds = oCn.RunProcReturn("exec h_p_SRM_POOrderBillProcReport '" + PcWhere + "'", "h_p_SRM_POOrderBillProcReport");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// å§”外订单跟踪表
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="NowPage"></param>
        /// <param name="OnePage"></param>
        /// <returns></returns>
        [Route("GetEntrustBillProcReport")]
        [HttpGet]
        //委外订单跟踪表
        public object GetEntrustBillProcReport(string HSupNo, string sqlWhere)
        {
            string msg = "";
            try
            {
                string VsWhere = "";
                string PcWhere = "";
                SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM();
                DataSet ds;
                //其他过滤
                if (msg.Trim() == "")
                {
                    msg = " Where hsupid in (select HItemID from h_v_IF_Supplier where hnumber=^^" + HSupNo.Trim() + "^^) " + sqlWhere;
                }
                else
                {
                    msg = msg + " and   hsupid in (select HItemID from h_v_IF_Supplier where hnumber=^^" + HSupNo.Trim() + "^^) " + sqlWhere;
                }
                //转换特殊字符
                if (Common.SQLtoChange(msg, ref VsWhere, ref PcWhere) == false)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                //获取总行数
                Int64 RowTotal = Common.GetRowTotal("h_v_SRM_EntrustBillProcReport", VsWhere, ref DBUtility.ClsPub.sExeReturnInfo);
                //获取返回数据
                ds = oCn.RunProcReturn("exec h_p_SRM_EntrustBillProcReport '" + PcWhere + "'", "h_p_SRM_EntrustBillProcReport");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// é€è´§å•跟踪表
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="NowPage"></param>
        /// <param name="OnePage"></param>
        /// <returns></returns>
        [Route("GetSendGoodsProcReport")]
        [HttpGet]
        //送货单跟踪表
        public object GetSendGoodsProcReport(string HSupNo, string sqlWhere)
        {
            string msg = "";
            try
            {
                string VsWhere = "";
                string PcWhere = "";
                SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM();
                DataSet ds;
                //其他过滤
                if (msg.Trim() == "")
                {
                    msg = " Where hsupid in (select HItemID from h_v_IF_Supplier where hnumber=^^" + HSupNo.Trim() + "^^) " + sqlWhere;
                }
                else
                {
                    msg = msg + " and   hsupid in (select HItemID from h_v_IF_Supplier where hnumber=^^" + HSupNo.Trim() + "^^) " + sqlWhere;
                }
                //转换特殊字符
                if (Common.SQLtoChange(msg, ref VsWhere, ref PcWhere) == false)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                //获取总行数
                Int64 RowTotal = Common.GetRowTotal("h_v_SRM_SendGoodsProcReport", VsWhere, ref DBUtility.ClsPub.sExeReturnInfo);
                //获取返回数据
                ds = oCn.RunProcReturn("exec h_p_SRM_SendGoodsProcReport '" + PcWhere + "'", "h_p_SRM_POOrderBillProcReport");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
    }
}
WebAPI/Controllers/WebAPIController.cs
New file
@@ -0,0 +1,700 @@
using DAL;
using Model;
using SQLHelper;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WebAPI.BLL;
using WebAPI.Models;
namespace WebAPI.Controllers
{
    public class WebAPIController : ApiController
    {
        private JsonResult objJsonResult = new JsonResult();
        private json objjson = new json();
      //  private POInStockBillServices oclscg_poinstockbillmain = new POInStockBillServices();
        public string sWhere = "";
        public WebServer webserver = new WebServer();
        public DataSet ds = new DataSet();
        public static string GetSession(string sMsg)
        {
            try
            {
                string s = Common.GetSession();
                return s;
            }
            catch (Exception e)
            {
                return "";
            }
        }
        /// <summary>
        /// å†™å…¥æ—¥å¿—
        /// </summary>
        public static bool Add_Log(string WorkList, string CurUserName, string State)
        {
                DBUtility.ClsPub.SetIPAddress();
               string IPAddress;
               string ComputerName;
               IPAddress = DBUtility.ClsPub.IPAddress;
               ComputerName = DBUtility.ClsPub.ComputerName;
                ClsCNSRM oCnLoc = new ClsCNSRM();
                try
                {
                    oCnLoc.RunProc("Insert into  System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " +
                        "(getdate(),'" + CurUserName + "','" + ComputerName + "','" + WorkList + "','SRM系统','" + IPAddress + "','" + State + "')"
                        );
                    return true;
                }
                catch (Exception e)
                {
                    return false;
                }
        }
        /// <summary>
        /// æ—¥å¿—列表
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="NowPage"></param>
        /// <param name="OnePage"></param>
        /// <returns></returns>
        [Route("GetSystemLog")]
        [HttpGet]
        //送货单列表
        public object GetSystemLog(string HSupNo, string sqlWhere)
        {
            string msg = "";
            try
            {
                string VsWhere = "";
                string PcWhere = "";
                SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM();
                DataSet ds;
                //其他过滤
                if (msg.Trim() == "")
                {
                    msg = " Where ç”¨æˆ·å=^^" + HSupNo.Trim() + "^^ " + sqlWhere;
                    // msg = " Where   hsupid in (select hsupid from Gy_UserSupplierRelation where HUserID=^^" + System.Web.HttpContext.Current.Session["HUserName"].ToString() + "^^)";
                }
                else
                {
                    msg = msg + " and   ç”¨æˆ·å=^^" + HSupNo.Trim() + "^^" + sqlWhere;
                    // msg = msg + " Where   hsupid in (select hsupid from Gy_UserSupplierRelation where HUserID=^^" + System.Web.HttpContext.Current.Session["HUserName"].ToString() + "^^)";
                }
                //转换特殊字符
                if (Common.SQLtoChange(msg, ref VsWhere, ref PcWhere) == false)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                //获取总行数
                Int64 RowTotal = Common.GetRowTotal("h_v_SRM_SystemLogList", VsWhere, ref DBUtility.ClsPub.sExeReturnInfo);
                //获取返回数据
                ds = oCn.RunProcReturn("exec h_p_SRM_SystemLogList '" + PcWhere + "'", "h_p_SRM_SystemLogList");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// ç™»å½•
        /// </summary>
        /// <param name="UserName">用户名</param>
        /// <param name="PassWord">密码</param>
        /// <returns></returns>
        [Route("GetUser")]
        [HttpGet]
        public object GetUser(string UserName, string PassWord)
        {
            try
            {
                DataSet ds = null;
                ClsCNSRM oCnLoc = new ClsCNSRM();
                DAL.ClsUser oUser = new DAL.ClsUser();
                ds = oUser.CheckCzymc(UserName.Trim(), DBUtility.ClsPub.StrToPsd(PassWord.Trim()));
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "密码错误!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "登录成功!";
                    objJsonResult.data = ds.Tables[0];
                    Add_Log("主界面", UserName, "登录");
                    return objJsonResult;
                }
            }
            catch (Exception)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "登录异常!";
                objJsonResult.data = null;
                return objJsonResult; ;
            }
        }
        /// <summary>
        /// ä¿®æ”¹å¯†ç 
        /// </summary>
        /// <param name="UserName"></param>
        /// <param name="PassWord"></param>
        /// <returns></returns>
        [Route("GetXGPassword")]
        [HttpGet]
        public object GetXGPassword(string UserName, string oldPassword, string PassWord, string Repassword)
        {
            try
            {
                ClsCNSRM oCn = new ClsCNSRM();
                DataSet oDs = new DataSet();
                //==========
                if (PassWord.Trim() != Repassword.Trim())
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "2次密码不一致!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                //===========
                oDs = oCn.RunProcReturn("select Czmm from  Gy_Czygl where Czybm='" + UserName + "'", "Gy_Czygl");
                if (oDs == null || oDs.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有这个用户,不能修改密码!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                else
                {
                    oCn.RunProc("update  Gy_Czygl set Czmm='" + DBUtility.ClsPub.StrToPsd(PassWord.Trim()) + "' where Czybm='" + UserName.Trim() + "'");
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "* å¯†ç ä¿®æ”¹æˆåŠŸï¼";
                    objJsonResult.data = null;
                    Add_Log("主界面", UserName, "修改密码");
                    return objJsonResult; ;
                }
            }
            catch (Exception)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "修改密码异常!";
                objJsonResult.data = null;
                return objJsonResult; ;
            }
        }
        ///// <summary>
        ///// ç¡®è®¤äº¤æœŸ
        ///// </summary>
        ///// <param name="HInterID"></param>
        ///// <param name="HEntryID"></param>
        ///// <param name="HState"></param>
        ///// <returns></returns>
        //[Route("UpdateBill")]
        //[HttpGet]
        //public object UpdateBill(int HInterID, int HEntryID, int HState)
        //{
        //    try
        //    {
        //        if (DBUtility.ClsPub.isLong(HInterID) == 0)
        //        {
        //            objJsonResult.code = "0";
        //            objJsonResult.count = 0;
        //            objJsonResult.Message = "N,项目不存在!";
        //            objJsonResult.data = 1;
        //            return objJsonResult;
        //        }
        //        DAL.ClsKf_POStockInBill_K3 oBill = new DAL.ClsKf_POStockInBill_K3();
        //        if (oBill.UpdateBill(HInterID, HEntryID, HState) == "Y")
        //        {
        //            objJsonResult.code = "0";
        //            objJsonResult.count = 1;
        //            objJsonResult.Message = "确认成功!";
        //            objJsonResult.data = 1;
        //            return objJsonResult;
        //        }
        //        else
        //        {
        //            objJsonResult.code = "0";
        //            objJsonResult.count = 0;
        //            objJsonResult.Message = "确认失败!";
        //            objJsonResult.data = 1;
        //            return objJsonResult;
        //        }
        //    }
        //    catch (Exception e)
        //    {
        //        objJsonResult.code = "0";
        //        objJsonResult.count = 0;
        //        objJsonResult.Message = "确认失败!" + e.ToString();
        //        objJsonResult.data = 1;
        //        return objJsonResult;
        //    }
        //}
        /// <summary>
        /// èŽ·å–æ‰“å°æ¨¡æ¿åˆ—è¡¨
        /// </summary>
        /// <returns></returns>
        [Route("GetOpenTmpList_Json")]
        [HttpGet]
        public object GetOpenTmpList_Json(string HNumber)
        {
            sWhere = " Where 1=1 ";
            //sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
            if (HNumber != "")
            {
                sWhere = sWhere + " and ( HNumber = '" + HNumber + "') ";
            }
            try
            {
                ds = webserver.GetOpenTmpList(sWhere, ref DBUtility.ClsPub.sErrInfo);
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败" + DBUtility.ClsPub.sErrInfo;
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception ex)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + ex.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// ä¿å­˜æ‰“印模板
        /// </summary>
        /// <returns></returns>
        [Route("SaveOpenTmp")]
        [HttpGet]
        public object SaveOpenTmp(string HNumber, string HName)
        {
            ClsCNSRM oCn = new ClsCNSRM();
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Insert into SRM_OpenTmp " +
                    " (HNumber,HModel,HName) " +
                    " Values('" + HNumber + "','" + HName + "','" + HName + "')", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                //oCn.RunProc("Update Gy_OpenTmp set HEndflag=0 where HItemID=" + oModel.HParentID, ref ClsPub.sExeReturnInfo);
                oCn.Commit();
                objjson.code = "0";
                objjson.count = 1;
                objjson.Message = "保存成功!";
                objjson.data = null;
                return objjson;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "保存失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// åˆ é™¤å°æ¨¡æ¿
        /// </summary>
        /// <returns></returns>
        [Route("DelOpenTmp")]
        [HttpGet]
        public object DelOpenTmp(string HItemID)
        {
            ClsCNSRM oCn = new ClsCNSRM();
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Delete from SRM_OpenTmp where HItemID='" + DBUtility.ClsPub.isLong(HItemID) + "'", ref DBUtility.ClsPub.sExeReturnInfo);
                oCn.Commit();
                objjson.code = "0";
                objjson.count = 1;
                objjson.Message = "删除成功!";
                objjson.data = null;
                return objjson;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "删除失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        #region åŸºç¡€èµ„æ–™
        /// <summary>
        /// èŽ·å–ä»“åº“åˆ—è¡¨
        /// </summary>
        /// <returns></returns>
        [Route("GetWarehouseList_Json")]
        [HttpGet]
        public object GetWarehouseList_Json(string Warehouse)
        {
            sWhere = " Where HStopFlag=0  and HEndFlag=1";
            //sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
            if (Warehouse != "")
            {
                sWhere = sWhere + " and ( HNumber like '%" + Warehouse + "%' or HName like '%" + Warehouse + "%' ) ";
            }
            try
            {
                ds = webserver.GetWarehouseList(sWhere, ref DBUtility.ClsPub.sErrInfo);
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败" + DBUtility.ClsPub.sErrInfo;
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception ex)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + ex.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// èŽ·å–ä»“ä½åˆ—è¡¨
        /// </summary>
        /// <returns></returns>
        [Route("GetStockPlaceList_Json")]
        [HttpGet]
        public object GetStockPlaceList_Json(string StockPlace, Int64 HWhID)
        {
            sWhere = " Where HStopFlag=0  and HEndFlag=1";
            //sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
            if (HWhID == 0)
            {
                if (StockPlace != "")
                {
                    sWhere = " Where HStopFlag=0  and ( HNumber like '%" + StockPlace + "%' or HName like '%" + StockPlace + "%' ) ";
                }
                else
                {
                    sWhere = " Where HStopFlag=0 ";
                }
            }
            else
            {
                if (StockPlace != "")
                {
                    sWhere = " Where HStopFlag=0 and HWHID=" + HWhID.ToString() + " and ( HNumber like '%" + StockPlace + "%' or HName like '%" + StockPlace + "%' ) ";
                }
                else
                {
                    sWhere = " Where HStopFlag=0 and HWHID=" + HWhID.ToString();
                }
            }
            try
            {
                ds = webserver.GetStockPlaceList(sWhere, ref DBUtility.ClsPub.sErrInfo);
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败" + DBUtility.ClsPub.sErrInfo;
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception ex)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + ex.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// èŽ·å–ä¾›åº”å•†åˆ—è¡¨
        /// </summary>
        /// <returns></returns>
        [Route("GetSupplierList_Json")]
        [HttpGet]
        public object GetSupplierList_Json(string Supplier)
        {
            sWhere = " Where HStopFlag=0  and HEndFlag=1";
            //sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
            if (Supplier != "")
            {
                sWhere = sWhere + " and ( HNumber like '%" + Supplier + "%' or HName like '%" + Supplier + "%' ) ";
            }
            try
            {
                ds = webserver.GetSupplierList(sWhere, ref DBUtility.ClsPub.sErrInfo);
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败" + DBUtility.ClsPub.sErrInfo;
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception ex)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + ex.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// èŽ·å–å®¢æˆ·åˆ—è¡¨
        /// </summary>
        /// <returns></returns>
        [Route("GetCustomerList_Json")]
        [HttpGet]
        public object GetCustomerList_Json(string Customer)
        {
            sWhere = " Where HStopFlag=0  and HEndFlag=1";
            //sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
            if (Customer != "")
            {
                sWhere = sWhere + " and ( HNumber like '%" + Customer + "%' or HName like '%" + Customer + "%' ) ";
            }
            try
            {
                ds = webserver.GetCustomerList(sWhere, ref DBUtility.ClsPub.sErrInfo);
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败" + DBUtility.ClsPub.sErrInfo;
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception ex)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + ex.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// èŽ·å–èŒå‘˜åˆ—è¡¨
        /// </summary>
        /// <returns></returns>
        [Route("GetEmployeeList_Json")]
        [HttpGet]
        public object GetEmployeeList_Json(string Employee, Int64 HGroupID)
        {
            sWhere = " Where HStopFlag=0  and HEndFlag=1";
            //sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
            if (HGroupID == 0)
            {
                if (Employee != "")
                {
                    sWhere = " Where HStopFlag=0  and ( HNumber like '%" + Employee + "%' or HName like '%" + Employee + "%' ) ";
                }
                else
                {
                    sWhere = " Where HStopFlag=0 ";
                }
            }
            else
            {
                if (Employee != "")
                {
                    sWhere = " Where HStopFlag=0 and HWHID=" + HGroupID.ToString() + " and ( HNumber like '%" + Employee + "%' or HName like '%" + Employee + "%' ) ";
                }
                else
                {
                    sWhere = " Where HStopFlag=0 and HWHID=" + HGroupID.ToString();
                }
            }
            try
            {
                ds = webserver.GetEmployeeList(sWhere, ref DBUtility.ClsPub.sErrInfo);
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败" + DBUtility.ClsPub.sErrInfo;
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception ex)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + ex.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// èŽ·å–éƒ¨é—¨åˆ—è¡¨
        /// </summary>
        /// <returns></returns>
        [Route("GetDepartmentList_Json")]
        [HttpGet]
        public object GetDepartmentList_Json(string Department)
        {
            sWhere = " Where HStopFlag=0  and HEndFlag=1";
            //sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
            if (Department != "")
            {
                sWhere = sWhere + " and ( HNumber like '%" + Department + "%' or HName like '%" + Department + "%' ) ";
            }
            try
            {
                ds = webserver.GetDepartmentList(sWhere, ref DBUtility.ClsPub.sErrInfo);
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败" + DBUtility.ClsPub.sErrInfo;
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception ex)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + ex.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        #endregion
    }
}
WebAPI/DLL.zip
Binary files differ
WebAPI/DLL/BLL.dll
Binary files differ
WebAPI/DLL/DAL.dll
Binary files differ
WebAPI/DLL/DBUtility.dll
Binary files differ
WebAPI/DLL/Kingdee.BOS.WebApi.Client.dll
Binary files differ
WebAPI/DLL/Kingdee.BOS.WebApi.FormService.dll
Binary files differ
WebAPI/DLL/Kingdee.BOS.WebApi.ServicesStub.dll
Binary files differ
WebAPI/DLL/Model.dll
Binary files differ
WebAPI/DLL/Newtonsoft.Json.Net35.dll
Binary files differ
WebAPI/DLL/Pub_Class.dll
Binary files differ
WebAPI/DLL/Pub_Control.dll
Binary files differ
WebAPI/DLL/SQLHelper.dll
Binary files differ
WebAPI/DLL/System.Net.Http.Formatting.dll
Binary files differ
WebAPI/DLL/System.Web.Http.WebHost.dll
Binary files differ
WebAPI/DLL/System.Web.Http.dll
Binary files differ
WebAPI/Global.asax
New file
@@ -0,0 +1 @@
<%@ Application Codebehind="Global.asax.cs" Inherits="WebAPI.WebApiApplication" Language="C#" %>
WebAPI/Global.asax.cs
New file
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Routing;
namespace WebAPI
{
    public class WebApiApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            GlobalConfiguration.Configure(WebApiConfig.Register);
        }
    }
}
WebAPI/Index.html
New file
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
<div>WEBAPI连接成功!</div>
</body>
</html>
WebAPI/ListModels.cs
New file
@@ -0,0 +1,85 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization.Json;
using System.IO;
using System.Text;
using WebAPI.Code;
namespace WebAPI
{
    public class ListModels
    {
        //public List<Test2> getMainObjectByJson2(string jsonString)
        //{
        //    // å®žä¾‹åŒ–DataContractJsonSerializer对象,需要待序列化的对象类型
        //    DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(List<Test2>)); //ClsCg_POInStockBillMain_K3
        //    //把Json传入内存流中保存
        //    jsonString = "[" + jsonString + "]";
        //   // MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(jsonString));
        //    using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(jsonString)))
        //    {
        //        object ob = serializer.ReadObject(stream);
        //        List<Test2> ls = (List<Test2>)ob;
        //        return ls;
        //    }
        //    // ä½¿ç”¨ReadObject方法反序列化成对象
        //}
        public List<Model.ClsCg_POInStockBillSub> getObjectByJson_POInStockSub(string jsonString)
        {
            jsonString = "[" + jsonString + "]";
            List<Model.ClsCg_POInStockBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsCg_POInStockBillSub>>(jsonString);
            return list;
            //// å®žä¾‹åŒ–DataContractJsonSerializer对象,需要待序列化的对象类型
            //DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(List<Model.ClsCg_POInStockBillSub>));
            ////把Json传入内存流中保存
            //jsonString = "[" + jsonString + "]";
            //using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(jsonString)))
            //{
            //    // ä½¿ç”¨ReadObject方法反序列化成对象
            //    object ob = serializer.ReadObject(stream);
            //    List<Model.ClsCg_POInStockBillSub> ls = (List<Model.ClsCg_POInStockBillSub>)ob;
            //    return ls;
            //}
        }
        /// <summary>
        /// å°†json数据转换成子表实体类
        /// </summary>
        /// <returns></returns>
        //public List<Model.ClsCg_POInStockBillSub_K3> getObjectByJson(string jsonString)
        //{
        //    // å®žä¾‹åŒ–DataContractJsonSerializer对象,需要待序列化的对象类型
        //    DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(List<Model.ClsCg_POInStockBillSub_K3>));
        //    //把Json传入内存流中保存
        //    jsonString = "[" + jsonString + "]";
        //    using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(jsonString)))
        //    {
        //        // ä½¿ç”¨ReadObject方法反序列化成对象
        //        object ob = serializer.ReadObject(stream);
        //        List<Model.ClsCg_POInStockBillSub_K3> ls = (List<Model.ClsCg_POInStockBillSub_K3>)ob;
        //        return ls;
        //    }
        //}
        public List<Model.ClsCg_POInStockBillMain> getObjectByJson_POInStockMain(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsCg_POInStockBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsCg_POInStockBillMain>>(jsonString);
            return list;
        }
        public List<Model.ClsGy_BarCodeBill_WMS_Model> getObjectByJson_BarCode(string jsonString)
        {
            jsonString = "[" + jsonString + "]";
            List<Model.ClsGy_BarCodeBill_WMS_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_BarCodeBill_WMS_Model>>(jsonString);
            return list;
        }
        public List<Model.ClsGy_MaterialList_WMS_Model> getObjectByJson_MaterialList(string jsonString)
        {
            jsonString = "[" + jsonString + "]";
            List<Model.ClsGy_MaterialList_WMS_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_MaterialList_WMS_Model>>(jsonString);
            return list;
        }
    }
}
WebAPI/Metadata/deploymentTemplates/apiappconfig.azureresource.json
New file
@@ -0,0 +1,10 @@
{
  "$schema": "http://schemas.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "$system": {
      "type": "Object"
    }
  },
  "resources": []
}
WebAPI/Models/ClsCg_POInStockBill.cs
New file
@@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsCg_POInStockBill
    {
        public string HDateForWeb;
        public string HAddress;//     varchar(200)                --交货地点
        public Int64 HSupID;//      int                 --供应商 ï¼ˆGy_Supplier)
        public Int64 HCurID;//    int                  --币别 (Gy_Currency)
        public Int64 HWHID;//      int     --仓库
        public Single HExRate;//    money                  --汇率  (选择完币别带出)
        public Int64 HEmpID;//     int                   --业务员  (Gy_Employee)
        public Int64 HMangerID;//  int                 --主管    (Gy_Employee)
        public Int64 HDeptID;//     int                 --部门    (Gy_Employee)
        public string HExplanation;//  varchar(200)             --ÕªÒª
        public string HInnerBillNo;//  varchar(50)             --内部单据号
        //public DateTime HEntryCloseDate;//   datetime      --行关闭 (默认为'')        new
        //public string HRemark;//         varchar(200)        --备注
        public Int64 HMaterID;//  int      --物料ID (Gy_Material)
        public Int64 HUnitID;//    int    --计量单位 (Gy_Unit)
        public double HQty;//     dec(18,8)         --要货数量
        public double HCheckQty;        //检验数
        public double HPassQty;         //合格数
        public double HBadQty;          //不合格数
        public double HPrice;//   dec(18,8)         --原币单价
        public double HMoney;//   dec(18,8)         --原币金额
       // public Int64 HWHID;//              --收料仓库
        public Int64 HPOOrderInterID;//
        public Int64 HPOOrderEntryID;//
        public string HPOOrderBillNo;//
        public DateTime HDate;   //要货时间
        public Int64 HState;
        public string HBackDate;
        public string HBacker;
        public long HBillerID;
        public string HBillNo;
        public int HBillStatus;
        public string HBillSubType;
        public string HBillType;
        public string HCheckDate;
        public string HChecker;
        public long HCheckFlowID;
        public long HCheckItemNextID;
        public long HCheckItemNowID;
        public string HCloseDate;
       // public string HCloseMan;
        public bool HCloseType;
       // public DateTime HDate;
        public string HDeleteDate;
        public string HDeleteMan;
        public string HEmpCode;
        public string HMainSourceBillNo;
        public string HMainSourceBillType;
        public long HMainSourceEntryID;
        public long HMainSourceInterID;
        public string HMakeDate;
        public string HMaker;
        public long HPeriod;
        //public string HRemark;
        public string HUpDateDate;
        public string HUpDater;
        public long HYear;
        // public string HCloseMan;
       // public bool HCloseType;
        public DateTime HEntryCloseDate;
        public long HEntryID;
        public long HInterID;
        public double HRelationMoney;
        public double HRelationQty;
        public string HRemark;
        public string HSourceBillNo;
        public string HSourceBillType;
        public long HSourceEntryID;
        public long HSourceInterID;
        //public ClsCg_POInStockBill();
    }
}
WebAPI/Models/JsonResult.cs
New file
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebAPI.Models
{
    public class JsonResult
    {
        public string code { get; set; }
        public int count { get; set; }
        public string Message { get; set; }
        public object data { get; set; }
    }
}
WebAPI/Models/Pensen.cs
New file
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebAPI.Models
{
    public class Pensen
    {
        /// <summary>
        ///姓名
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// å¯†ç 
        /// </summary>
        public string Pwd { get; set; }
    }
}
WebAPI/Models/json.cs
New file
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WebAPI.Models
{
    public class json
    {
        public string code { get; set; }
        public int count { get; set; }
        public string Message { get; set; }
        public object data { get; set; }
    }
}
WebAPI/Properties/AssemblyInfo.cs
New file
@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// æœ‰å…³ç¨‹åºé›†çš„常规信息通过下列特性集
// æŽ§åˆ¶ã€‚更改这些特性值可修改
// ä¸Žç¨‹åºé›†å…³è”的信息。
[assembly: AssemblyTitle("WebAPI")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WebAPI")]
[assembly: AssemblyCopyright("Copyright Â©  2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// å°† ComVisible è®¾ç½®ä¸º false ä¼šä½¿æ­¤ç¨‹åºé›†ä¸­çš„类型
// å¯¹ COM ç»„件不可见。如果需要
// ä»Ž COM è®¿é—®æ­¤ç¨‹åºé›†ä¸­çš„æŸä¸ªç±»åž‹ï¼Œè¯·é’ˆå¯¹è¯¥ç±»åž‹å°† ComVisible ç‰¹æ€§è®¾ç½®ä¸º true。
[assembly: ComVisible(false)]
// å¦‚果此项目向 COM å…¬å¼€ï¼Œåˆ™ä¸‹åˆ— GUID ç”¨äºŽ typelib çš„ ID
[assembly: Guid("2b2ffe83-a979-4aab-9742-c94617729812")]
// ç¨‹åºé›†çš„版本信息由下列四个值组成:
//
//      ä¸»ç‰ˆæœ¬
//      æ¬¡ç‰ˆæœ¬
//      å†…部版本号
//      ä¿®è®¢ç‰ˆæœ¬
//
// å¯ä»¥æŒ‡å®šæ‰€æœ‰å€¼ï¼Œä¹Ÿå¯ä»¥ä½¿ç”¨â€œä¿®è®¢å·â€å’Œâ€œå†…部版本号”的默认值,
// æ–¹æ³•是按如下所示使用 "*":
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
WebAPI/Web.Debug.config
New file
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- æœ‰å…³ä½¿ç”¨ web.config è½¬æ¢çš„详细信息,请访问 http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <!--
    åœ¨ä¸‹ä¾‹ä¸­ï¼Œâ€œSetAttributes”转换将更改
    â€œconnectionString”的值,以仅在“Match”定位器
    æ‰¾åˆ°å€¼ä¸ºâ€œMyDB”的特性“name”时使用“ReleaseSQLServer”。
    <connectionStrings>
      <add name="MyDB"
        connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
        xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
    </connectionStrings>
  -->
  <system.web>
    <!--
      åœ¨ä¸‹ä¾‹ä¸­ï¼Œâ€œReplace”转换将替换
      web.config æ–‡ä»¶çš„æ•´ä¸ª <customErrors> èŠ‚ã€‚
      è¯·æ³¨æ„ï¼Œç”±äºŽ
      åœ¨ <system.web> èŠ‚ç‚¹ä¸‹ä»…æœ‰ä¸€ä¸ª customErrors èŠ‚ï¼Œå› æ­¤ä¸éœ€è¦ä½¿ç”¨â€œxdt:Locator”特性。
      <customErrors defaultRedirect="GenericError.htm"
        mode="RemoteOnly" xdt:Transform="Replace">
        <error statusCode="500" redirect="InternalError.htm"/>
      </customErrors>
    -->
  </system.web>
</configuration>
WebAPI/Web.Release.config
New file
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- æœ‰å…³ä½¿ç”¨ web.config è½¬æ¢çš„详细信息,请访问 http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <!--
    åœ¨ä¸‹ä¾‹ä¸­ï¼Œâ€œSetAttributes”转换将更改
    â€œconnectionString”的值,以仅在“Match”定位器
    æ‰¾åˆ°å€¼ä¸ºâ€œMyDB”的特性“name”时使用“ReleaseSQLServer”。
    <connectionStrings>
      <add name="MyDB"
        connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
        xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
    </connectionStrings>
  -->
  <system.web>
    <compilation xdt:Transform="RemoveAttributes(debug)" />
    <!--
      åœ¨ä¸‹ä¾‹ä¸­ï¼Œâ€œReplace”转换将替换
      web.config æ–‡ä»¶çš„æ•´ä¸ª <customErrors> èŠ‚ã€‚
      è¯·æ³¨æ„ï¼Œç”±äºŽ
      åœ¨ <system.web> èŠ‚ç‚¹ä¸‹ä»…æœ‰ä¸€ä¸ª customErrors èŠ‚ï¼Œå› æ­¤ä¸éœ€è¦ä½¿ç”¨â€œxdt:Locator”特性。
      <customErrors defaultRedirect="GenericError.htm"
        mode="RemoteOnly" xdt:Transform="Replace">
        <error statusCode="500" redirect="InternalError.htm"/>
      </customErrors>
    -->
  </system.web>
</configuration>
WebAPI/Web.config
New file
@@ -0,0 +1,57 @@
<?xml version="1.0"?>
<!--
  æœ‰å…³å¦‚何配置 ASP.NET åº”用程序的详细信息,请访问
  http://go.microsoft.com/fwlink/?LinkId=301879
  -->
<configuration>
  <appSettings/>
  <!--
    æœ‰å…³ web.config æ›´æ”¹çš„说明,请参见 http://go.microsoft.com/fwlink/?LinkId=235367。
    å¯åœ¨ <httpRuntime> æ ‡è®°ä¸Šè®¾ç½®ä»¥ä¸‹ç‰¹æ€§ã€‚
      <system.Web>
        <httpRuntime targetFramework="4.5" />
      </system.Web>
  -->
  <system.web>
    <compilation debug="true" targetFramework="4.5"/>
    <httpRuntime/>
    <pages controlRenderingCompatibilityVersion="4.0"/>
  </system.web>
  <system.webServer>
    <handlers>
      <remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
      <!--<remove name="OPTIONSVerbHandler"/>-->
      <remove name="TRACEVerbHandler"/>
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
    </handlers>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="5.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
WebAPI/WebAPI.csproj
New file
@@ -0,0 +1,250 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>
    </ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{5B60CE0C-963C-4DC2-91B3-0B471AAC5438}</ProjectGuid>
    <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>WebAPI</RootNamespace>
    <AssemblyName>WebAPI</AssemblyName>
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    <UseIISExpress>false</UseIISExpress>
    <IISExpressSSLPort />
    <IISExpressAnonymousAuthentication />
    <IISExpressWindowsAuthentication />
    <IISExpressUseClassicPipelineMode />
    <TargetFrameworkProfile />
    <Use64BitIISExpress />
    <UseGlobalApplicationHostFile />
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <Prefer32Bit>false</Prefer32Bit>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <Prefer32Bit>false</Prefer32Bit>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="BLL, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>E:\金科\项目\自主供应商平台\供应商协同平台\DLL\BLL.dll</HintPath>
    </Reference>
    <Reference Include="DAL, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>DLL\DAL.dll</HintPath>
    </Reference>
    <Reference Include="DBUtility, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>E:\金科\项目\自主供应商平台\供应商协同平台\DLL\DBUtility.dll</HintPath>
    </Reference>
    <Reference Include="Kingdee.BOS.WebApi.Client, Version=7.2.904.6, Culture=neutral, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>DLL\Kingdee.BOS.WebApi.Client.dll</HintPath>
    </Reference>
    <Reference Include="Kingdee.BOS.WebApi.FormService, Version=7.2.904.6, Culture=neutral, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>DLL\Kingdee.BOS.WebApi.FormService.dll</HintPath>
    </Reference>
    <Reference Include="Kingdee.BOS.WebApi.ServicesStub, Version=7.2.904.6, Culture=neutral, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>DLL\Kingdee.BOS.WebApi.ServicesStub.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.Azure.AppService.ApiApps.Service, Version=0.9.16.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>..\packages\Microsoft.Azure.AppService.ApiApps.Service.0.9.16\lib\net45\Microsoft.Azure.AppService.ApiApps.Service.dll</HintPath>
      <Private>True</Private>
    </Reference>
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
      <Private>True</Private>
    </Reference>
    <Reference Include="Model, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>DLL\Model.dll</HintPath>
    </Reference>
    <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\..\WeChat Files\shenjie1112005\FileStorage\File\2019-12\webapi接口\FurjaFlatFormAPI\packages\Newtonsoft.Json.5.0.6\lib\net45\Newtonsoft.Json.dll</HintPath>
    </Reference>
    <Reference Include="Pub_Class, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>E:\金科\项目\自主供应商平台\供应商协同平台\DLL\Pub_Class.dll</HintPath>
    </Reference>
    <Reference Include="Pub_Control, Version=1.0.6632.19241, Culture=neutral, processorArchitecture=x86">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>E:\金科\项目\自主供应商平台\供应商协同平台\DLL\Pub_Control.dll</HintPath>
    </Reference>
    <Reference Include="SQLHelper, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>E:\金科\项目\自主供应商平台\供应商协同平台\DLL\SQLHelper.dll</HintPath>
    </Reference>
    <Reference Include="Swashbuckle.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd1bb07a5ac7c7bc, processorArchitecture=MSIL">
      <HintPath>..\packages\Swashbuckle.Core.5.0.0\lib\net40\Swashbuckle.Core.dll</HintPath>
      <Private>True</Private>
    </Reference>
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="System.IdentityModel.Tokens.Jwt, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>..\packages\System.IdentityModel.Tokens.Jwt.4.0.0\lib\net45\System.IdentityModel.Tokens.Jwt.dll</HintPath>
      <Private>True</Private>
    </Reference>
    <Reference Include="System.Net.Http" />
    <Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>DLL\System.Net.Http.Formatting.dll</HintPath>
    </Reference>
    <Reference Include="System.Runtime.Serialization" />
    <Reference Include="System.Web.DynamicData" />
    <Reference Include="System.Web.Entity" />
    <Reference Include="System.Web.ApplicationServices" />
    <Reference Include="System.ComponentModel.DataAnnotations" />
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Web" />
    <Reference Include="System.Web.Extensions" />
    <Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>DLL\System.Web.Http.dll</HintPath>
    </Reference>
    <Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>DLL\System.Web.Http.WebHost.dll</HintPath>
    </Reference>
    <Reference Include="System.Xml" />
    <Reference Include="System.Configuration" />
    <Reference Include="System.Web.Services" />
    <Reference Include="System.EnterpriseServices" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="WebActivatorEx, Version=2.0.0.0, Culture=neutral, PublicKeyToken=7b26dc2a43f6a0d4, processorArchitecture=MSIL">
      <HintPath>..\packages\WebActivatorEx.2.0.6\lib\net40\WebActivatorEx.dll</HintPath>
      <Private>True</Private>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Content Include="DLL\BLL.dll" />
    <Content Include="DLL\DAL.dll" />
    <Content Include="DLL\DBUtility.dll" />
    <Content Include="DLL\Kingdee.BOS.WebApi.Client.dll" />
    <Content Include="DLL\Kingdee.BOS.WebApi.FormService.dll" />
    <Content Include="DLL\Kingdee.BOS.WebApi.ServicesStub.dll" />
    <Content Include="DLL\Model.dll" />
    <Content Include="DLL\Newtonsoft.Json.Net35.dll" />
    <Content Include="DLL\Pub_Class.dll" />
    <Content Include="DLL\Pub_Control.dll" />
    <Content Include="DLL\SQLHelper.dll" />
    <Content Include="Global.asax" />
    <Content Include="Index.html" />
    <Content Include="Web.config">
      <SubType>Designer</SubType>
    </Content>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="App_Start\SwaggerConfig.cs" />
    <Compile Include="App_Start\WebApiConfig.cs" />
    <Compile Include="BLL\WebServer.cs" />
    <Compile Include="Code\Common.cs" />
    <Compile Include="Code\Test2.cs" />
    <Compile Include="Code\TestDAL.cs" />
    <Compile Include="Controllers\BarCodeController.cs" />
    <Compile Include="Controllers\POInStockBackController.cs" />
    <Compile Include="Controllers\POInStockController.cs" />
    <Compile Include="Controllers\PODemandPlanController.cs" />
    <Compile Include="Controllers\EntrustOrderController.cs" />
    <Compile Include="Controllers\POOrderController.cs" />
    <Compile Include="Controllers\ReportController.cs" />
    <Compile Include="ListModels.cs" />
    <Compile Include="Models\ClsCg_POInStockBill.cs" />
    <Compile Include="Models\json.cs" />
    <Compile Include="Controllers\WebAPIController.cs" />
    <Compile Include="Global.asax.cs">
      <DependentUpon>Global.asax</DependentUpon>
    </Compile>
    <Compile Include="Models\JsonResult.cs" />
    <Compile Include="Models\Pensen.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="packages.config" />
    <Content Include="Metadata\deploymentTemplates\apiappconfig.azureresource.json" />
    <Content Include="apiapp.json" />
    <None Include="Properties\PublishProfiles\WEBAPI.pubxml" />
    <None Include="Properties\PublishProfiles\WEBAPIConfig.pubxml" />
    <None Include="Web.Debug.config">
      <DependentUpon>Web.config</DependentUpon>
    </None>
    <None Include="Web.Release.config">
      <DependentUpon>Web.config</DependentUpon>
    </None>
  </ItemGroup>
  <ItemGroup>
    <Folder Include="App_Data\" />
  </ItemGroup>
  <PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
    <DebugSymbols>true</DebugSymbols>
    <OutputPath>bin\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <DebugType>full</DebugType>
    <PlatformTarget>x86</PlatformTarget>
    <ErrorReport>prompt</ErrorReport>
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
    <OutputPath>bin\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <Optimize>true</Optimize>
    <DebugType>pdbonly</DebugType>
    <PlatformTarget>x86</PlatformTarget>
    <ErrorReport>prompt</ErrorReport>
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
  </PropertyGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
        <WebProjectProperties>
          <UseIIS>False</UseIIS>
          <AutoAssignPort>True</AutoAssignPort>
          <DevelopmentServerPort>12761</DevelopmentServerPort>
          <DevelopmentServerVPath>/</DevelopmentServerVPath>
          <IISUrl>http://localhost/WebAPI</IISUrl>
          <NTLMAuthentication>False</NTLMAuthentication>
          <UseCustomServer>False</UseCustomServer>
          <CustomServerUrl>
          </CustomServerUrl>
          <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
        </WebProjectProperties>
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
WebAPI/apiapp.json
New file
@@ -0,0 +1,14 @@
{
  "$schema": "http://json-schema.org/schemas/2014-11-01/apiapp.json#",
  "id": "WebAPI",
  "namespace": "microsoft.com",
  "gateway": "2015-01-14",
  "version": "1.0.0",
  "title": "WebAPI",
  "summary": "",
  "author": "",
  "endpoints": {
    "apiDefinition": "/swagger/docs/v1",
    "status": null
  }
}
WebAPI/packages.config
New file
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Microsoft.AspNet.WebApi" version="5.2.3" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.Client.zh-Hans" version="5.2.3" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.Core.zh-Hans" version="5.2.3" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.WebHost.zh-Hans" version="5.2.3" targetFramework="net45" />
  <package id="Microsoft.Azure.AppService.ApiApps.Service" version="0.9.16" targetFramework="net45" />
  <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
  <package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
  <package id="Swashbuckle" version="5.0.0" targetFramework="net45" />
  <package id="Swashbuckle.Core" version="5.0.0" targetFramework="net45" />
  <package id="System.IdentityModel.Tokens.Jwt" version="4.0.0" targetFramework="net45" />
  <package id="WebActivatorEx" version="2.0.6" targetFramework="net45" />
</packages>
WindowsFormsApp1/App.config
New file
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
    </startup>
</configuration>
WindowsFormsApp1/Program.cs
New file
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
    static class Program
    {
        /// <summary>
        /// åº”用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new TestAPI());
        }
    }
}
WindowsFormsApp1/Properties/AssemblyInfo.cs
New file
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// æœ‰å…³ç¨‹åºé›†çš„一般信息由以下
// æŽ§åˆ¶ã€‚更改这些特性值可修改
// ä¸Žç¨‹åºé›†å…³è”的信息。
[assembly: AssemblyTitle("WindowsFormsApp1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WindowsFormsApp1")]
[assembly: AssemblyCopyright("Copyright Â©  2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// å°† ComVisible è®¾ç½®ä¸º false ä¼šä½¿æ­¤ç¨‹åºé›†ä¸­çš„类型
//对 COM ç»„件不可见。如果需要从 COM è®¿é—®æ­¤ç¨‹åºé›†ä¸­çš„类型
//请将此类型的 ComVisible ç‰¹æ€§è®¾ç½®ä¸º true。
[assembly: ComVisible(false)]
// å¦‚果此项目向 COM å…¬å¼€ï¼Œåˆ™ä¸‹åˆ— GUID ç”¨äºŽç±»åž‹åº“çš„ ID
[assembly: Guid("ffed17b5-612d-404c-a9b8-628ba6dc3257")]
// ç¨‹åºé›†çš„版本信息由下列四个值组成:
//
//      ä¸»ç‰ˆæœ¬
//      æ¬¡ç‰ˆæœ¬
//      ç”Ÿæˆå·
//      ä¿®è®¢å·
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
WindowsFormsApp1/Properties/Resources.Designer.cs
New file
@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
//     æ­¤ä»£ç ç”±å·¥å…·ç”Ÿæˆã€‚
//     è¿è¡Œæ—¶ç‰ˆæœ¬:4.0.30319.42000
//
//     å¯¹æ­¤æ–‡ä»¶çš„æ›´æ”¹å¯èƒ½ä¼šå¯¼è‡´ä¸æ­£ç¡®çš„行为,并且如果
//     é‡æ–°ç”Ÿæˆä»£ç ï¼Œè¿™äº›æ›´æ”¹å°†ä¼šä¸¢å¤±ã€‚
// </auto-generated>
//------------------------------------------------------------------------------
namespace WindowsFormsApp1.Properties {
    using System;
    /// <summary>
    ///   ä¸€ä¸ªå¼ºç±»åž‹çš„资源类,用于查找本地化的字符串等。
    /// </summary>
    // æ­¤ç±»æ˜¯ç”± StronglyTypedResourceBuilder
    // ç±»é€šè¿‡ç±»ä¼¼äºŽ ResGen æˆ– Visual Studio çš„工具自动生成的。
    // è‹¥è¦æ·»åŠ æˆ–ç§»é™¤æˆå‘˜ï¼Œè¯·ç¼–è¾‘ .ResX æ–‡ä»¶ï¼Œç„¶åŽé‡æ–°è¿è¡Œ ResGen
    // (以 /str ä½œä¸ºå‘½ä»¤é€‰é¡¹),或重新生成 VS é¡¹ç›®ã€‚
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    internal class Resources {
        private static global::System.Resources.ResourceManager resourceMan;
        private static global::System.Globalization.CultureInfo resourceCulture;
        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal Resources() {
        }
        /// <summary>
        ///   è¿”回此类使用的缓存的 ResourceManager å®žä¾‹ã€‚
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WindowsFormsApp1.Properties.Resources", typeof(Resources).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }
        /// <summary>
        ///   ä½¿ç”¨æ­¤å¼ºç±»åž‹èµ„源类,为所有资源查找
        ///   é‡å†™å½“前线程的 CurrentUICulture å±žæ€§ã€‚
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }
    }
}
WindowsFormsApp1/Properties/Resources.resx
New file
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
  <!--
    Microsoft ResX Schema
    Version 2.0
    The primary goals of this format is to allow a simple XML format
    that is mostly human readable. The generation and parsing of the
    various data types are done through the TypeConverter classes
    associated with the data types.
    Example:
    ... ado.net/XML headers & schema ...
    <resheader name="resmimetype">text/microsoft-resx</resheader>
    <resheader name="version">2.0</resheader>
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
        <value>[base64 mime encoded serialized .NET Framework object]</value>
    </data>
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
        <comment>This is a comment</comment>
    </data>
    There are any number of "resheader" rows that contain simple
    name/value pairs.
    Each data row contains a name, and value. The row also contains a
    type or mimetype. Type corresponds to a .NET class that support
    text/value conversion through the TypeConverter architecture.
    Classes that don't support this are serialized and stored with the
    mimetype set.
    The mimetype is used for serialized objects, and tells the
    ResXResourceReader how to depersist the object. This is currently not
    extensible. For a given mimetype the value must be set accordingly:
    Note - application/x-microsoft.net.object.binary.base64 is the format
    that the ResXResourceWriter will generate, however the reader can
    read any of the formats listed below.
    mimetype: application/x-microsoft.net.object.binary.base64
    value   : The object must be serialized with
            : System.Serialization.Formatters.Binary.BinaryFormatter
            : and then encoded with base64 encoding.
    mimetype: application/x-microsoft.net.object.soap.base64
    value   : The object must be serialized with
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
            : and then encoded with base64 encoding.
    mimetype: application/x-microsoft.net.object.bytearray.base64
    value   : The object must be serialized into a byte array
            : using a System.ComponentModel.TypeConverter
            : and then encoded with base64 encoding.
    -->
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xsd:element name="root" msdata:IsDataSet="true">
      <xsd:complexType>
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="metadata">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" />
              <xsd:attribute name="type" type="xsd:string" />
              <xsd:attribute name="mimetype" type="xsd:string" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="assembly">
            <xsd:complexType>
              <xsd:attribute name="alias" type="xsd:string" />
              <xsd:attribute name="name" type="xsd:string" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="data">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="resheader">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" />
            </xsd:complexType>
          </xsd:element>
        </xsd:choice>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
  <resheader name="version">
    <value>2.0</value>
  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
</root>
WindowsFormsApp1/Properties/Settings.Designer.cs
New file
@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
//     æ­¤ä»£ç ç”±å·¥å…·ç”Ÿæˆã€‚
//     è¿è¡Œæ—¶ç‰ˆæœ¬:4.0.30319.42000
//
//     å¯¹æ­¤æ–‡ä»¶çš„æ›´æ”¹å¯èƒ½ä¼šå¯¼è‡´ä¸æ­£ç¡®çš„行为,并且如果
//     é‡æ–°ç”Ÿæˆä»£ç ï¼Œè¿™äº›æ›´æ”¹å°†ä¼šä¸¢å¤±ã€‚
// </auto-generated>
//------------------------------------------------------------------------------
namespace WindowsFormsApp1.Properties {
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
        public static Settings Default {
            get {
                return defaultInstance;
            }
        }
    }
}
WindowsFormsApp1/Properties/Settings.settings
New file
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
  <Profiles>
    <Profile Name="(Default)" />
  </Profiles>
  <Settings />
</SettingsFile>
WindowsFormsApp1/TestAPI.Designer.cs
New file
@@ -0,0 +1,74 @@
namespace WindowsFormsApp1
{
    partial class TestAPI
    {
        /// <summary>
        /// å¿…需的设计器变量。
        /// </summary>
        private System.ComponentModel.IContainer components = null;
        /// <summary>
        /// æ¸…理所有正在使用的资源。
        /// </summary>
        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }
        #region Windows çª—体设计器生成的代码
        /// <summary>
        /// è®¾è®¡å™¨æ”¯æŒæ‰€éœ€çš„æ–¹æ³• - ä¸è¦ä¿®æ”¹
        /// ä½¿ç”¨ä»£ç ç¼–辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            this.btnCS = new System.Windows.Forms.Button();
            this.txtTest = new System.Windows.Forms.TextBox();
            this.SuspendLayout();
            //
            // btnCS
            //
            this.btnCS.Location = new System.Drawing.Point(365, 122);
            this.btnCS.Name = "btnCS";
            this.btnCS.Size = new System.Drawing.Size(75, 23);
            this.btnCS.TabIndex = 0;
            this.btnCS.Text = "测试";
            this.btnCS.UseVisualStyleBackColor = true;
            this.btnCS.Click += new System.EventHandler(this.btnCS_Click);
            //
            // txtTest
            //
            this.txtTest.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.txtTest.Location = new System.Drawing.Point(225, 55);
            this.txtTest.Multiline = true;
            this.txtTest.Name = "txtTest";
            this.txtTest.Size = new System.Drawing.Size(380, 51);
            this.txtTest.TabIndex = 1;
            //
            // TestAPI
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(800, 450);
            this.Controls.Add(this.txtTest);
            this.Controls.Add(this.btnCS);
            this.Name = "TestAPI";
            this.Text = "测试";
            this.ResumeLayout(false);
            this.PerformLayout();
        }
        #endregion
        private System.Windows.Forms.Button btnCS;
        private System.Windows.Forms.TextBox txtTest;
    }
}
WindowsFormsApp1/TestAPI.cs
New file
@@ -0,0 +1,152 @@
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 WebAPI;
using WebAPI.Code;
using WebAPI.Controllers;
using WebAPI.Models;
namespace WindowsFormsApp1
{
    public partial class TestAPI : Form
    {
        public TestAPI()
        {
            InitializeComponent();
        }
        private JsonResult objJsonResult = new JsonResult();
        public static string GetSession(string sMsg)
        {
            try
            {
                string s = Common.GetSession();
                return s;
            }
            catch (Exception e)
            {
                return "";
            }
        }
        private void btnCS_Click(object sender, EventArgs e)
        {
          // // string a=string.Format(");
          //  PayRollController web = new PayRollController();
          //  //WebAPIController web2=new WebAPIController();
          //  //string Json="{\"HState\":\"未确认\",\"hmainid\":29,\"hdate\":\"2019-12-20\",\"hjhdate\":\"2019-12-20\",\"hbillno\":\"CGYH000000000072\",\"hbilltype\":\"1114\",\"hsupid\":2214,\"supHNumber\":\"01.001\",\"supHName\":\"戴尔(中国)有限公司\",\"hcurid\":0,\"curhnumber\":\"*\",\"curhname\":\"*\",\"hexrate\":0,\"HMTONO\":\"\",\"HEmpID\":0,\"hywnumber\":null,\"hywname\":null,\"hmanagerid\":0,\"hmanagerNumber\":null,\"hmanagerName\":null,\"HDeptID\":0,\"HDepNumber\":null,\"HDepName\":null,\"hexplanation\":\"\",\"hremark\":\"\",\"hinnerbillno\":\"\",\"hmaker\":\"admin\",\"hmakedate\":\"2019-12-20\",\"hchecker\":\"admin\",\"hcheckdate\":\"2019-12-20\",\"hupdater\":\"\",\"hupdatedate\":null,\"hcloseman\":\"\",\"hclosedate\":null,\"hdeleteman\":\"\",\"hdeletedate\":null,\"hsubid\":1,\"hmaterid\":178070,\"hmaterNumber\":\"CS0001\",\"hmaterName\":\"塑料ABS\",\"hmaterModel\":\"黑色麻面铁皮\",\"hunitid\":2635,\"hunitNumber\":\"03\",\"hunitName\":\"kg\",\"HQty\":300,\"hprice\":0,\"hmoney\":0,\"HTaxPrice\":0,\"hEcloseman\":\"\",\"hclosetype\":false,\"hEremark\":\"\",\"HSourceInterID\":230087,\"HSourceEntryID\":1,\"HSourceBillNo\":\"POORD177806\",\"HSourceBillType\":\"71\",\"HPOOrderInterID\":230087,\"HPOOrderEntryID\":1,\"HPOOrderBillNo\":\"POORD177806\",\"sumQty\":0,\"HWsumQty\":300}";
          //  //JObject job = JObject.Parse(Json);
          ////  string json = "[{\"HInterID\":0,\"HEntryID\":0,\"HSourceInterID\":2213,\"HDate\":\"2017-12-12\",\"HSourceEntryID\":5,\"HRemark\":\"打草机HLT4027(56003871)\",\"HSourceBillNo\":\"NBA222\",\"SourceBillType\":\"\",\"HQty\":0,\"HPrice\":20,\"HMoney\":30,\"HPOOrderBillNo\":\"JJJJJ\"}]";
          //  string json = "{\"HBillNo\":\"DD180730\",\"HDate\":\"2019-11-22T00:00:00\",\"HManagerName\":\"\",\"HManagerID\":\"0\",\"HSupName\":\"\",\"HSupID\":\"1034\",\"HRemark\":\"\",\"HEmpName\":\"\",\"HEmpID\":\"0\",\"HMakerDate\":\"\",\"HMaker\":\"毛映映\",\"HCheckDate\":\"2019-11-22T14:06:57\",\"HChecker\":\"毛映映\",\"HInterID\":\"55\"}";
          ////  SaverPOInStock(json,json);//GetPOInStockShowBillSub
          //  SaverPOInStock(json);
          //  web2.GetPOInStockShowBillSub("28", "28,5;");
            //if (job["hbillno"].ToString() == "CGYH000000000072")
            //{
            //    MessageBox.Show(job["hbillno"].ToString());
            //}
            //MessageBox.Show("没取到!");
           // web.GetUser(Convert.ToInt64(txtTest.Text));
           // web.GetUser();
        }
        public object SaverPOInStock(string msg)
        {
            //var _value = msg["msg"].ToString();
            //string msg1 = _value.ToString();
            //string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            //string msg2 = sArray[0].ToString();
            //string msg3 = sArray[1].ToString();
            //HttpContextBase context = (HttpContextBase)Request.Properties["MS_HttpContext"];//获取传统context
            //HttpRequestBase request = context.Request;//定义传统request对象
            //string callback = request.Form["callback"];
            //using (StreamWriter sw = new StreamWriter(@"D:\log.txt"))
            //{
            //    sw.Write("callback:" + callback);
            //}
            ListModels oListModels = new ListModels();
            try
            {
                DAL.ClsCg_POInStockBill oBill = new DAL.ClsCg_POInStockBill();
                // TestDAL oBill = new TestDAL();
                List<Model.ClsCg_POInStockBillMain> lsmain = new List<Model.ClsCg_POInStockBillMain>();
                //msg2 = msg2.Substring(1, msg2.Length - 2);
                msg = msg.Replace("\\", "");
                msg = msg.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_POInStockMain(msg);
                foreach (Model.ClsCg_POInStockBillMain oItem in lsmain)
                {
                    oItem.HMaker = GetSession("");
                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                    oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
                    oItem.HCurID = 1;
                    oItem.HMainSourceInterID = oItem.HInterID;
                    oItem.HInterID = DBUtility.ClsPub.CreateBillID("1103", ref DBUtility.ClsPub.sExeReturnInfo);
                    oBill.omodel = oItem;
                }
                // msg2= "[{\"HMaterID\":70952,\"HMaterNumber\":\"3.02.DT127.006\",\"HMaterName\":\"白板面板\",\"HMaterModel\":\"黑色麻面铁皮 412 * 412 * 0.21mm 1出1 468U00 - 04\n\",\"HUnitID\":249,\"HUnitName\":\"PCS\",\"HQty\":2268,\"HPrice\":0,\"HMoney\":0,\"HDate\":\"2019 / 12 / 18 0:00:00\",\"HDate2\":\"2019 / 12 / 20 8:30:22\",\"HSourceInterID\":819,\"HSourceEntryID\":4,\"HSourceBillNo\":\"CGPG000000000973\",\"HSourceBillType\":\"1114\",\"HPOOrderBillNo\":\"POORD047421\",\"HPOOrderInterID\":49365,\"HPOOrderEntryID\":5,\"HMTONO\":\"G19 - 339 - 05\"}]";
                //表体数据
                //按 },{来拆分数组 //去掉【和】
                //  msg3 = msg3.Substring(1, msg3.Length - 2);
                //msg3 = msg3.Replace("\\", "");
                //msg3 = msg3.Replace("\n", "");  //\n
                //msg2 = msg2.Replace("'", "’");
                List<Model.ClsCg_POInStockBillSub> ls = new List<Model.ClsCg_POInStockBillSub>();
                ls = oListModels.getObjectByJson_POInStockSub(msg);
                int i = 1;
                foreach (Model.ClsCg_POInStockBillSub oItemSub in ls)
                {
                    oItemSub.HEntryID = i;
                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                    oItemSub.HCloseType = false;
                    oBill.DetailColl.Add(oItemSub);
                    i++;
                }
                //保存前判断(单据号重复,笔录项目)
                //保存
                //保存完毕后处理
                bool bResult;
                if (oBill.omodel.HInterID != 0)
                {
                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                }
                else
                {
                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                }
                if (bResult)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
    }
}
WindowsFormsApp1/TestAPI.csproj
New file
@@ -0,0 +1,185 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{FFED17B5-612D-404C-A9B8-628BA6DC3257}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <RootNamespace>WindowsFormsApp1</RootNamespace>
    <AssemblyName>WindowsFormsApp1</AssemblyName>
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
    <Deterministic>true</Deterministic>
    <TargetFrameworkProfile />
    <PublishUrl>发布\</PublishUrl>
    <Install>true</Install>
    <InstallFrom>Disk</InstallFrom>
    <UpdateEnabled>false</UpdateEnabled>
    <UpdateMode>Foreground</UpdateMode>
    <UpdateInterval>7</UpdateInterval>
    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
    <UpdatePeriodically>false</UpdatePeriodically>
    <UpdateRequired>false</UpdateRequired>
    <MapFileExtensions>true</MapFileExtensions>
    <ApplicationRevision>0</ApplicationRevision>
    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
    <IsWebBootstrapper>false</IsWebBootstrapper>
    <UseApplicationTrust>false</UseApplicationTrust>
    <BootstrapperEnabled>true</BootstrapperEnabled>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
    <DebugSymbols>true</DebugSymbols>
    <OutputPath>bin\x86\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <DebugType>full</DebugType>
    <PlatformTarget>x86</PlatformTarget>
    <ErrorReport>prompt</ErrorReport>
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
    <Prefer32Bit>true</Prefer32Bit>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
    <OutputPath>bin\x86\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <Optimize>true</Optimize>
    <DebugType>pdbonly</DebugType>
    <PlatformTarget>x86</PlatformTarget>
    <ErrorReport>prompt</ErrorReport>
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
    <Prefer32Bit>true</Prefer32Bit>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="BLL">
      <HintPath>..\WebAPI\DLL\BLL.dll</HintPath>
    </Reference>
    <Reference Include="DAL">
      <HintPath>..\WebAPI\DLL\DAL.dll</HintPath>
    </Reference>
    <Reference Include="DBUtility">
      <HintPath>..\WebAPI\DLL\DBUtility.dll</HintPath>
    </Reference>
    <Reference Include="Model">
      <HintPath>..\WebAPI\DLL\Model.dll</HintPath>
    </Reference>
    <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\..\WeChat Files\shenjie1112005\FileStorage\File\2019-12\webapi接口\FurjaFlatFormAPI\packages\Newtonsoft.Json.5.0.6\lib\net45\Newtonsoft.Json.dll</HintPath>
    </Reference>
    <Reference Include="Newtonsoft.Json.Net35">
      <HintPath>..\WebAPI\DLL\Newtonsoft.Json.Net35.dll</HintPath>
    </Reference>
    <Reference Include="Pub_Class">
      <HintPath>..\WebAPI\DLL\Pub_Class.dll</HintPath>
    </Reference>
    <Reference Include="Pub_Control">
      <HintPath>..\WebAPI\DLL\Pub_Control.dll</HintPath>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\WebAPI\DLL\System.Net.Http.Formatting.dll</HintPath>
    </Reference>
    <Reference Include="System.Web" />
    <Reference Include="System.Web.Abstractions" />
    <Reference Include="System.Web.Extensions" />
    <Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\..\WeChat Files\shenjie1112005\FileStorage\File\2019-12\webapi接口\FurjaFlatFormAPI\packages\Microsoft.AspNet.WebApi.Core.5.0.0\lib\net45\System.Web.Http.dll</HintPath>
    </Reference>
    <Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>bin\Debug\System.Web.Http.WebHost.dll</HintPath>
    </Reference>
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Deployment" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Net.Http" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="TestAPI.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="TestAPI.Designer.cs">
      <DependentUpon>TestAPI.cs</DependentUpon>
    </Compile>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <EmbeddedResource Include="Properties\Resources.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <Compile Include="Properties\Resources.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Resources.resx</DependentUpon>
      <DesignTime>True</DesignTime>
    </Compile>
    <EmbeddedResource Include="TestAPI.resx">
      <DependentUpon>TestAPI.cs</DependentUpon>
    </EmbeddedResource>
    <None Include="Properties\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
    </None>
    <Compile Include="Properties\Settings.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <None Include="App.config">
      <SubType>Designer</SubType>
    </None>
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\WebAPI\WebAPI.csproj">
      <Project>{5b60ce0c-963c-4dc2-91b3-0b471aac5438}</Project>
      <Name>WebAPI</Name>
    </ProjectReference>
  </ItemGroup>
  <ItemGroup>
    <BootstrapperPackage Include=".NETFramework,Version=v4.5">
      <Visible>False</Visible>
      <ProductName>Microsoft .NET Framework 4.5 %28x86 å’Œ x64%29</ProductName>
      <Install>true</Install>
    </BootstrapperPackage>
    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
      <Visible>False</Visible>
      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
      <Install>false</Install>
    </BootstrapperPackage>
    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
      <Visible>False</Visible>
      <ProductName>.NET Framework 3.5 SP1</ProductName>
      <Install>false</Install>
    </BootstrapperPackage>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
WindowsFormsApp1/TestAPI.resx
New file
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
  <!--
    Microsoft ResX Schema
    Version 2.0
    The primary goals of this format is to allow a simple XML format
    that is mostly human readable. The generation and parsing of the
    various data types are done through the TypeConverter classes
    associated with the data types.
    Example:
    ... ado.net/XML headers & schema ...
    <resheader name="resmimetype">text/microsoft-resx</resheader>
    <resheader name="version">2.0</resheader>
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
        <value>[base64 mime encoded serialized .NET Framework object]</value>
    </data>
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
        <comment>This is a comment</comment>
    </data>
    There are any number of "resheader" rows that contain simple
    name/value pairs.
    Each data row contains a name, and value. The row also contains a
    type or mimetype. Type corresponds to a .NET class that support
    text/value conversion through the TypeConverter architecture.
    Classes that don't support this are serialized and stored with the
    mimetype set.
    The mimetype is used for serialized objects, and tells the
    ResXResourceReader how to depersist the object. This is currently not
    extensible. For a given mimetype the value must be set accordingly:
    Note - application/x-microsoft.net.object.binary.base64 is the format
    that the ResXResourceWriter will generate, however the reader can
    read any of the formats listed below.
    mimetype: application/x-microsoft.net.object.binary.base64
    value   : The object must be serialized with
            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
            : and then encoded with base64 encoding.
    mimetype: application/x-microsoft.net.object.soap.base64
    value   : The object must be serialized with
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
            : and then encoded with base64 encoding.
    mimetype: application/x-microsoft.net.object.bytearray.base64
    value   : The object must be serialized into a byte array
            : using a System.ComponentModel.TypeConverter
            : and then encoded with base64 encoding.
    -->
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    <xsd:element name="root" msdata:IsDataSet="true">
      <xsd:complexType>
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="metadata">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" />
              </xsd:sequence>
              <xsd:attribute name="name" use="required" type="xsd:string" />
              <xsd:attribute name="type" type="xsd:string" />
              <xsd:attribute name="mimetype" type="xsd:string" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="assembly">
            <xsd:complexType>
              <xsd:attribute name="alias" type="xsd:string" />
              <xsd:attribute name="name" type="xsd:string" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="data">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="resheader">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" />
            </xsd:complexType>
          </xsd:element>
        </xsd:choice>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
  <resheader name="version">
    <value>2.0</value>
  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
</root>
¼ÓÔØÊ§°Ü.txt
New file
@@ -0,0 +1 @@
USEIIS æ”¹ä¸ºFALSE
ÎïÁÏÌõÂë.grf
New file
@@ -0,0 +1,452 @@
Object Report
    Version='6.0.0.6'
    Title='你的报表标题'
    PrintAsDesignPaper=F
    Object Font
        Name='宋体'
        Size=105000,0
        Weight=400
        Charset=134
    End
    Object Printer
        Size=256
        Width=8
        Height=6
        LeftMargin=0
        TopMargin=0
        RightMargin=0
        BottomMargin=0
    End
    Object DetailGrid
        CenterView=T
        ShowColLine=F
        ShowRowLine=F
        Object Border
            Object Pen
                Width=1.5
            End
        End
        Object Recordset
            Items Field
                Item
                    Name='条码编号'
                End
                Item
                    Name='进料日期'
                    Type=DateTime
                    Format='yyyy//MM//dd'
                End
                Item
                    Name='批号'
                End
                Item
                    Name='物料代码'
                End
                Item
                    Name='物料名称'
                End
                Item
                    Name='规格型号'
                End
                Item
                    Name='数量'
                    Type=Currency
                End
                Item
                    Name='供应商代码'
                End
                Item
                    Name='供应商'
                End
                Item
                    Name='车间'
                End
            End
        End
        Items Column
            Item
                Name='Column1'
                Width=7.9375
            End
        End
        Object ColumnContent
            Height=5.79438
            Items ColumnContentCell
                Item
                    Column='Column1'
                    FreeCell=T
                    Items Control
                        Item
                            Type=Barcode
                            Name='Barcode4'
                            Left=4.89479
                            Top=0.370417
                            Width=2.59292
                            Height=2.40771
                            BarcodeType=QRCode
                            CheckSum=T
                            Text='[#条码编号#]'
                            Object Font
                                Name='黑体'
                                Size=67500,0
                                Weight=400
                                Charset=134
                            End
                        End
                        Item
                            Type=Line
                            Name='Line32'
                            Left=0.15875
                            Top=1.08479
                            Width=4.58
                        End
                        Item
                            Type=Line
                            Name='Line33'
                            Left=0.15875
                            Top=0.185208
                            Height=5.45
                            U2D=F
                        End
                        Item
                            Type=MemoBox
                            Name='MemoBox18'
                            Left=1.69333
                            Top=2.06375
                            Width=2.98979
                            Height=0.79375
                            Object Font
                                Name='黑体'
                                Size=105000,0
                                Bold=T
                                Charset=134
                            End
                            ShrinkFontToFit=T
                            WordWrap=T
                            Text='[#物料代码#]'
                        End
                        Item
                            Type=StaticBox
                            Name='StaticBox20'
                            Left=0.185208
                            Top=0.47625
                            Width=1.32292
                            Height=0.396875
                            Object Font
                                Name='黑体'
                                Size=105000,0
                                Weight=400
                                Charset=134
                            End
                            WordWrap=T
                            TextAlign=MiddleCenter
                            Text='日期'
                        End
                        Item
                            Type=Line
                            Name='Line34'
                            Left=0.15875
                            Top=2.88396
                            Width=7.51417
                        End
                        Item
                            Type=Line
                            Name='Line35'
                            Left=0.15875
                            Top=0.185208
                            Width=7.51417
                        End
                        Item
                            Type=Line
                            Name='Line36'
                            Left=0.15875
                            Top=1.98438
                            Width=4.57729
                        End
                        Item
                            Type=StaticBox
                            Name='StaticBox21'
                            Left=0.185208
                            Top=2.27542
                            Width=1.32292
                            Height=0.396875
                            Object Font
                                Name='黑体'
                                Size=105000,0
                                Weight=400
                                Charset=134
                            End
                            WordWrap=T
                            TextAlign=MiddleCenter
                            Text='代码'
                        End
                        Item
                            Type=MemoBox
                            Name='MemoBox20'
                            Left=1.69333
                            Top=0.264583
                            Width=2.98979
                            Height=0.79375
                            Object Font
                                Name='黑体'
                                Size=105000,0
                                Bold=T
                                Charset=134
                            End
                            ShrinkFontToFit=T
                            WordWrap=T
                            Text='[#进料日期#]'
                        End
                        Item
                            Type=Line
                            Name='Line41'
                            Left=1.50813
                            Top=0.185208
                            Height=5.45
                            U2D=F
                        End
                        Item
                            Type=Line
                            Name='Line42'
                            Left=7.67292
                            Top=0.185208
                            Height=5.45
                            U2D=F
                        End
                        Item
                            Type=Line
                            Name='Line43'
                            Left=0.15875
                            Top=3.81
                            Width=7.51417
                        End
                        Item
                            Type=Line
                            Name='Line44'
                            Left=0.15875
                            Top=4.70958
                            Width=7.51417
                        End
                        Item
                            Type=Line
                            Name='Line45'
                            Left=0.15875
                            Top=5.60917
                            Width=7.51417
                        End
                        Item
                            Type=MemoBox
                            Name='MemoBox21'
                            Left=1.69333
                            Top=4.78896
                            Width=5.82083
                            Height=0.79375
                            Object Font
                                Name='黑体'
                                Size=105000,0
                                Bold=T
                                Charset=134
                            End
                            ShrinkFontToFit=T
                            WordWrap=T
                            Text='[#供应商代码#][#供应商#]'
                        End
                        Item
                            Type=StaticBox
                            Name='StaticBox22'
                            Left=0.185208
                            Top=5.00063
                            Width=1.32292
                            Height=0.396875
                            Object Font
                                Name='黑体'
                                Size=105000,0
                                Weight=400
                                Charset=134
                            End
                            WordWrap=T
                            TextAlign=MiddleCenter
                            Text='供应商'
                        End
                        Item
                            Type=MemoBox
                            Name='MemoBox22'
                            Left=1.69333
                            Top=3.86292
                            Width=5.82083
                            Height=0.79375
                            Object Font
                                Name='黑体'
                                Size=105000,0
                                Bold=T
                                Charset=134
                            End
                            ShrinkFontToFit=T
                            WordWrap=T
                            Text='[#物料名称#]'
                        End
                        Item
                            Type=StaticBox
                            Name='StaticBox23'
                            Left=0.185208
                            Top=4.07458
                            Width=1.32292
                            Height=0.396875
                            Object Font
                                Name='黑体'
                                Size=105000,0
                                Weight=400
                                Charset=134
                            End
                            WordWrap=T
                            TextAlign=MiddleCenter
                            Text='名称'
                        End
                        Item
                            Type=MemoBox
                            Name='MemoBox23'
                            Left=1.69333
                            Top=2.96333
                            Width=2.98979
                            Height=0.79375
                            Object Font
                                Name='黑体'
                                Size=105000,0
                                Bold=T
                                Charset=134
                            End
                            ShrinkFontToFit=T
                            WordWrap=T
                            Text='[#规格型号#]'
                        End
                        Item
                            Type=StaticBox
                            Name='StaticBox24'
                            Left=0.185208
                            Top=3.175
                            Width=1.32292
                            Height=0.396875
                            Object Font
                                Name='黑体'
                                Size=105000,0
                                Weight=400
                                Charset=134
                            End
                            WordWrap=T
                            TextAlign=MiddleCenter
                            Text='规格'
                        End
                        Item
                            Type=MemoBox
                            Name='MemoBox24'
                            Left=1.69333
                            Top=1.16417
                            Width=2.98979
                            Height=0.79375
                            Object Font
                                Name='黑体'
                                Size=105000,0
                                Bold=T
                                Charset=134
                            End
                            ShrinkFontToFit=T
                            WordWrap=T
                            Text='[#批号#]'
                        End
                        Item
                            Type=StaticBox
                            Name='StaticBox25'
                            Left=0.185208
                            Top=1.37583
                            Width=1.32292
                            Height=0.396875
                            Object Font
                                Name='黑体'
                                Size=105000,0
                                Weight=400
                                Charset=134
                            End
                            WordWrap=T
                            TextAlign=MiddleCenter
                            Text='批号'
                        End
                        Item
                            Type=StaticBox
                            Name='StaticBox26'
                            Left=4.70958
                            Top=3.175
                            Width=1.00542
                            Height=0.396875
                            Object Font
                                Name='黑体'
                                Size=105000,0
                                Weight=400
                                Charset=134
                            End
                            WordWrap=T
                            TextAlign=MiddleCenter
                            Text='数量'
                        End
                        Item
                            Type=MemoBox
                            Name='MemoBox25'
                            Left=5.79438
                            Top=2.96333
                            Width=1.79917
                            Height=0.820208
                            Object Font
                                Name='黑体'
                                Size=105000,0
                                Bold=T
                                Charset=134
                            End
                            ShrinkFontToFit=T
                            WordWrap=T
                            Text='[#数量#]'
                        End
                        Item
                            Type=Line
                            Name='Line47'
                            Left=5.715
                            Top=2.88396
                            Height=0.95
                            U2D=F
                        End
                        Item
                            Type=Line
                            Name='Line46'
                            Left=4.70958
                            Top=0.185208
                            Height=3.65
                            U2D=F
                        End
                    End
                End
            End
        End
        Object ColumnTitle
            Height=0
            Items ColumnTitleCell
                Item
                    GroupTitle=F
                    Column='Column1'
                    TextAlign=MiddleCenter
                    Text='Column1'
                End
            End
        End
    End
    Items ReportHeader
        Item
            Name='ReportHeader1'
            Height=0
            RepeatOnPage=T
        End
    End
    Items ReportFooter
        Item
            Name='ReportFooter1'
            Height=0
        End
    End
End
Êä³ö-Éú³É.txt
New file
@@ -0,0 +1,23 @@
1>------ å·²å¯åŠ¨ç”Ÿæˆ:  é¡¹ç›®: WebAPI, é…ç½®: Release Any CPU ------
1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3277: å‘现同一依赖程序集的不同版本间存在无法解决的冲突。 å½“日志详细信息设置为“详细”时,这些引用冲突将会在生成日志中列出。
1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3270: æ‰€ç”Ÿæˆé¡¹ç›®çš„处理器架构“MSIL”与引用“BLL, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86”的处理器架构“x86”不匹配。这种不匹配可能会导致运行时失败。请考虑通过配置管理器更改您的项目的目标处理器架构,以使您的项目与引用间的处理器架构保持一致,或者为引用关联一个与您的项目的目标处理器架构相符的处理器架构。
1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3270: æ‰€ç”Ÿæˆé¡¹ç›®çš„处理器架构“MSIL”与引用“DBUtility, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86”的处理器架构“x86”不匹配。这种不匹配可能会导致运行时失败。请考虑通过配置管理器更改您的项目的目标处理器架构,以使您的项目与引用间的处理器架构保持一致,或者为引用关联一个与您的项目的目标处理器架构相符的处理器架构。
1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3270: æ‰€ç”Ÿæˆé¡¹ç›®çš„处理器架构“MSIL”与引用“Pub_Class, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86”的处理器架构“x86”不匹配。这种不匹配可能会导致运行时失败。请考虑通过配置管理器更改您的项目的目标处理器架构,以使您的项目与引用间的处理器架构保持一致,或者为引用关联一个与您的项目的目标处理器架构相符的处理器架构。
1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3270: æ‰€ç”Ÿæˆé¡¹ç›®çš„处理器架构“MSIL”与引用“Pub_Control, Version=1.0.6632.19241, Culture=neutral, processorArchitecture=x86”的处理器架构“x86”不匹配。这种不匹配可能会导致运行时失败。请考虑通过配置管理器更改您的项目的目标处理器架构,以使您的项目与引用间的处理器架构保持一致,或者为引用关联一个与您的项目的目标处理器架构相符的处理器架构。
1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3270: æ‰€ç”Ÿæˆé¡¹ç›®çš„处理器架构“MSIL”与引用“SQLHelper, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86”的处理器架构“x86”不匹配。这种不匹配可能会导致运行时失败。请考虑通过配置管理器更改您的项目的目标处理器架构,以使您的项目与引用间的处理器架构保持一致,或者为引用关联一个与您的项目的目标处理器架构相符的处理器架构。
1>  WebAPI -> C:\Users\lenovo\documents\visual studio 2013\Projects\WebAPI\WebAPI\bin\WebAPI.dll
2>------ å‘布已启动:  é¡¹ç›®: WebAPI, é…ç½®: Release Any CPU ------
2>正在连接到 D:\网站发布\WebSite...
2>已使用 C:\Users\lenovo\documents\visual studio 2013\Projects\WebAPI\WebAPI\Web.Release.config å°† Web.config è½¬æ¢ä¸º obj\Release\TransformWebConfig\transformed\Web.config。
2>正在将所有文件都复制到以下临时位置以进行打包/发布:
2>obj\Release\Package\PackageTmp。
2>正在发布文件夹 /...
2>正在发布文件夹 bin...
2>正在发布文件夹 bin/zh-Hans...
2>正在发布文件夹 DLL...
2>正在发布文件夹 Metadata...
2>正在发布文件夹 Metadata/deploymentTemplates...
2>Web åº”用已成功发布 file:///D:/%E7%BD%91%E7%AB%99%E5%8F%91%E5%B8%83/WebSite
2>
========== ç”Ÿæˆ:  æˆåŠŸ 1 ä¸ªï¼Œå¤±è´¥ 0 ä¸ªï¼Œæœ€æ–° 0 ä¸ªï¼Œè·³è¿‡ 0 ä¸ª ==========
========== å‘布:  æˆåŠŸ 1 ä¸ªï¼Œå¤±è´¥ 0 ä¸ªï¼Œè·³è¿‡ 0 ä¸ª ==========