修正项目

This commit is contained in:
admin
2021-01-05 11:11:28 +08:00
parent 56d6cc89e9
commit e9b4b307c9
93 changed files with 2524 additions and 156 deletions

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.Model
{
/// <summary>
/// 到货单
/// </summary>
public class Arrival
{
private int id;
private string arrivalCode;
private DateTime _date;
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.Model.Model
{
public class ArrivalDetail
{
public int Autoid;
}
}

30
NX.ERP.Model/Model/Bin.cs Normal file
View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.Model
{
public class Bin
{
private string _BinCode;
private string _BinName;
private string _IsPosGrade;
private bool _bPosEnd;
private string _WarehouseCode;
private int _VolumeLimit;
private int _WeightLimit;
private string _cMemo;
private string _cBarCode;
public string BinCode { get => _BinCode; set => _BinCode = value; }
public string BinName { get => _BinName; set => _BinName = value; }
public string IsPosGrade { get => _IsPosGrade; set => _IsPosGrade = value; }
public bool BPosEnd { get => _bPosEnd; set => _bPosEnd = value; }
public string WarehouseCode { get => _WarehouseCode; set => _WarehouseCode = value; }
public int VolumeLimit { get => _VolumeLimit; set => _VolumeLimit = value; }
public int WeightLimit { get => _WeightLimit; set => _WeightLimit = value; }
public string CMemo { get => _cMemo; set => _cMemo = value; }
public string CBarCode { get => _cBarCode; set => _cBarCode = value; }
}
}

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.Model
{
public class Customer
{
private string customerCode;
private string customerName;
private string postalCode;
private string address;
private string contract;
private string contractPhone;
public string CustomerCode { get => customerCode; set => customerCode = value; }
public string PostalCode { get => postalCode; set => postalCode = value; }
public string Address { get => address; set => address = value; }
public string Contract { get => contract; set => contract = value; }
public string ContractPhone { get => contractPhone; set => contractPhone = value; }
public string CustomerName { get => customerName; set => customerName = value; }
}
}

View File

@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.Model
{
public class Materiel
{
private string materielCode;
private string materielName;
private decimal length;
private decimal wide;
private decimal height;
private int volume;
private int weight;
private int unitPrice;
private string unitCode;
private string specsModel;
private int maxStock;
private int minStock;
private int aql;
public string MaterielCode { get => materielCode; set => materielCode = value; }
public string MaterielName { get => materielName; set => materielName = value; }
public decimal Length { get => length; set => length = value; }
public decimal Wide { get => wide; set => wide = value; }
public decimal Height { get => height; set => height = value; }
public int Volume { get => volume; set => volume = value; }
public int Weight { get => weight; set => weight = value; }
public int UnitPrice { get => unitPrice; set => unitPrice = value; }
public string UnitCode { get => unitCode; set => unitCode = value; }
public string SpecsModel { get => specsModel; set => specsModel = value; }
public int MaxStock { get => maxStock; set => maxStock = value; }
public int MinStock { get => minStock; set => minStock = value; }
public int Aql { get => aql; set => aql = value; }
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.Model
{
public class MaterielType
{
private string materielTypeCode;
private string materielTypeName;
public string MaterielTypeCode { get => materielTypeCode; set => materielTypeCode = value; }
public string MaterielTypeName { get => materielTypeName; set => materielTypeName = value; }
}
}

View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.Model
{
public class Supplier
{
private string supplierCode;
private string supplierName;
private string postalCode;
private string address;
private string contract;
public string SupplierCode { get => supplierCode; set => supplierCode = value; }
public string SupplierName { get => supplierName; set => supplierName = value; }
public string PostalCode { get => postalCode; set => postalCode = value; }
public string Address { get => address; set => address = value; }
public string Contract { get => contract; set => contract = value; }
}
}

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.Model
{
public class Unit
{
private string unitCode;
private string unitName;
private bool mainUnit;
private string groupCode;
public string UnitCode { get => unitCode; set => unitCode = value; }
public string UnitName { get => unitName; set => unitName = value; }
public bool MainUnit { get => mainUnit; set => mainUnit = value; }
public string GroupCode { get => groupCode; set => groupCode = value; }
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.Model
{
public class Warehouse
{
private string _WarehouseCode;
private string _WarehouseName;
public string WarehouseCode { get => _WarehouseCode; set => _WarehouseCode = value; }
public string WarehouseName { get => _WarehouseName; set => _WarehouseName = value; }
}
}

View File

@@ -0,0 +1,72 @@
<?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>{5D012E0A-AFED-474E-81A9-5820890B1B29}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NX.ERP.Model</RootNamespace>
<AssemblyName>NX.ERP.Model</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<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' ">
<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>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Model\Arrival.cs" />
<Compile Include="Model\ArrivalDetail.cs" />
<Compile Include="Model\Bin.cs" />
<Compile Include="Model\Customer.cs" />
<Compile Include="Model\Materiel.cs" />
<Compile Include="Model\MaterielType.cs" />
<Compile Include="Model\Supplier.cs" />
<Compile Include="Model\Unit.cs" />
<Compile Include="Model\Warehouse.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("NX.ERP.Model")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NX.ERP.Model")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("5d012e0a-afed-474e-81a9-5820890b1b29")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

18
NX.ERP.U8.App/App.config Normal file
View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
</startup>
<appSettings>
<!--修改账套请修改这里的配置-->
<add key="url" value="http://192.168.0.242/U8EAI/import.asp"/>
<add key="connStr" value="Server=192.168.0.242 ;DataBase=UFDATA_003_2019;Uid=sa;Pwd=!@#qwe123;"/>
<add key="ClientSettingsProvider.ServiceUri" value=""/>
</appSettings>
<runtime>
</runtime>
<system.web>
</system.web>
</configuration>

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization; using System.Xml.Serialization;
namespace U8AppMain.Bom namespace U8AppMain.Bom

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization; using System.Xml.Serialization;
namespace U8AppMain.Bom namespace U8AppMain.Bom

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace U8AppMain.Bom namespace U8AppMain.Bom
{ {

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace U8AppMain.Bom namespace U8AppMain.Bom
{ {

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace U8AppMain.Bom namespace U8AppMain.Bom
{ {

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace U8AppMain.Bom namespace U8AppMain.Bom
{ {

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace U8AppMain.Bom namespace U8AppMain.Bom
{ {

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
using System.Xml; using System.Xml;
namespace U8AppMain.Bom namespace U8AppMain.Bom
{ {

View File

@@ -1,11 +1,12 @@
using NPOI.SS.UserModel; 
using NPOI.SS.UserModel;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace U8AppMain namespace U8AppMain
{ {

View File

@@ -36,17 +36,18 @@ namespace U8AppMain
this.ImportBom = new System.Windows.Forms.ToolStripMenuItem(); this.ImportBom = new System.Windows.Forms.ToolStripMenuItem();
this.BtnPurchaseImport = new System.Windows.Forms.ToolStripMenuItem(); this.BtnPurchaseImport = new System.Windows.Forms.ToolStripMenuItem();
this.领料单ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.领料单ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.打印ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.打印ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.dataGridView1 = new System.Windows.Forms.DataGridView(); this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.richTextBox1 = new System.Windows.Forms.RichTextBox(); this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.打印ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.登录ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.打印ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout(); this.splitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// menuStrip1 // menuStrip1
@@ -66,7 +67,8 @@ namespace U8AppMain
// 操作ToolStripMenuItem // 操作ToolStripMenuItem
// //
this.操作ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.操作ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.BtnReadExcel}); this.BtnReadExcel,
this.登录ToolStripMenuItem});
this.操作ToolStripMenuItem.Name = "操作ToolStripMenuItem"; this.操作ToolStripMenuItem.Name = "操作ToolStripMenuItem";
this.操作ToolStripMenuItem.Size = new System.Drawing.Size(45, 19); this.操作ToolStripMenuItem.Size = new System.Drawing.Size(45, 19);
this.操作ToolStripMenuItem.Text = "文件"; this.操作ToolStripMenuItem.Text = "文件";
@@ -91,24 +93,39 @@ namespace U8AppMain
// ImportBom // ImportBom
// //
this.ImportBom.Name = "ImportBom"; this.ImportBom.Name = "ImportBom";
this.ImportBom.Size = new System.Drawing.Size(180, 22); this.ImportBom.Size = new System.Drawing.Size(113, 22);
this.ImportBom.Text = "BOM"; this.ImportBom.Text = "BOM";
this.ImportBom.Click += new System.EventHandler(this.ImportBom_Click); this.ImportBom.Click += new System.EventHandler(this.ImportBom_Click);
// //
// BtnPurchaseImport // BtnPurchaseImport
// //
this.BtnPurchaseImport.Name = "BtnPurchaseImport"; this.BtnPurchaseImport.Name = "BtnPurchaseImport";
this.BtnPurchaseImport.Size = new System.Drawing.Size(180, 22); this.BtnPurchaseImport.Size = new System.Drawing.Size(113, 22);
this.BtnPurchaseImport.Text = "请购单"; this.BtnPurchaseImport.Text = "请购单";
this.BtnPurchaseImport.Click += new System.EventHandler(this.BtnPurchaseImport_Click); this.BtnPurchaseImport.Click += new System.EventHandler(this.BtnPurchaseImport_Click);
// //
// 领料单ToolStripMenuItem // 领料单ToolStripMenuItem
// //
this.领料单ToolStripMenuItem.Name = "领料单ToolStripMenuItem"; this.领料单ToolStripMenuItem.Name = "领料单ToolStripMenuItem";
this.领料单ToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.领料单ToolStripMenuItem.Size = new System.Drawing.Size(113, 22);
this.领料单ToolStripMenuItem.Text = "领料单"; this.领料单ToolStripMenuItem.Text = "领料单";
this.领料单ToolStripMenuItem.Click += new System.EventHandler(this.领料单ToolStripMenuItem_Click); this.领料单ToolStripMenuItem.Click += new System.EventHandler(this.领料单ToolStripMenuItem_Click);
// //
// 打印ToolStripMenuItem
//
this.打印ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.打印ToolStripMenuItem1});
this.打印ToolStripMenuItem.Name = "打印ToolStripMenuItem";
this.打印ToolStripMenuItem.Size = new System.Drawing.Size(45, 19);
this.打印ToolStripMenuItem.Text = "打印";
//
// 打印ToolStripMenuItem1
//
this.打印ToolStripMenuItem1.Name = "打印ToolStripMenuItem1";
this.打印ToolStripMenuItem1.Size = new System.Drawing.Size(100, 22);
this.打印ToolStripMenuItem1.Text = "打印";
this.打印ToolStripMenuItem1.Click += new System.EventHandler(this.打印ToolStripMenuItem1_Click);
//
// splitContainer1 // splitContainer1
// //
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -161,20 +178,12 @@ namespace U8AppMain
this.richTextBox1.Text = ""; this.richTextBox1.Text = "";
this.richTextBox1.TextChanged += new System.EventHandler(this.richTextBox1_TextChanged); this.richTextBox1.TextChanged += new System.EventHandler(this.richTextBox1_TextChanged);
// //
// 打印ToolStripMenuItem // 登录ToolStripMenuItem
// //
this.打印ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.登录ToolStripMenuItem.Name = "登录ToolStripMenuItem";
this.打印ToolStripMenuItem1}); this.登录ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.打印ToolStripMenuItem.Name = "打印ToolStripMenuItem"; this.登录ToolStripMenuItem.Text = "登录";
this.打印ToolStripMenuItem.Size = new System.Drawing.Size(45, 19); this.登录ToolStripMenuItem.Click += new System.EventHandler(this.登录ToolStripMenuItem_Click);
this.打印ToolStripMenuItem.Text = "打印";
//
// 打印ToolStripMenuItem1
//
this.打印ToolStripMenuItem1.Name = "打印ToolStripMenuItem1";
this.打印ToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
this.打印ToolStripMenuItem1.Text = "打印";
this.打印ToolStripMenuItem1.Click += new System.EventHandler(this.打印ToolStripMenuItem1_Click);
// //
// FrmMain // FrmMain
// //
@@ -192,9 +201,9 @@ namespace U8AppMain
this.menuStrip1.PerformLayout(); this.menuStrip1.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false); this.splitContainer1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@@ -213,6 +222,7 @@ namespace U8AppMain
private System.Windows.Forms.ToolStripMenuItem 领料单ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 领料单ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 打印ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 打印ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 打印ToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem 打印ToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem 登录ToolStripMenuItem;
} }
} }

View File

@@ -4,9 +4,7 @@ using System.ComponentModel;
using System.Data; using System.Data;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using System.Xml.Serialization; using System.Xml.Serialization;
using System.IO; using System.IO;
@@ -21,6 +19,7 @@ namespace U8AppMain
InitializeComponent(); InitializeComponent();
} }
private NX.ERP.U8.U8LoginContext u8LoginContext = null;
private void PrintLog(ResultEnity.ufinterface info) private void PrintLog(ResultEnity.ufinterface info)
{ {
@@ -48,12 +47,12 @@ namespace U8AppMain
} }
private async Task<ResultEnity.ufinterface> HttpPost(string body) private ResultEnity.ufinterface HttpPost(string body)
{ {
try try
{ {
var response = await HttpHelper.Post(url, body); var response = HttpHelper.HttpPost(url, body);
return XmlHelper.XmlDeserialize<ResultEnity.ufinterface>(response, Encoding.UTF8); return XmlHelper.XmlDeserialize<ResultEnity.ufinterface>(response, Encoding.UTF8);
// var strResult = $"单据:{result.requestroottag} 操作:{result.proc} \r\n"; // var strResult = $"单据:{result.requestroottag} 操作:{result.proc} \r\n";
//foreach (var item in result.Items) //foreach (var item in result.Items)
@@ -99,7 +98,7 @@ namespace U8AppMain
return; return;
} }
private async void ImportBom_Click(object sender, EventArgs e) private void ImportBom_Click(object sender, EventArgs e)
{ {
if (this.dataTable == null || this.dataTable.Rows.Count == 0) if (this.dataTable == null || this.dataTable.Rows.Count == 0)
@@ -154,14 +153,14 @@ namespace U8AppMain
{ {
var strbody = XmlHelper.XmlSerialize(item, Encoding.UTF8); var strbody = XmlHelper.XmlSerialize(item, Encoding.UTF8);
var response = await this.HttpPost(strbody); var response = this.HttpPost(strbody);
PrintLog(response); PrintLog(response);
Application.DoEvents(); Application.DoEvents();
} }
} }
private async void BtnPurchaseImport_Click(object sender, EventArgs e) private void BtnPurchaseImport_Click(object sender, EventArgs e)
{ {
if (this.dataTable == null || this.dataTable.Rows.Count == 0) if (this.dataTable == null || this.dataTable.Rows.Count == 0)
{ {
@@ -207,7 +206,7 @@ namespace U8AppMain
foreach (var item in bomLookup.Values) foreach (var item in bomLookup.Values)
{ {
var strbody = XmlHelper.XmlSerialize(item, Encoding.UTF8); var strbody = XmlHelper.XmlSerialize(item, Encoding.UTF8);
var response = await this.HttpPost(strbody); var response = this.HttpPost(strbody);
PrintLog(response); PrintLog(response);
Application.DoEvents(); Application.DoEvents();
} }
@@ -259,7 +258,7 @@ namespace U8AppMain
} }
foreach (var item in bomLookup.Values) foreach (var item in bomLookup.Values)
{ {
var a = new Voucher.VoucherDAL(connStr); var a = new Voucher.VoucherDAL(this.u8LoginContext.Constr4Net);
if (a.Add(item)) if (a.Add(item))
{ {
this.richTextBox1.SelectionColor = Color.Green; this.richTextBox1.SelectionColor = Color.Green;
@@ -283,11 +282,13 @@ namespace U8AppMain
private void 打印ToolStripMenuItem1_Click(object sender, EventArgs e) private void 打印ToolStripMenuItem1_Click(object sender, EventArgs e)
{ {
FastReport.Report report = new FastReport.Report();
if (report.Design()) }
{
report.Design(); private void 登录ToolStripMenuItem_Click(object sender, EventArgs e)
} {
u8LoginContext = new NX.ERP.U8.U8LoginContext();
u8LoginContext.Login(true);
} }
} }
} }

View File

@@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
namespace U8AppMain
{
public static class HttpHelper
{
/// <summary>
/// HTTP POST方式请求数据
/// </summary>
/// <param name="url">URL.</param>
/// <param name="param">POST的数据</param>
/// <returns></returns>
public static string HttpPost(string url, string param = null)
{
var request = WebRequest.Create(url) as HttpWebRequest;
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.Accept = "*/*";
request.Timeout = 15000;
request.AllowAutoRedirect = false;
StreamWriter requestStream = null;
WebResponse response = null;
string responseStr = null;
try
{
requestStream = new StreamWriter(request.GetRequestStream());
requestStream.Write(param);
requestStream.Close();
response = request.GetResponse();
if (response != null)
{
StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
responseStr = reader.ReadToEnd();
reader.Close();
}
}
catch (Exception)
{
throw;
}
finally
{
request = null;
requestStream = null;
response = null;
}
return responseStr;
}
}
}

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
namespace U8AppMain namespace U8AppMain

View File

@@ -6,9 +6,9 @@
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{8A6603B0-444A-49C7-80C9-195638129068}</ProjectGuid> <ProjectGuid>{8A6603B0-444A-49C7-80C9-195638129068}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<RootNamespace>U8AppMain</RootNamespace> <RootNamespace>NX.ERP.U8.App</RootNamespace>
<AssemblyName>U8AppMain</AssemblyName> <AssemblyName>NX.ERP.U8.App</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
@@ -16,7 +16,7 @@
</NuGetPackageImportStamp> </NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
@@ -36,46 +36,40 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Accessibility" /> <Reference Include="Accessibility" />
<Reference Include="BouncyCastle.Crypto, Version=1.8.6.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL"> <Reference Include="Dapper, Version=1.40.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.8.6\lib\net40\BouncyCastle.Crypto.dll</HintPath> <HintPath>..\packages\Dapper.1.42\lib\net35\Dapper.dll</HintPath>
</Reference> </Reference>
<Reference Include="Dapper, Version=1.50.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
<HintPath>..\packages\Dapper.1.50.0\lib\net45\Dapper.dll</HintPath> <HintPath>..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="FastReport, Version=2021.1.2.0, Culture=neutral, PublicKeyToken=5ceb240df42bf6e8, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>fastreport\FastReport.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib, Version=1.2.0.246, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
<HintPath>..\packages\SharpZipLib.1.2.0\lib\net45\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference> </Reference>
<Reference Include="NPOI, Version=2.2.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL"> <Reference Include="NPOI, Version=2.2.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<HintPath>..\packages\NPOI.2.2.1\lib\net40\NPOI.dll</HintPath> <HintPath>..\packages\NPOI.2.2.1\lib\net20\NPOI.dll</HintPath>
</Reference> </Reference>
<Reference Include="NPOI.OOXML, Version=2.2.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL"> <Reference Include="NPOI.OOXML, Version=2.2.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<HintPath>..\packages\NPOI.2.2.1\lib\net40\NPOI.OOXML.dll</HintPath> <HintPath>..\packages\NPOI.2.2.1\lib\net20\NPOI.OOXML.dll</HintPath>
</Reference> </Reference>
<Reference Include="NPOI.OpenXml4Net, Version=2.2.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL"> <Reference Include="NPOI.OpenXml4Net, Version=2.2.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<HintPath>..\packages\NPOI.2.2.1\lib\net40\NPOI.OpenXml4Net.dll</HintPath> <HintPath>..\packages\NPOI.2.2.1\lib\net20\NPOI.OpenXml4Net.dll</HintPath>
</Reference> </Reference>
<Reference Include="NPOI.OpenXmlFormats, Version=2.2.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL"> <Reference Include="NPOI.OpenXmlFormats, Version=2.2.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<HintPath>..\packages\NPOI.2.2.1\lib\net40\NPOI.OpenXmlFormats.dll</HintPath> <HintPath>..\packages\NPOI.2.2.1\lib\net20\NPOI.OpenXmlFormats.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.configuration" /> <Reference Include="System.configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Security" /> <Reference Include="System.Security" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Web.Extensions" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Deployment" /> <Reference Include="System.Deployment" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" /> <Reference Include="System.XML" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Bom\Bom.cs" /> <Compile Include="Bom\Bom.cs" />
@@ -136,12 +130,18 @@
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NX.ERP.Model\NX.ERP.Model.csproj">
<Project>{5d012e0a-afed-474e-81a9-5820890b1b29}</Project>
<Name>NX.ERP.Model</Name>
</ProjectReference>
<ProjectReference Include="..\NX.ERP.U8\NX.ERP.U8.csproj">
<Project>{bd673da9-0606-4bcf-a016-fb5c4e7b5d59}</Project>
<Name>NX.ERP.U8</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\FastReport.Compat.2020.4.2\build\FastReport.Compat.targets" Condition="Exists('..\packages\FastReport.Compat.2020.4.2\build\FastReport.Compat.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\FastReport.Compat.2020.4.2\build\FastReport.Compat.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\FastReport.Compat.2020.4.2\build\FastReport.Compat.targets'))" />
</Target>
</Project> </Project>

View File

@@ -1,7 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
namespace U8AppMain namespace U8AppMain

View File

@@ -8,7 +8,7 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace U8AppMain.Properties { namespace NX.ERP.U8.App.Properties {
using System; using System;
@@ -39,7 +39,7 @@ namespace U8AppMain.Properties {
internal static global::System.Resources.ResourceManager ResourceManager { internal static global::System.Resources.ResourceManager ResourceManager {
get { get {
if (object.ReferenceEquals(resourceMan, null)) { if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("U8AppMain.Properties.Resources", typeof(Resources).Assembly); global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NX.ERP.U8.App.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp; resourceMan = temp;
} }
return resourceMan; return resourceMan;

View File

@@ -8,7 +8,7 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace U8AppMain.Properties { namespace NX.ERP.U8.App.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace U8AppMain.Purchase namespace U8AppMain.Purchase
{ {

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace U8AppMain.Purchase namespace U8AppMain.Purchase
{ {

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace U8AppMain.Purchase namespace U8AppMain.Purchase
{ {

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace U8AppMain.Purchase namespace U8AppMain.Purchase
{ {

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace U8AppMain.Purchase namespace U8AppMain.Purchase
{ {

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization; using System.Xml.Serialization;
namespace U8AppMain.ResultEnity namespace U8AppMain.ResultEnity
{ {

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization; using System.Xml.Serialization;
namespace U8AppMain.ResultEnity namespace U8AppMain.ResultEnity
{ {

View File

@@ -0,0 +1,97 @@
using System;
using U8Login;
namespace U8ApiInterface
{
public class U8LoginContext : IDisposable
{
private static U8LoginContext _u8LoginContext;
public static U8LoginContext Instance
{
get
{
if (_u8LoginContext == null)
{
_u8LoginContext = new U8LoginContext();
}
return _u8LoginContext;
}
}
private UFSoft.U8.Framework.Login.UI.clsLogin clsLogin;
private clsLogin _clslogin;
private U8LoginContext()
{
clsLogin = new UFSoft.U8.Framework.Login.UI.clsLogin();
}
public clsLogin ClsLogin
{
get
{
if (this._clslogin == null)
{
this.Login();
}
return this._clslogin;
}
}
public void Dispose()
{
if (clsLogin != null)
{
clsLogin.SubLogout(AccID);
clsLogin.ShutDown();
clsLogin = null;
}
}
public string UserId { get; set; } = "003";
public string PassWord { get; set; } = "123456";
public string Server { get; set; } = "192.168.0.242";
public string AccID { get; set; } = "u8@889";
public string Serial { get; set; }
public void Login()
{
var a = clsLogin.GetDataSource("192.168.0.250");
if (!clsLogin.login("DP", "wx998", "nx123456", "192.168.0.250","2020-12-31", AccID, Serial))
{
throw new Exception(clsLogin.ErrDescript);
}
if (clsLogin.SubLogin("ST") == null)
{
throw new Exception(clsLogin.ErrDescript);
}
this._clslogin = new clsLoginClass();
if (!_clslogin.ConstructLogin(clsLogin.userToken))
{
throw new Exception(_clslogin.ShareString);
}
_clslogin.set_TaskId(clsLogin.GetTaskID("ST"));
//U8EnvContext u8EnvContext = new U8EnvContext
//{
// U8Login = this._clslogin
//};
//return true;
}
}
}

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace U8AppMain.Voucher namespace U8AppMain.Voucher
{ {

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
using Dapper; using Dapper;
using System.Data.SqlClient; using System.Data.SqlClient;
namespace U8AppMain.Voucher namespace U8AppMain.Voucher
@@ -53,23 +53,23 @@ namespace U8AppMain.Voucher
iAmount = vouch.Vouchs.Count() iAmount = vouch.Vouchs.Count()
}; };
DynamicParameters sp = new DynamicParameters(idEnity); DynamicParameters sp = new DynamicParameters(idEnity);
sp.Add("@iFatherId", 0, System.Data.DbType.Int32, System.Data.ParameterDirection.Output); sp.Add("@iFatherId", 0, System.Data.DbType.Int32, System.Data.ParameterDirection.Output,0);
sp.Add("@iChildId", 0, System.Data.DbType.Int32, System.Data.ParameterDirection.Output); sp.Add("@iChildId", 0, System.Data.DbType.Int32, System.Data.ParameterDirection.Output,0);
conn.Execute("sp_GetID", sp, trans, commandType: System.Data.CommandType.StoredProcedure); conn.Execute("sp_GetID", sp, trans, commandType: System.Data.CommandType.StoredProcedure);
int iFatherId = sp.Get<int>("@iFatherId"); int iFatherId = sp.Get<int>("@iFatherId");
int iChildId = sp.Get<int>("@iChildId"); int iChildId = sp.Get<int>("@iChildId");
//获取最大值 //获取最大值
var cSeed = DateTime.Today.ToString("yyyyMM"); var cSeed = DateTime.Today.ToString("yyyyMM");
var sqlMax = $@"select cNumber as Maxnumber From VoucherHistory with (ROWLOCK) Where CardNumber='0413' and cContent='日期' and cSeed=@cSeed"; var sqlMax = $@"select cNumber as Maxnumber From VoucherHistory with (ROWLOCK) Where CardNumber='0413' and cContent='日期' and cSeed=@cSeed";
var maxCode = conn.ExecuteScalar<int>(sqlMax, new { cSeed }, trans); var maxCode = conn.ExecuteScalar<int>(sqlMax, new { cSeed }, trans,200,System.Data.CommandType.Text);
maxCode++; maxCode++;
//更新最大之 //更新最大之
var sqlUpdate = "update VoucherHistory set cNumber=@cNumber Where CardNumber='0413' and cContent='日期' and cSeed=cSeed "; var sqlUpdate = "update VoucherHistory set cNumber=@cNumber Where CardNumber='0413' and cContent='日期' and cSeed=@cSeed ";
conn.Execute(sqlUpdate, new { cNumber = maxCode, cSeed }, trans); conn.Execute(sqlUpdate, new { cNumber = maxCode, cSeed }, trans);
//获取前缀 //获取前缀
var sqlPrefix = " Select Prefix1Rule From VoucherNumber Where CardNumber = '0413'"; var sqlPrefix = " Select Prefix1Rule From VoucherNumber Where CardNumber = '0413'";
var prefix = conn.ExecuteScalar<string>(sqlPrefix, null, trans); var prefix = conn.ExecuteScalar<string>(sqlPrefix, null, trans,200,System.Data.CommandType.Text);
//组装Code //组装Code
var cCode = prefix + cSeed.Substring(2, cSeed.Length - 2) + maxCode.ToString().PadLeft(5, '0'); var cCode = prefix + cSeed.Substring(2, cSeed.Length - 2) + maxCode.ToString().PadLeft(5, '0');
//主表 //主表

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace U8AppMain.Voucher namespace U8AppMain.Voucher
{ {

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace U8AppMain namespace U8AppMain
{ {

View File

@@ -23,7 +23,7 @@ namespace U8AppMain
settings.NewLineChars = "\r\n"; settings.NewLineChars = "\r\n";
settings.Encoding = encoding; settings.Encoding = encoding;
settings.IndentChars = " "; settings.IndentChars = " ";
settings.NamespaceHandling = NamespaceHandling.OmitDuplicates; //settings.NamespaceHandling = NamespaceHandling.OmitDuplicates;
using (XmlWriter writer = XmlWriter.Create(stream, settings)) using (XmlWriter writer = XmlWriter.Create(stream, settings))
{ {
serializer.Serialize(writer, o, ns); serializer.Serialize(writer, o, ns);

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Dapper" version="1.42" targetFramework="net35" />
<package id="NPOI" version="2.2.1" targetFramework="net35" />
<package id="SharpZipLib" version="0.86.0" targetFramework="net35" />
</packages>

23
NX.ERP.U8/Base/BinDAL.cs Normal file
View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dapper;
using NX.ERP.Model;
namespace NX.ERP.U8.Base
{
public class BinDAL
{
public IEnumerable<Bin> GetList()
{
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
{
var sql = @"select cPosCode as BinCode,cPosName as BinName,iPosGrade,bPosEnd,cWhCode as WarehouseCode,
iMaxCubage as VolumeLimit, iMaxweight as WeightLimit,cMemo,cBarCode from Position";
return conn.Query<Bin>(sql, null);
}
}
}
}

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dapper;
using NX.ERP.Model;
namespace NX.ERP.U8
{
public class CustomerDAL
{
public IEnumerable<Customer> GetList()
{
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
{
var sql = @" select
cCusCode AS CustomerCode,
cCusName AS CustomerName,
cCusPostCode AS PostalCode,
cCusAddress AS Address,
cCusPerson AS Contract,cCusPhone AS ContractPhone from Customer ";
return conn.Query<Customer>(sql, null);
}
}
}
}

View File

@@ -0,0 +1,271 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dapper;
using NX.ERP.Model;
namespace NX.ERP.U8
{
public class MaterielDAL
{
public IEnumerable<Materiel> GetList()
{
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
{
var sql = @"select
cInvCode AS MaterielCode ,
cInvAddCode AS 存货代码,
cInvName AS MaterielName ,
fLength AS Length,
fWidth AS Wide,
fHeight AS Height,
iVolume AS Volume,
iInvWeight AS Weight,
iInvSCost AS UnitPrice,
cComUnitCode AS UnitCode ,
iGroupType AS 计量单位组类别,
cGroupCode AS 计量单位组编码,
cAssComUnitCode AS 辅计量单位编码,
cInvStd AS SpecsModel,
iSafeNum AS 安全库存量,
iTopSum AS MaxStock,
iLowSum AS MinStock,
iMassDate AS 保质期数,
cMassUnit AS 保质期单位,
iWarnDays AS 保质期预警天数,
cInvCCode AS 存货大类编码,
cReplaceItem AS 替换件,
cPosition AS 货位编码,
bSale AS 是否销售,
bPurchase AS 是否外购,
bSelf AS 是否自制,
bComsume AS 是否生产耗用,
bProducing AS 是否在制,
bService AS 是否应税劳务,
bAccessary AS 是否成套件,
iTaxRate AS 税率,
iInvRCost AS 计划价或售价,
iInvSPrice AS 参考成本,
iInvLSCost AS 最低售价,
iInvNCost AS 最新成本,
iInvAdvance AS 提前期,
iInvBatch AS 经济批量,
iOverStock AS 积压标准,
cInvABC AS 存货ABC分类,
bInvQuality AS 是否保质期管理,
bInvBatch AS 是否批次管理,
bInvEntrust AS 是否受托代销,
bInvOverStock AS 是否呆滞积压,
dSDate AS 启用日期,
dEDate AS 停用日期,
bFree1 AS 存货是否有自由项1,
bFree2 AS 存货是否有自由项2,
cInvDefine1 AS 存货自定义项1,
cInvDefine2 AS 存货自定义项2,
cInvDefine3 AS 存货自定义项3,
I_id AS 自动编号,
bInvType AS 是否折扣,
iInvMPCost AS 最高进价,
cQuality AS 质量要求说明,
iInvSaleCost AS 零售单价,
iInvSCost1 AS 一级批发价,
iInvSCost2 AS 二级批发价,
iInvSCost3 AS 三级批发价,
bFree3 AS 存货是否有自由项3,
bFree4 AS 存货是否有自由项4,
bFree5 AS 存货是否有自由项5,
bFree6 AS 存货是否有自由项6,
bFree7 AS 存货是否有自由项7,
bFree8 AS 存货是否有自由项8,
bFree9 AS 存货是否有自由项9,
bFree10 AS 存货是否有自由项10,
cCreatePerson AS 建档人,
cModifyPerson AS 变更人,
dModifyDate AS 变更日期,
fSubscribePoint AS 订货点,
fVagQuantity AS 平均耗用量,
cValueType AS 计价方式,
bFixExch AS 是否为固定换算率,
fOutExcess AS 出库超额上限,
fInExcess AS 入库超额上限,
fExpensesExch AS 费用率,
bTrack AS 是否出库跟踪入库,
bSerial AS 是否有序列号管理,
bBarCode AS 是否条形码管理,
iId AS 所属权限组,
cBarCode AS 对应条形码编码,
cInvDefine4 AS 存货自定义项4,
cInvDefine5 AS 存货自定义项5,
cInvDefine6 AS 存货自定义项6,
cInvDefine7 AS 存货自定义项7,
cInvDefine8 AS 存货自定义项8,
cInvDefine9 AS 存货自定义项9,
cInvDefine10 AS 存货自定义项10,
cInvDefine11 AS 存货自定义项11,
cInvDefine12 AS 存货自定义项12,
cInvDefine13 AS 存货自定义项13,
cInvDefine14 AS 存货自定义项14,
cInvDefine15 AS 存货自定义项15,
cInvDefine16 AS 存货自定义项16,
cSAComUnitCode AS 销售默认计量单位编码,
cPUComUnitCode AS 采购默认计量单位编码,
cSTComUnitCode AS 库存默认计量单位编码,
cCAComUnitCode AS 成本默认计量单位编码,
cFrequency AS 盘点周期单位,
iFrequency AS 盘点周期,
iDays AS 盘点日,
dLastDate AS 上次盘点日期,
iWastage AS 合理损耗率,
bSolitude AS 是否单独存放,
cEnterprise AS 生产企业,
cAddress AS 产地,
cFile AS 批准文号或注册证号,
cLabel AS 注册商标,
cCheckOut AS 合格证号,
cLicence AS 生产许可证号,
bSpecialties AS 是否特殊药品,
iHighPrice AS 最高售价,
iExpSaleRate AS 销售加成率,
cPriceGroup AS 价格组,
cOfferGrade AS 销售贡献等级,
iOfferRate AS 销售贡献率,
cMonth AS 存货期末处理会计期,
iAdvanceDate AS 累计提前期,
cCurrencyName AS 通用名称,
cProduceAddress AS 生产地点,
cProduceNation AS 生产国别,
cRegisterNo AS 进口药品注册证号,
cEnterNo AS 入关证号,
cPackingType AS 包装规格,
cEnglishName AS 存货英文名称,
bPropertyCheck AS 是否质检,
cPreparationType AS 剂型,
cCommodity AS 注册商标批件,
iRecipeBatch AS 处方药或非处方药,
cNotPatentName AS 国际非专利名,
pubufts AS 时间戳,
bPromotSales AS 是否促销品,
iPlanPolicy AS 计划策略,
iROPMethod AS 再订货点方法,
iBatchRule AS 批量规则,
fBatchIncrement AS 批量增量,
iAssureProvideDays AS 保证供应天数,
iTestStyle AS 检验方式,
iDTMethod AS 抽检方案,
fDTRate AS 抽检率,
fDTNum AS 抽检量,
cDTUnit AS 检验计量单位,
iDTStyle AS 抽检方式,
iQTMethod AS 质量检验方案,
PictureGUID AS 图片GUID,
bPlanInv AS 是否计划品,
bProxyForeign AS 是否委外,
bATOModel AS 是否ATO模型,
bCheckItem AS 是否选项类,
bPTOModel AS 是否PTO模型,
bEquipment AS 设备,
cProductUnit AS 生产计量单位,
fOrderUpLimit AS 订货超额上限,
fRetailPrice AS 零售价格,
cInvDepCode AS 生产部门,
iAlterAdvance AS 变动提前期,
fAlterBaseNum AS 变动基数,
cPlanMethod AS 计划方法,
bMPS AS MPS件,
bROP AS ROP件,
bRePlan AS 是否重复计划,
cSRPolicy AS 供需政策,
bBillUnite AS 是否令单合并,
iSupplyDay AS 供应期间,
fSupplyMulti AS 供应倍数,
fMinSupply AS 最低供应量,
bCutMantissa AS 是否切除尾数,
cInvPersonCode AS 计划员,
iInvTfId AS 时栅代号,
cEngineerFigNo AS 工程图号,
bInTotalCost AS 成本累计否,
iSupplyType AS 供应类型,
bConfigFree1 AS 结构性自由项1,
bConfigFree2 AS 结构性自由项2,
bConfigFree3 AS 结构性自由项3,
bConfigFree4 AS 结构性自由项4,
bConfigFree5 AS 结构性自由项5,
bConfigFree6 AS 结构性自由项6,
bConfigFree7 AS 结构性自由项7,
bConfigFree8 AS 结构性自由项8,
bConfigFree9 AS 结构性自由项9,
bConfigFree10 AS 结构性自由项10,
iDTLevel AS 检验水平,
cDTAQL AS Aql,
bPeriodDT AS 是否周期检验,
cDTPeriod AS 检验周期,
iBigMonth AS 不大于月,
iBigDay AS 不大于天,
iSmallMonth AS 不小于月,
iSmallDay AS 不小于天,
bOutInvDT AS 是否发货检验,
bBackInvDT AS 是否退货检验,
iEndDTStyle AS 自制品检验严格度,
bDTWarnInv AS 保质期存货是否检验,
fBackTaxRate AS 退税率,
cCIQCode AS 海关代码,
cWGroupCode AS 重量计量组,
cWUnit AS 重量单位,
fGrossW AS 毛重,
cVGroupCode AS 体积计量组,
cVUnit AS 体积单位,
iDTUCounter AS 检验正方向记数,
iDTDCounter AS 检验反方向记数,
iBatchCounter AS 连续累计批记数,
cShopUnit AS 零售计量单位,
cPurPersonCode AS 采购员,
bImportMedicine AS 是否进口药品,
bFirstBusiMedicine AS 是否首营药品,
bForeExpland AS 预测展开,
cInvPlanCode AS 计划品,
fConvertRate AS 转换因子,
dReplaceDate AS 替换日期,
bInvModel AS 模型,
bKCCutMantissa AS 领料是否切除尾数,
bReceiptByDT AS 来料须依据检验结果入库,
iImpTaxRate AS 进项税率,
iExpTaxRate AS 出口税率,
bExpSale AS 外销,
iDrawBatch AS 领料批量,
bCheckBSATP AS 检查售前ATP,
cInvProjectCode AS 售前ATP方案,
iTestRule AS 检验规则,
cRuleCode AS 自定义抽检规则,
bCheckFree1 AS 核算自由项1,
bCheckFree2 AS 核算自由项2,
bCheckFree3 AS 核算自由项3,
bCheckFree4 AS 核算自由项4,
bCheckFree5 AS 核算自由项5,
bCheckFree6 AS 核算自由项6,
bCheckFree7 AS 核算自由项7,
bCheckFree8 AS 核算自由项8,
bCheckFree9 AS 核算自由项9,
bCheckFree10 AS 核算自由项10,
bBomMain AS 允许BOM母件,
bBomSub AS 允许BOM子件,
bProductBill AS 允许生产订单,
iCheckATP AS 检查ATP,
iInvATPId AS ATP规则 ,
iPlanTfDay AS 计划时栅天数,
iOverlapDay AS 重叠天数,
bPiece AS 计件,
bSrvItem AS 服务项目,
bSrvFittings AS 服务配件,
fMaxSupply AS 最高供应量,
fMinSplit AS 最小分割量,
bSpecialOrder AS 客户订单专用,
bTrackSaleBill AS 销售跟单
from Inventory";
return conn.Query<Materiel>(sql, null);
}
}
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dapper;
using NX.ERP.Model;
namespace NX.ERP.U8
{
public class MaterielTypeDAL
{
public IEnumerable<MaterielType> GetList()
{
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
{
var sql = @"select cInvCCode AS MaterielTypeCode,cInvCName AS MaterielTypeName from InventoryClass ";
return conn.Query<MaterielType>(sql, null);
}
}
}
}

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dapper;
using NX.ERP.Model;
namespace NX.ERP.U8
{
public class SupplierDAL
{
public IEnumerable<Supplier> GetList()
{
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
{
var sql = @"select
cVenCode AS SupplierCode,
cVenName AS SupplierName,
cVenPostCode AS PostalCode,
cVenAddress AS Address,
cVenPerson AS Contract from Vendor ";
return conn.Query<Supplier>(sql, null);
}
}
}
}

24
NX.ERP.U8/Base/UnitDAL.cs Normal file
View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dapper;
using NX.ERP.Model;
namespace NX.ERP.U8
{
public class UnitDAL
{
public IEnumerable<Unit> GetList()
{
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
{
var sql = @"select
cComunitCode AS UnitCode,
cComUnitName AS UnitName,bMainUnit as MainUnit, cGroupCode as GroupCode from ComputationUnit ";
return conn.Query<Unit>(sql, null);
}
}
}
}

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dapper;
using NX.ERP.Model;
namespace NX.ERP.U8
{
public class WarehouseDAL
{
public IEnumerable<Warehouse> GetList()
{
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
{
var sql = "select cWhCode as WarehouseCode,cWhName as WarehouseName from Warehouse";
return conn.Query<Warehouse>(sql, null);
}
}
}
}

104
NX.ERP.U8/NX.ERP.U8.csproj Normal file
View File

@@ -0,0 +1,104 @@
<?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>{BD673DA9-0606-4BCF-A016-FB5C4E7B5D59}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NX.ERP.U8</RootNamespace>
<AssemblyName>NX.ERP.U8</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<Compile Include="Base\BinDAL.cs" />
<Compile Include="Base\CustomerDAL.cs" />
<Compile Include="Base\MaterielDAL.cs" />
<Compile Include="Base\MaterielTypeDAL.cs" />
<Compile Include="STVocher.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Base\SupplierDAL.cs" />
<Compile Include="U8LoginContext.cs" />
<Compile Include="Base\UnitDAL.cs" />
<Compile Include="Base\WarehouseDAL.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>E:\U8SOFT\Interop\ADODB.dll</HintPath>
</Reference>
<Reference Include="Dapper, Version=1.40.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Dapper.1.42\lib\net35\Dapper.dll</HintPath>
</Reference>
<Reference Include="Interop.MSXML2, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>E:\U8SOFT\UFMOM\U8APIFramework\Interop.MSXML2.dll</HintPath>
</Reference>
<Reference Include="Interop.U8Login, Version=1.14.0.0, Culture=neutral, PublicKeyToken=79a4e7ad54eeabca, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>E:\U8SOFT\Interop\Interop.U8Login.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="UFIDA.U8.MomServiceCommon, Version=1.0.0.0, Culture=neutral, PublicKeyToken=79a4e7ad54eeabca, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>E:\U8SOFT\UFMOM\U8APIFramework\UFIDA.U8.MomServiceCommon.dll</HintPath>
</Reference>
<Reference Include="UFIDA.U8.U8APIFramework, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>E:\U8SOFT\UFMOM\U8APIFramework\UFIDA.U8.U8APIFramework.dll</HintPath>
</Reference>
<Reference Include="UFIDA.U8.U8MOMAPIFramework, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>E:\U8SOFT\UFMOM\U8APIFramework\UFIDA.U8.U8MOMAPIFramework.dll</HintPath>
</Reference>
<Reference Include="UFSoft.U8.Framework.Login.UI">
<HintPath>C:\Users\admin\Desktop\QuickScannerV4\QuickScannerV4\bin\UFSoft.U8.Framework.Login.UI.dll</HintPath>
</Reference>
<Reference Include="UFSoft.U8.Framework.LoginContext, Version=1.0.0.0, Culture=neutral, PublicKeyToken=90e57cffdf9d854d, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Users\admin\Desktop\QuickScannerV4\QuickScannerV4\bin\UFSoft.U8.Framework.LoginContext.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NX.ERP.Model\NX.ERP.Model.csproj">
<Project>{5d012e0a-afed-474e-81a9-5820890b1b29}</Project>
<Name>NX.ERP.Model</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("U8ApiInterface")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("U8ApiInterface")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("bd673da9-0606-4bcf-a016-fb5c4e7b5d59")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

381
NX.ERP.U8/STVocher.cs Normal file
View File

@@ -0,0 +1,381 @@
using System;
using System.Collections.Generic;
using System.Text;
using UFIDA.U8.U8MOMAPIFramework;
using UFIDA.U8.U8APIFramework;
using UFIDA.U8.U8APIFramework.Parameter;
using MSXML2;
using System.Runtime.InteropServices;
using U8Login;
namespace NX.ERP.U8
{
public class STVocher
{
public void AddVocher()
{
var a = U8LoginContext.Instance;
U8EnvContext envContext = new U8EnvContext();
envContext.U8Login =a.ClsLogin;
//第三步:设置API地址标识(Url)
//当前API:添加新单据的地址标识为:U8API/MaterialOut/Add
U8ApiAddress myApiAddress = new U8ApiAddress("U8API/MaterialOut/Add");
//第四步:构造APIBroker
U8ApiBroker broker = new U8ApiBroker(myApiAddress, envContext);
//第五步:API参数赋值
//给普通参数sVouchType赋值。此参数的数据类型为System.String,此参数按值传递,表示单据类型:11
broker.AssignNormalValue("sVouchType", "11");
//给BO表头参数DomHead赋值,此BO参数的业务类型为材料出库单,属表头参数。BO参数均按引用传递
//提示:给BO表头参数DomHead赋值有两种方法
//方法一是直接传入MSXML2.DOMDocumentClass对象
//broker.AssignNormalValue("DomHead", new MSXML2.DOMDocumentClass())
//方法二是构造BusinessObject对象,具体方法如下:
BusinessObject DomHead = broker.GetBoParam("DomHead");
DomHead.RowCount = 1; //设置BO对象(表头)行数,只能为一行
//给BO对象(表头)的字段赋值,值可以是真实类型,也可以是无类型字符串
//以下代码示例只设置第一行值。各字段定义详见API服务接口定义
/****************************** 以下是必输字段 ****************************/
DomHead[0]["id"] = 111; //主关键字段,int类型
DomHead[0]["ccode"] = "323"; //出库单号,string类型
DomHead[0]["ddate"] = DateTime.Today; //出库日期,DateTime类型
DomHead[0]["cwhcode"] = "2"; //仓库,string类型
/***************************** 以下是非必输字段 ****************************/
DomHead[0]["cmodifyperson"] = ""; //修改人,string类型
DomHead[0]["dmodifydate"] = ""; //修改日期,DateTime类型
DomHead[0]["dnmaketime"] = ""; //制单时间,DateTime类型
DomHead[0]["dnmodifytime"] = ""; //修改时间,DateTime类型
DomHead[0]["dnverifytime"] = ""; //审核时间,DateTime类型
DomHead[0]["hcinvdefine1"] = ""; //存货自定义项1,string类型
DomHead[0]["hcinvdefine2"] = ""; //存货自定义项2,string类型
DomHead[0]["hcinvdefine3"] = ""; //存货自定义项3,string类型
DomHead[0]["hcinvdefine4"] = ""; //存货自定义项3,string类型
DomHead[0]["hcinvdefine5"] = ""; //存货自定义项5,string类型
DomHead[0]["hcinvdefine6"] = ""; //存货自定义项3,string类型
DomHead[0]["hcinvdefine7"] = ""; //存货自定义项7,string类型
DomHead[0]["hcinvdefine8"] = ""; //存货自定义项8,string类型
DomHead[0]["hcinvdefine9"] = ""; //存货自定义项9,string类型
DomHead[0]["hcinvdefine10"] = ""; //存货自定义项10,string类型
DomHead[0]["hcinvdefine11"] = ""; //存货自定义项11,int类型
DomHead[0]["hcinvdefine12"] = ""; //存货自定义项12,int类型
DomHead[0]["hcinvdefine13"] = ""; //存货自定义项13,double类型
DomHead[0]["hcinvdefine14"] = ""; //存货自定义项14,double类型
DomHead[0]["hcinvdefine15"] = ""; //存货自定义项15,DateTime类型
DomHead[0]["hcinvdefine16"] = ""; //存货自定义项16,DateTime类型
DomHead[0]["cinvstd"] = ""; //规格型号,string类型
DomHead[0]["dchkdate"] = ""; //检验日期,DateTime类型
DomHead[0]["iavaquantity"] = ""; //可用量,string类型
DomHead[0]["iavanum"] = ""; //可用件数,string类型
DomHead[0]["ipresentnum"] = ""; //现存件数,string类型
DomHead[0]["ufts"] = ""; //时间戳,string类型
DomHead[0]["iproorderid"] = "1000000429"; //生产订单ID,string类型
DomHead[0]["cmpocode"] = "SCDD201200004"; //订单号,string类型
DomHead[0]["cpspcode"] = "090312"; //产品编码,string类型
DomHead[0]["cproinvaddcode"] = ""; //存货代码,string类型
DomHead[0]["ireturncount"] = ""; //ireturncount,string类型
DomHead[0]["iverifystate"] = ""; //iverifystate,string类型
DomHead[0]["iswfcontrolled"] = ""; //iswfcontrolled,string类型
DomHead[0]["imquantity"] = ""; //产量,double类型
DomHead[0]["cprobatch"] = ""; //生产批号,string类型
DomHead[0]["cbustype"] = "领料"; //业务类型,int类型
DomHead[0]["cbuscode"] = ""; //业务号,string类型
DomHead[0]["cchkperson"] = ""; //检验员,string类型
DomHead[0]["crdname"] = "材料出库"; //出库类别,string类型
DomHead[0]["cdepname"] = "研发LA组"; //部门,string类型
DomHead[0]["itopsum"] = ""; //最高库存量,string类型
DomHead[0]["ilowsum"] = ""; //最低库存量,string类型
DomHead[0]["cvenabbname"] = ""; //委外商,string类型
DomHead[0]["bomfirst"] = ""; //bomfirst,string类型
DomHead[0]["isafesum"] = ""; //安全库存量,string类型
DomHead[0]["dveridate"] = ""; //审核日期,DateTime类型
DomHead[0]["crdcode"] = "201"; //出库类别编码,string类型
DomHead[0]["cmemo"] = ""; //备注,string类型
DomHead[0]["cmaker"] = ""; //制单人,string类型
DomHead[0]["chandler"] = ""; //审核人,string类型
DomHead[0]["caccounter"] = ""; //记账人,string类型
DomHead[0]["ipresent"] = ""; //现存量,string类型
DomHead[0]["cinvname"] = ""; //产品名称,string类型
DomHead[0]["biscomplement"] = ""; //补料标志,int类型
DomHead[0]["cpersonname"] = ""; //业务员,string类型
DomHead[0]["bpositive"] = ""; //红蓝标识,string类型
DomHead[0]["cdefine1"] = ""; //表头自定义项1,string类型
DomHead[0]["cdefine11"] = ""; //表头自定义项11,string类型
DomHead[0]["cdefine12"] = ""; //表头自定义项12,string类型
DomHead[0]["cdefine13"] = ""; //表头自定义项13,string类型
DomHead[0]["cdefine14"] = ""; //表头自定义项14,string类型
DomHead[0]["cdefine2"] = ""; //表头自定义项2,string类型
DomHead[0]["cdefine3"] = ""; //表头自定义项3,string类型
DomHead[0]["csource"] = "生产订单"; //单据来源,int类型
DomHead[0]["cdefine5"] = ""; //表头自定义项5,int类型
DomHead[0]["cdefine15"] = ""; //表头自定义项15,int类型
DomHead[0]["cdefine6"] = ""; //表头自定义项6,DateTime类型
DomHead[0]["brdflag"] = ""; //收发标志,string类型
DomHead[0]["cdefine7"] = ""; //表头自定义项7,double类型
DomHead[0]["cdefine16"] = ""; //表头自定义项16,double类型
DomHead[0]["cdefine8"] = ""; //表头自定义项8,string类型
DomHead[0]["cdefine9"] = ""; //表头自定义项9,string类型
DomHead[0]["cvencode"] = ""; //委外商编码,string类型
DomHead[0]["cdefine10"] = ""; //表头自定义项10,string类型
DomHead[0]["cvouchtype"] = ""; //单据类型,string类型
DomHead[0]["cwhcode"] = "2"; //仓库编码,string类型
DomHead[0]["cdepcode"] = "24"; //部门编码,string类型
DomHead[0]["cpersoncode"] = ""; //业务员编码,string类型
DomHead[0]["vt_id"] = "65"; //模版号,int类型
DomHead[0]["cdefine4"] = ""; //表头自定义项4,DateTime类型
//给BO表体参数domBody赋值,此BO参数的业务类型为材料出库单,属表体参数。BO参数均按引用传递
//提示:给BO表体参数domBody赋值有两种方法
//方法一是直接传入MSXML2.DOMDocumentClass对象
//broker.AssignNormalValue("domBody", new MSXML2.DOMDocumentClass())
//方法二是构造BusinessObject对象,具体方法如下:
BusinessObject domBody = broker.GetBoParam("domBody");
//domBody.RowCount = 10; //设置BO对象行数
//可以自由设置BO对象行数为大于零的整数,也可以不设置而自动增加行数
//给BO对象的字段赋值,值可以是真实类型,也可以是无类型字符串
//以下代码示例只设置第一行值。各字段定义详见API服务接口定义
/****************************** 以下是必输字段 ****************************/
domBody[0]["autoid"] = 0; //主关键字段,int类型
domBody[0]["cinvcode"] = "107001"; //材料编码,string类型
domBody[0]["editprop"] = "A"; //编辑属性:A表新增,M表修改,D表删除,string类型
/***************************** 以下是非必输字段 ****************************/
domBody[0]["id"] = ""; //与主表关联项,int类型
domBody[0]["cinvaddcode"] = ""; //材料代码,string类型
domBody[0]["cinvname"] = ""; //材料名称,string类型
domBody[0]["cinvstd"] = ""; //规格型号,string类型
domBody[0]["cinvm_unit"] = ""; //主计量单位,string类型
domBody[0]["cinva_unit"] = ""; //库存单位,string类型
domBody[0]["creplaceitem"] = ""; //替换件,string类型
domBody[0]["cposition"] = "002060203"; //货位编码,string类型
domBody[0]["cinvdefine1"] = ""; //存货自定义项1,string类型
domBody[0]["cinvdefine2"] = ""; //存货自定义项2,string类型
domBody[0]["cinvdefine3"] = ""; //存货自定义项3,string类型
domBody[0]["cfree1"] = ""; //存货自由项1,string类型
domBody[0]["cbatchproperty1"] = ""; //批次属性1,double类型
domBody[0]["cbatchproperty2"] = ""; //批次属性2,double类型
domBody[0]["cfree2"] = ""; //存货自由项2,string类型
domBody[0]["cbatch"] = ""; //批号,string类型
domBody[0]["iinvexchrate"] = ""; //换算率,double类型
domBody[0]["inum"] = ""; //件数,double类型
domBody[0]["iquantity"] = "2"; //数量,double类型
domBody[0]["iunitcost"] = ""; //单价,double类型
domBody[0]["iprice"] = ""; //金额,double类型
domBody[0]["ipunitcost"] = ""; //计划单价,double类型
domBody[0]["ipprice"] = ""; //计划金额,double类型
domBody[0]["dvdate"] = ""; //失效日期,DateTime类型
domBody[0]["cobjcode"] = ""; //成本对象编码,string类型
domBody[0]["cname"] = ""; //项目,string类型
domBody[0]["isoutquantity"] = ""; //累计出库数量,double类型
domBody[0]["isoutnum"] = ""; //累计出库件数,double类型
domBody[0]["dsdate"] = ""; //结算日期,DateTime类型
domBody[0]["ifquantity"] = ""; //实际数量,double类型
domBody[0]["ifnum"] = ""; //实际件数,double类型
domBody[0]["cvouchcode"] = ""; //对应入库单id,string类型
domBody[0]["cbatchproperty3"] = ""; //批次属性3,double类型
domBody[0]["cfree3"] = ""; //存货自由项3,string类型
domBody[0]["cfree4"] = ""; //存货自由项4,string类型
domBody[0]["cbatchproperty4"] = ""; //批次属性4,double类型
domBody[0]["cbatchproperty5"] = ""; //批次属性5,double类型
domBody[0]["cfree5"] = ""; //存货自由项5,string类型
domBody[0]["cfree6"] = ""; //存货自由项6,string类型
domBody[0]["cbatchproperty6"] = ""; //批次属性6,string类型
domBody[0]["cbatchproperty7"] = ""; //批次属性7,string类型
domBody[0]["cfree7"] = ""; //存货自由项7,string类型
domBody[0]["cfree8"] = ""; //存货自由项8,string类型
domBody[0]["cbatchproperty8"] = ""; //批次属性8,string类型
domBody[0]["cbatchproperty9"] = ""; //批次属性9,string类型
domBody[0]["cfree9"] = ""; //存货自由项9,string类型
domBody[0]["cfree10"] = ""; //存货自由项10,string类型
domBody[0]["cbatchproperty10"] = ""; //批次属性10,DateTime类型
domBody[0]["cdefine36"] = ""; //表体自定义项15,DateTime类型
domBody[0]["cdefine37"] = ""; //表体自定义项16,DateTime类型
domBody[0]["cinvdefine13"] = ""; //存货自定义项13,string类型
domBody[0]["cinvdefine14"] = ""; //存货自定义项14,string类型
domBody[0]["cinvdefine15"] = ""; //存货自定义项15,string类型
domBody[0]["cinvdefine16"] = ""; //存货自定义项16,string类型
domBody[0]["inquantity"] = ""; //应发数量,double类型
domBody[0]["innum"] = ""; //应发件数,double类型
domBody[0]["dmadedate"] = ""; //生产日期,DateTime类型
domBody[0]["impoids"] = 1000131351; //生产订单子表ID,int类型(这里是生产订单物料需求的ID)
domBody[0]["isodid"] = ""; //销售订单子表ID,string类型
domBody[0]["iomomid"] = ""; //委外用料表ID,int类型
domBody[0]["iomodid"] = ""; //委外订单子表ID,int类型
domBody[0]["cbvencode"] = ""; //供应商编码,string类型
domBody[0]["cinvouchcode"] = ""; //对应入库单号,string类型
domBody[0]["imassdate"] = ""; //保质期,int类型
domBody[0]["cassunit"] = ""; //库存单位码,string类型
domBody[0]["cvenname"] = ""; //供应商,string类型
domBody[0]["cposname"] = ""; //货位,string类型
domBody[0]["corufts"] = ""; //对应单据时间戳,string类型
domBody[0]["cmolotcode"] = ""; //生产批号,string类型
domBody[0]["dmsdate"] = ""; //核销日期,DateTime类型
domBody[0]["cmassunit"] = ""; //保质期单位,int类型
domBody[0]["csocode"] = ""; //需求跟踪号,string类型
domBody[0]["cmocode"] = "SCDD201200004"; //生产订单号,string类型
domBody[0]["comcode"] = ""; //委外订单号,string类型
domBody[0]["cvmivencode"] = ""; //代管商代码,string类型
domBody[0]["cvmivenname"] = ""; //代管商,string类型
domBody[0]["bvmiused"] = ""; //代管消耗标识,int类型
domBody[0]["ivmisettlequantity"] = ""; //代管挂账确认单数量,double类型
domBody[0]["ivmisettlenum"] = ""; //代管挂账确认单件数,double类型
domBody[0]["productinids"] = ""; //productinids,int类型
domBody[0]["crejectcode"] = ""; //在库不良品处理单号,string类型
domBody[0]["cdemandmemo"] = ""; //需求分类代号说明,string类型
domBody[0]["iordertype"] = ""; //销售订单类别,int类型
domBody[0]["iorderdid"] = ""; //iorderdid,int类型
domBody[0]["iordercode"] = ""; //销售订单号,string类型
domBody[0]["iorderseq"] = ""; //销售订单行号,string类型
domBody[0]["iexpiratdatecalcu"] = ""; //有效期推算方式,int类型
domBody[0]["cexpirationdate"] = ""; //有效期至,string类型
domBody[0]["dexpirationdate"] = ""; //有效期计算项,string类型
domBody[0]["cciqbookcode"] = ""; //手册号,string类型
domBody[0]["ibondedsumqty"] = ""; //累计保税处理抽取数量,string类型
domBody[0]["copdesc"] = ""; //工序说明,string类型
domBody[0]["cmworkcentercode"] = ""; //工作中心编码,string类型
domBody[0]["cmworkcenter"] = ""; //工作中心,string类型
domBody[0]["invcode"] = ""; //产品编码,string类型
domBody[0]["invname"] = ""; //产品,string类型
domBody[0]["cwhpersonname"] = ""; //库管员名称,string类型
domBody[0]["cbaccounter"] = ""; //记账人,string类型
domBody[0]["bcosting"] = ""; //是否核算,string类型
domBody[0]["isotype"] = ""; //需求跟踪方式,int类型
domBody[0]["isoseq"] = ""; //需求跟踪行号,string类型
domBody[0]["imoseq"] = ""; //生产订单行号,string类型
domBody[0]["iopseq"] = ""; //工序行号,string类型
domBody[0]["isquantity"] = ""; //累计核销数量,double类型
domBody[0]["ismaterialfee"] = ""; //累计核销金额,double类型
domBody[0]["cdefine34"] = ""; //表体自定义项13,int类型
domBody[0]["cdefine35"] = ""; //表体自定义项14,int类型
domBody[0]["cwhpersoncode"] = ""; //库管员编码,string类型
domBody[0]["cdefine22"] = ""; //表体自定义项1,string类型
domBody[0]["cdefine28"] = ""; //表体自定义项7,string类型
domBody[0]["cdefine29"] = ""; //表体自定义项8,string类型
domBody[0]["cdefine30"] = ""; //表体自定义项9,string类型
domBody[0]["cdefine31"] = ""; //表体自定义项10,string类型
domBody[0]["cdefine32"] = ""; //表体自定义项11,string类型
domBody[0]["cdefine33"] = ""; //表体自定义项12,string类型
domBody[0]["cinvdefine4"] = ""; //存货自定义项4,string类型
domBody[0]["cinvdefine5"] = ""; //存货自定义项5,string类型
domBody[0]["cinvdefine6"] = ""; //存货自定义项6,string类型
domBody[0]["cinvdefine7"] = ""; //存货自定义项7,string类型
domBody[0]["cinvdefine8"] = ""; //存货自定义项8,string类型
domBody[0]["cinvdefine9"] = ""; //存货自定义项9,string类型
domBody[0]["cinvdefine10"] = ""; //存货自定义项10,string类型
domBody[0]["cinvdefine11"] = ""; //存货自定义项11,string类型
domBody[0]["cinvdefine12"] = ""; //存货自定义项12,string类型
domBody[0]["cbarcode"] = ""; //条形码,string类型
domBody[0]["cdefine23"] = ""; //表体自定义项2,string类型
domBody[0]["cdefine24"] = ""; //表体自定义项3,string类型
domBody[0]["itrids"] = ""; //特殊单据子表标识,double类型
domBody[0]["cdefine25"] = ""; //表体自定义项4,string类型
domBody[0]["cdefine26"] = ""; //表体自定义项5,double类型
domBody[0]["cdefine27"] = ""; //表体自定义项6,double类型
domBody[0]["citemcode"] = ""; //项目编码,string类型
domBody[0]["citem_class"] = ""; //项目大类编码,string类型
domBody[0]["citemcname"] = ""; //项目大类名称,string类型
//给普通参数domPosition赋值。此参数的数据类型为System.Object,此参数按引用传递,表示货位:传空
broker.AssignNormalValue("domPosition", null);
//该参数errMsg为OUT型参数,由于其数据类型为System.String,为一般值类型,因此不必传入一个参数变量。在API调用返回时,可以通过GetResult("errMsg")获取其值
//给普通参数cnnFrom赋值。此参数的数据类型为ADODB.Connection,此参数按引用传递,表示连接对象,如果由调用方控制事务,则需要设置此连接对象,否则传空
broker.AssignNormalValue("cnnFrom", null);
//该参数VouchId为INOUT型普通参数。此参数的数据类型为System.String,此参数按值传递。在API调用返回时,可以通过GetResult("VouchId")获取其值
broker.AssignNormalValue("VouchId", "");
//该参数domMsg为OUT型参数,由于其数据类型为MSXML2.IXMLDOMDocument2,非一般值类型,因此必须传入一个参数变量。在API调用返回时,可以直接使用该参数
MSXML2.IXMLDOMDocument2 domMsg = new DOMDocumentClass();
broker.AssignNormalValue("domMsg", domMsg);
//给普通参数bCheck赋值。此参数的数据类型为System.Boolean,此参数按值传递,表示是否控制可用量。
broker.AssignNormalValue("bCheck", false);
//给普通参数bBeforCheckStock赋值。此参数的数据类型为System.Boolean,此参数按值传递,表示检查可用量
broker.AssignNormalValue("bBeforCheckStock", false);
//给普通参数bIsRedVouch赋值。此参数的数据类型为System.Boolean,此参数按值传递,表示是否红字单据
broker.AssignNormalValue("bIsRedVouch", false);
//给普通参数sAddedState赋值。此参数的数据类型为System.String,此参数按值传递,表示传空字符串
broker.AssignNormalValue("sAddedState", "");
//给普通参数bReMote赋值。此参数的数据类型为System.Boolean,此参数按值传递,表示是否远程:转入false
broker.AssignNormalValue("bReMote", false);
//第六步:调用API
if (!broker.Invoke())
{
//错误处理
Exception apiEx = broker.GetException();
if (apiEx != null)
{
if (apiEx is MomSysException)
{
MomSysException sysEx = apiEx as MomSysException;
Console.WriteLine("系统异常:" + sysEx.Message);
//todo:异常处理
}
else if (apiEx is MomBizException)
{
MomBizException bizEx = apiEx as MomBizException;
Console.WriteLine("API异常:" + bizEx.Message);
//todo:异常处理
}
//异常原因
String exReason = broker.GetExceptionString();
if (exReason.Length != 0)
{
Console.WriteLine("异常原因:" + exReason);
}
}
//结束本次调用,释放API资源
broker.Release();
return;
}
//第七步:获取返回结果
//获取返回值
//获取普通返回值。此返回值数据类型为System.Boolean,此参数按值传递,表示返回值:true:成功,false:失败
System.Boolean result = Convert.ToBoolean(broker.GetReturnValue());
//获取out/inout参数值
//获取普通OUT参数errMsg。此返回值数据类型为System.String,在使用该参数之前,请判断是否为空
System.String errMsgRet = broker.GetResult("errMsg") as string;
//获取普通INOUT参数VouchId。此返回值数据类型为System.String,在使用该参数之前,请判断是否为空
System.String VouchIdRet = broker.GetResult("VouchId") as string;
//获取普通OUT参数domMsg。此返回值数据类型为MSXML2.IXMLDOMDocument2,在使用该参数之前,请判断是否为空
MSXML2.IXMLDOMDocument2 domMsgRet = (MSXML2.IXMLDOMDocument2)broker.GetResult("domMsg");
//结束本次调用,释放API资源
broker.Release();
return;
}
}
}

132
NX.ERP.U8/U8LoginContext.cs Normal file
View File

@@ -0,0 +1,132 @@
using System;
using System.Collections.Generic;
using System.Text;
using U8Login;
namespace NX.ERP.U8
{
public class U8LoginContext : IDisposable
{
private static U8LoginContext _u8LoginContext;
public static U8LoginContext Instance
{
get
{
if (_u8LoginContext == null)
{
_u8LoginContext = new U8LoginContext();
}
return _u8LoginContext;
}
}
private UFSoft.U8.Framework.Login.UI.clsLogin uiLogin;
private clsLogin _clslogin;
public U8LoginContext()
{
//uiLogin = new UFSoft.U8.Framework.Login.UI.clsLogin();
}
public clsLogin ClsLogin
{
get
{
if (this._clslogin == null)
{
this.Login();
}
return this._clslogin;
}
}
public void Dispose()
{
if (uiLogin != null)
{
uiLogin.SubLogout(AccID);
uiLogin.ShutDown();
uiLogin = null;
}
}
public string UserId { get; set; } = "003";
public string PassWord { get; set; } = "123456";
public string Server { get; set; } = "192.168.0.250";
public string AccID { get; set; } = "u8@889";
public string Serial { get; set; }
public string Constr4Net
{
get
{
return this.ClsLogin.UFDataConnstringForNet;
}
}
public string Constr
{
get
{
return this.ClsLogin.UfDbName;
}
}
private UFSoft.U8.Framework.Login.UI.clsLogin UiLogin
{
get
{
if (uiLogin == null)
{
uiLogin = new UFSoft.U8.Framework.Login.UI.clsLogin();
}
return uiLogin;
}
}
public void Login(bool showlogin = false)
{
if (!UiLogin.login("DP", "wx998", "", "192.168.0.250", "2020-12-31", AccID, Serial, showlogin))
{
throw new Exception(UiLogin.ErrDescript);
}
if (UiLogin.SubLogin("ST") == null)
{
throw new Exception(UiLogin.ErrDescript);
}
this._clslogin = new clsLoginClass();
if (!_clslogin.ConstructLogin(UiLogin.userToken))
{
throw new Exception(_clslogin.ShareString);
}
_clslogin.set_TaskId(UiLogin.GetTaskID("ST"));
}
}
}

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Dapper" version="1.42" targetFramework="net35" />
</packages>

View File

@@ -0,0 +1,27 @@
using System.Web;
using System.Web.Optimization;
namespace NX.ERP.WebAPi
{
public class BundleConfig
{
// 有关捆绑的详细信息,请访问 https://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
// 使用要用于开发和学习的 Modernizr 的开发版本。然后,当你做好
// 生产准备就绪,请使用 https://modernizr.com 上的生成工具仅选择所需的测试。
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));
}
}
}

View File

@@ -0,0 +1,13 @@
using System.Web;
using System.Web.Mvc;
namespace NX.ERP.WebAPi
{
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
}
}

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace NX.ERP.WebAPi
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
}

View File

@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Net.Http.Headers;
using System.Web.Http;
namespace NX.ERP.WebAPi
{
public class JsonContentNegotiator : IContentNegotiator
{
private readonly JsonMediaTypeFormatter _jsonFormatter;
public JsonContentNegotiator(JsonMediaTypeFormatter formatter)
{
_jsonFormatter = formatter;
}
public ContentNegotiationResult Negotiate(Type type, HttpRequestMessage request, IEnumerable<MediaTypeFormatter> formatters)
{
var result = new ContentNegotiationResult(_jsonFormatter, new MediaTypeHeaderValue("application/json"));
return result;
}
}
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
// Web API 配置和服务
// Web API 路由
config.MapHttpAttributeRoutes();
var jsonFormatter = new JsonMediaTypeFormatter();
config.Services.Replace(typeof(IContentNegotiator), new JsonContentNegotiator(jsonFormatter));
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{action}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
}
}

View File

@@ -0,0 +1,27 @@
using NX.ERP.U8;
using NX.ERP.U8.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace NX.ERP.WebAPi.Controllers
{
public class CustomerController : ApiController
{
// GET api/values
[HttpGet]
public IEnumerable<Model.Customer> List()
{
var customerDAL = new CustomerDAL();
return customerDAL.GetList();
}
// GET api/values/5
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace NX.ERP.WebAPi.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.Title = "Home Page";
return View();
}
}
}

View File

@@ -0,0 +1,21 @@
using NX.ERP.Model;
using NX.ERP.U8;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
namespace NX.ERP.WebAPi.Controllers
{
public class MaterielController : ApiController
{
[HttpGet]
public IEnumerable<Materiel> List()
{
var materielDAL = new MaterielDAL();
return materielDAL.GetList();
}
}
}

View File

@@ -0,0 +1,21 @@
using NX.ERP.Model;
using NX.ERP.U8;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
namespace NX.ERP.WebAPi.Controllers
{
public class MaterielTypeController:ApiController
{
[HttpGet]
public IEnumerable<MaterielType> List()
{
var materielType = new MaterielTypeDAL();
return materielType.GetList();
}
}
}

View File

@@ -0,0 +1,20 @@
using NX.ERP.U8.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
namespace NX.ERP.WebAPi.Controllers
{
public class PositionController : ApiController
{
[HttpGet]
public IEnumerable<Model.Bin> List()
{
var binDAL = new BinDAL();
return binDAL.GetList();
}
}
}

View File

@@ -0,0 +1,21 @@
using NX.ERP.Model;
using NX.ERP.U8;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
namespace NX.ERP.WebAPi.Controllers
{
public class SupplierController : ApiController
{
[HttpGet]
public IEnumerable<Supplier> List()
{
var supplierDAL = new SupplierDAL();
return supplierDAL.GetList();
}
}
}

View File

@@ -0,0 +1,20 @@
using NX.ERP.U8;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
namespace NX.ERP.WebAPi.Controllers
{
public class UnitController: ApiController
{
[HttpGet]
public IEnumerable<Model.Unit> List()
{
var supplierDAL = new UnitDAL();
return supplierDAL.GetList();
}
}
}

View File

@@ -0,0 +1,19 @@
using NX.ERP.U8;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
namespace NX.ERP.WebAPi.Controllers
{
public class WarehouseController:ApiController
{
[HttpGet]
public IEnumerable<Model.Warehouse> List()
{
var warehouseDAL = new WarehouseDAL();
return warehouseDAL.GetList();
}
}
}

View File

@@ -0,0 +1 @@
<%@ Application Codebehind="Global.asax.cs" Inherits="NX.ERP.WebAPi.WebApiApplication" Language="C#" %>

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
namespace NX.ERP.WebAPi
{
public class WebApiApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
}
}
}

View File

@@ -0,0 +1,210 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
<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>{A958D236-BAD0-4A56-ADB1-CEA3A1EF452B}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NX.ERP.WebAPi</RootNamespace>
<AssemblyName>NX.ERP.WebAPi</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress />
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</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>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Abstractions" />
<Reference Include="System.Web.Routing" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http">
</Reference>
<Reference Include="System.Net.Http.Formatting, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.WebRequest">
</Reference>
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http.WebHost, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.7\lib\net45\System.Web.Http.WebHost.dll</HintPath>
</Reference>
<Reference Include="System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Web.Optimization">
<HintPath>..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll</HintPath>
</Reference>
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
</Reference>
<Reference Include="WebGrease">
<Private>True</Private>
<HintPath>..\packages\WebGrease.1.6.0\lib\WebGrease.dll</HintPath>
</Reference>
<Reference Include="Antlr3.Runtime">
<Private>True</Private>
<HintPath>..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform">
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="App_Start\BundleConfig.cs" />
<Compile Include="App_Start\FilterConfig.cs" />
<Compile Include="App_Start\RouteConfig.cs" />
<Compile Include="App_Start\WebApiConfig.cs" />
<Compile Include="Controllers\HomeController.cs" />
<Compile Include="Controllers\CustomerController.cs" />
<Compile Include="Controllers\MaterielController.cs" />
<Compile Include="Controllers\MaterielTypeController.cs" />
<Compile Include="Controllers\PositionController.cs" />
<Compile Include="Controllers\SupplierController.cs" />
<Compile Include="Controllers\UnitController.cs" />
<Compile Include="Controllers\WarehouseController.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="favicon.ico" />
<Content Include="Global.asax" />
<Content Include="Web.config" />
<Content Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
<Content Include="Web.Release.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NX.ERP.Model\NX.ERP.Model.csproj">
<Project>{5d012e0a-afed-474e-81a9-5820890b1b29}</Project>
<Name>NX.ERP.Model</Name>
</ProjectReference>
<ProjectReference Include="..\NX.ERP.U8\NX.ERP.U8.csproj">
<Project>{bd673da9-0606-4bcf-a016-fb5c4e7b5d59}</Project>
<Name>NX.ERP.U8</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</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" />
<Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
</Target>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>61448</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:61448/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
</Target>
<!-- 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>

View File

@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息是通过以下项进行控制的
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("WebApplication3")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WebApplication3")]
[assembly: AssemblyCopyright("版权所有(C) 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 将使此程序集中的类型
// 对 COM 组件不可见。如果需要
// 从 COM 访问此程序集中的某个类型,请针对该类型将 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于 typelib 的 ID
[assembly: Guid("cfd6a673-76a8-438e-9698-f5fe204ec81b")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 内部版本号
// 修订版本
//
// 你可以指定所有值,也可以让修订版本和内部版本号采用默认值,
// 方法是按如下所示使用 "*":
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using Web.config transformation visit https://go.microsoft.com/fwlink/?LinkId=301874 -->
<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>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using Web.config transformation visit https://go.microsoft.com/fwlink/?LinkId=301874 -->
<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>

68
NX.ERP.WebAPi/Web.config Normal file
View File

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
https://go.microsoft.com/fwlink/?LinkId=301879
-->
<configuration>
<appSettings>
<add key="webpages:Version" value="3.0.0.0"/>
<add key="webpages:Enabled" value="false"/>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5"/>
<httpRuntime targetFramework="4.5"/>
</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="Antlr3.Runtime" publicKeyToken="eb42632606e9261f"/>
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed"/>
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930"/>
</dependentAssembly>
<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.WebPages" 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.2.7.0" newVersion="5.2.7.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
</compilers>
</system.codedom>
</configuration>

BIN
NX.ERP.WebAPi/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Antlr" version="3.5.0.2" targetFramework="net45" />
<package id="bootstrap" version="3.4.1" targetFramework="net45" />
<package id="jQuery" version="3.4.1" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc" version="5.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc.zh-Hans" version="5.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="3.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor.zh-Hans" version="3.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net45" />
<package id="Microsoft.AspNet.Web.Optimization.zh-Hans" version="1.1.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi" version="5.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Client.zh-Hans" version="5.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Core.zh-Hans" version="5.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.HelpPage" version="5.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.WebHost.zh-Hans" version="5.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="3.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages.zh-Hans" version="3.2.7" targetFramework="net45" />
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="2.0.1" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="Modernizr" version="2.8.3" targetFramework="net45" />
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net45" />
<package id="WebGrease" version="1.6.0" targetFramework="net45" />
</packages>

View File

@@ -3,18 +3,70 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16 # Visual Studio Version 16
VisualStudioVersion = 16.0.30804.86 VisualStudioVersion = 16.0.30804.86
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "U8AppMain", "U8AppMain\U8AppMain.csproj", "{8A6603B0-444A-49C7-80C9-195638129068}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NX.ERP.WebAPi", "NX.ERP.WebAPi\NX.ERP.WebAPi.csproj", "{A958D236-BAD0-4A56-ADB1-CEA3A1EF452B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NX.ERP.Model", "NX.ERP.Model\NX.ERP.Model.csproj", "{5D012E0A-AFED-474E-81A9-5820890B1B29}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NX.ERP.U8", "NX.ERP.U8\NX.ERP.U8.csproj", "{BD673DA9-0606-4BCF-A016-FB5C4E7B5D59}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NX.ERP.U8.App", "NX.ERP.U8.App\NX.ERP.U8.App.csproj", "{8A6603B0-444A-49C7-80C9-195638129068}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A958D236-BAD0-4A56-ADB1-CEA3A1EF452B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A958D236-BAD0-4A56-ADB1-CEA3A1EF452B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A958D236-BAD0-4A56-ADB1-CEA3A1EF452B}.Debug|x64.ActiveCfg = Debug|Any CPU
{A958D236-BAD0-4A56-ADB1-CEA3A1EF452B}.Debug|x64.Build.0 = Debug|Any CPU
{A958D236-BAD0-4A56-ADB1-CEA3A1EF452B}.Debug|x86.ActiveCfg = Debug|Any CPU
{A958D236-BAD0-4A56-ADB1-CEA3A1EF452B}.Debug|x86.Build.0 = Debug|Any CPU
{A958D236-BAD0-4A56-ADB1-CEA3A1EF452B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A958D236-BAD0-4A56-ADB1-CEA3A1EF452B}.Release|Any CPU.Build.0 = Release|Any CPU
{A958D236-BAD0-4A56-ADB1-CEA3A1EF452B}.Release|x64.ActiveCfg = Release|Any CPU
{A958D236-BAD0-4A56-ADB1-CEA3A1EF452B}.Release|x64.Build.0 = Release|Any CPU
{A958D236-BAD0-4A56-ADB1-CEA3A1EF452B}.Release|x86.ActiveCfg = Release|Any CPU
{A958D236-BAD0-4A56-ADB1-CEA3A1EF452B}.Release|x86.Build.0 = Release|Any CPU
{5D012E0A-AFED-474E-81A9-5820890B1B29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5D012E0A-AFED-474E-81A9-5820890B1B29}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5D012E0A-AFED-474E-81A9-5820890B1B29}.Debug|x64.ActiveCfg = Debug|Any CPU
{5D012E0A-AFED-474E-81A9-5820890B1B29}.Debug|x86.ActiveCfg = Debug|x86
{5D012E0A-AFED-474E-81A9-5820890B1B29}.Debug|x86.Build.0 = Debug|x86
{5D012E0A-AFED-474E-81A9-5820890B1B29}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5D012E0A-AFED-474E-81A9-5820890B1B29}.Release|Any CPU.Build.0 = Release|Any CPU
{5D012E0A-AFED-474E-81A9-5820890B1B29}.Release|x64.ActiveCfg = Release|Any CPU
{5D012E0A-AFED-474E-81A9-5820890B1B29}.Release|x86.ActiveCfg = Release|x86
{5D012E0A-AFED-474E-81A9-5820890B1B29}.Release|x86.Build.0 = Release|x86
{BD673DA9-0606-4BCF-A016-FB5C4E7B5D59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD673DA9-0606-4BCF-A016-FB5C4E7B5D59}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD673DA9-0606-4BCF-A016-FB5C4E7B5D59}.Debug|x64.ActiveCfg = Debug|Any CPU
{BD673DA9-0606-4BCF-A016-FB5C4E7B5D59}.Debug|x64.Build.0 = Debug|Any CPU
{BD673DA9-0606-4BCF-A016-FB5C4E7B5D59}.Debug|x86.ActiveCfg = Debug|Any CPU
{BD673DA9-0606-4BCF-A016-FB5C4E7B5D59}.Debug|x86.Build.0 = Debug|Any CPU
{BD673DA9-0606-4BCF-A016-FB5C4E7B5D59}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD673DA9-0606-4BCF-A016-FB5C4E7B5D59}.Release|Any CPU.Build.0 = Release|Any CPU
{BD673DA9-0606-4BCF-A016-FB5C4E7B5D59}.Release|x64.ActiveCfg = Release|Any CPU
{BD673DA9-0606-4BCF-A016-FB5C4E7B5D59}.Release|x64.Build.0 = Release|Any CPU
{BD673DA9-0606-4BCF-A016-FB5C4E7B5D59}.Release|x86.ActiveCfg = Release|Any CPU
{BD673DA9-0606-4BCF-A016-FB5C4E7B5D59}.Release|x86.Build.0 = Release|Any CPU
{8A6603B0-444A-49C7-80C9-195638129068}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8A6603B0-444A-49C7-80C9-195638129068}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8A6603B0-444A-49C7-80C9-195638129068}.Debug|Any CPU.Build.0 = Debug|Any CPU {8A6603B0-444A-49C7-80C9-195638129068}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8A6603B0-444A-49C7-80C9-195638129068}.Debug|x64.ActiveCfg = Debug|Any CPU
{8A6603B0-444A-49C7-80C9-195638129068}.Debug|x64.Build.0 = Debug|Any CPU
{8A6603B0-444A-49C7-80C9-195638129068}.Debug|x86.ActiveCfg = Debug|Any CPU
{8A6603B0-444A-49C7-80C9-195638129068}.Debug|x86.Build.0 = Debug|Any CPU
{8A6603B0-444A-49C7-80C9-195638129068}.Release|Any CPU.ActiveCfg = Release|Any CPU {8A6603B0-444A-49C7-80C9-195638129068}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A6603B0-444A-49C7-80C9-195638129068}.Release|Any CPU.Build.0 = Release|Any CPU {8A6603B0-444A-49C7-80C9-195638129068}.Release|Any CPU.Build.0 = Release|Any CPU
{8A6603B0-444A-49C7-80C9-195638129068}.Release|x64.ActiveCfg = Release|Any CPU
{8A6603B0-444A-49C7-80C9-195638129068}.Release|x64.Build.0 = Release|Any CPU
{8A6603B0-444A-49C7-80C9-195638129068}.Release|x86.ActiveCfg = Release|Any CPU
{8A6603B0-444A-49C7-80C9-195638129068}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<appSettings>
<!--修改账套请修改这里的配置-->
<add key="url" value="http://192.168.0.242/U8EAI/import.asp"/>
<add key="connStr" value="Server=192.168.0.242 ;DataBase=UFDATA_003_2019;Uid=sa;Pwd=!@#qwe123;"/>
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="ICSharpCode.SharpZipLib" publicKeyToken="1b03e6acf1164f73" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.2.0.246" newVersion="1.2.0.246"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -1,27 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace U8AppMain
{
public static class HttpHelper
{
public static Task<string> Post(string url, string strBody)
{
strBody = strBody ?? "";
using (HttpClient client = new HttpClient())
{
var httpContent = new StringContent(strBody, Encoding.UTF8);
httpContent.Headers.ContentType.MediaType = "application/xml";
httpContent.Headers.ContentType.CharSet = "utf-8";
HttpResponseMessage response = client.PostAsync(url, httpContent).Result;
if (httpContent != null)
httpContent.Dispose();
return response.Content.ReadAsStringAsync();
}
}
}
}

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Dapper" version="1.50.0" targetFramework="net45" />
<package id="FastReport.Compat" version="2020.4.2" targetFramework="net452" />
<package id="FastReport.OpenSource" version="2021.1.2" targetFramework="net452" />
<package id="Krypton.Components.Suite" version="4.5.9" targetFramework="net45" />
<package id="NPOI" version="2.2.1" targetFramework="net45" />
<package id="Portable.BouncyCastle" version="1.8.6" targetFramework="net45" />
<package id="SharpZipLib" version="1.2.0" targetFramework="net45" />
</packages>

11
U8Interface/Class1.cs Normal file
View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace U8Interface
{
public class Class1
{
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("U8Interface")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("U8Interface")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("2536060b-59aa-4102-9e4f-81195d9e58d0")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,50 @@
<?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>2536060b-59aa-4102-9e4f-81195d9e58d0</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>U8Interface</RootNamespace>
<AssemblyName>U8Interface</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<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' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System"/>
<Reference Include="System.Core"/>
<Reference Include="System.Xml.Linq"/>
<Reference Include="System.Data.DataSetExtensions"/>
<Reference Include="System.Data"/>
<Reference Include="System.Xml"/>
</ItemGroup>
<ItemGroup>
<Compile Include="Class1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>