Browse Source

提交

master
学 赵 4 years ago
parent
commit
cc1b763fc8
  1. 50
      Controller/UniApiController.cs
  2. 54
      SCP/Admin/UNIAPI.aspx
  3. 74
      SCP/Admin/UNIAPI.aspx.cs
  4. 78
      SCP/Admin/UNIAPI.aspx.designer.cs
  5. 8
      SCP/SCP.csproj

50
Controller/UniApiController.cs

@ -1,6 +1,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data;
using System.Data.Entity.Core; using System.Data.Entity.Core;
using System.Data.SqlClient;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using CK.SCP.Models; using CK.SCP.Models;
@ -218,6 +220,54 @@ namespace CK.SCP.Controller
return asp; return asp;
} }
public static DataTable FindUniapi(string p_type, string p_billNum, string p_domain)
{
string sql = string.Empty;
switch (p_type)
{
case "xxqad_pod_det":
sql =
"SELECT * FROM[xxqad_pod_det] a inner join xxqad_ctrl b on a.xxqad_pod_seq = b.xxqad_seq where xxqad_domain = '{1}' and xxqad_pod_nbr in ({0}) order by xxqad_pod_nbr, b.xxqad_seq ";
break;
case "xxqad_prh_det":
sql = "SELECT * FROM[xxqad_prh_det] a inner join xxqad_ctrl b on a.xxqad_prh_seq = b.xxqad_seq where xxqad_domain = '{1}' and (xxqad_prh_psnbr in ({0}) or xxqad_prh_receiver in ({0})) order by xxqad_prh_psnbr, b.xxqad_seq ";
break;
case "xxwms_rc_det":
sql = "select * from xxwms_rc_det a inner join xxwms_ctrl b on a.xxwms_rc_seq = b.xxwms_seq where xxwms_domain = '{1}' and (xxwms_rc_nbr in ({0}) order by xxwms_rc_nbr, b.xxwms_seq";
break;
case "xxscm_tx_mstr":
sql = "select * from xxscm_tx_mstr a inner join xxscm_ctrl b on a.xxscm_tx_seq = b.xxscm_seq where xxscm_domain = '{1}' and xxscm_tx_nbr in ({0}) order by xxscm_tx_nbr, b.xxscm_seq";
break;
case "xxscm_inv_det":
sql = "select * from xxscm_inv_det a inner join xxscm_ctrl b on a.xxscm_inv_seq = b.xxscm_seq where xxscm_domain = '{1}' and xxscm_inv_nbr IN({0}) order by xxscm_inv_nbr,b.xxscm_seq";
break;
}
DataTable _dt = new DataTable();
var dbSetting = GlobalConfig.UniApiDatabase;
var strConn = EntitiesFactory.GetEfConnectionString(dbSetting);
SqlConnection conn = new System.Data.SqlClient.SqlConnection();
try
{
conn.ConnectionString = strConn;
if (conn.State != ConnectionState.Open)
{
conn.Open();
}
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandText = string.Format(sql, p_billNum, p_domain);
SqlDataAdapter adapter = new SqlDataAdapter(cmd);
adapter.Fill(_dt);
conn.Close();
}
catch (Exception e)
{
conn.Close();
}
return _dt;
}
//创建发货单 //创建发货单
public static TS_UNI_API CreateBy(V_TB_ASN bill, V_TB_ASN_DETAIL detail, UniApiType uniApiType) public static TS_UNI_API CreateBy(V_TB_ASN bill, V_TB_ASN_DETAIL detail, UniApiType uniApiType)

54
SCP/Admin/UNIAPI.aspx

@ -0,0 +1,54 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UNIAPI.aspx.cs" Inherits="SCP.Admin.UNIAPI" %>
<!DOCTYPE html>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items>
<f:Form runat="server">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:DropDownList runat="server" ID="DDL_State" Label="查询接口">
<f:ListItem Text="订单接口" Value="xxqad_pod_det"/>
<f:ListItem Text="QAD收货单接口" Value="xxqad_prh_det" />
<f:ListItem Text="WMS收货单接口" Value="xxwms_rc_det" />
<f:ListItem Text="发货单接口" Value="xxscm_tx_mstr" />
<f:ListItem Text="发票接口" Value="xxscm_inv_det" />
</f:DropDownList>
<f:TextArea runat="server" Label="单据号" ID="TXT_billnum" Width="600" ></f:TextArea>
<f:Button ID="BtnSearch" runat="server" OnClick="BtnSearch_Click" Text="快速查找">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Grid ID = "Grid" EnableCollapse = "true" ShowBorder = "true" ShowHeader = "true" runat ="server"
>
<Columns>
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

74
SCP/Admin/UNIAPI.aspx.cs

@ -0,0 +1,74 @@
using CK.SCP.Controller;
using FineUI;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace SCP.Admin
{
public partial class UNIAPI : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Bind();
}
}
private void Bind()
{
var _domain = Request["Domain"];
var _billNum =TXT_billnum.Text= Request.Params["BillNum"];
var _tableName=DDL_State.SelectedValue= Request.Params["TableName"];
if (!string.IsNullOrEmpty(_billNum) && !string.IsNullOrEmpty(_domain) && !string.IsNullOrEmpty(_tableName))
{
var _ary = _billNum.Split(new char[] { ',' }).ToList();
var sqlstr = string.Empty;
_ary.ForEach(p =>
{
sqlstr += string.Format("'{0}',", p);
});
sqlstr = sqlstr.Substring(0, sqlstr.Length - 1);
DataTable _dt = UniApiController.FindUniapi(_tableName, sqlstr, _domain);
foreach (DataColumn column in _dt.Columns)
{
FineUI.BoundField bf;
bf = new FineUI.BoundField();
bf.DataField = column.ColumnName;
bf.SortField = column.ColumnName;
bf.HeaderText = column.ColumnName;
Grid.Columns.Add(bf);
}
Grid.DataSource = _dt;
Grid.DataBind();
}
}
protected void BtnSearch_Click(object sender, EventArgs e)
{
StringBuilder _buffer = new StringBuilder();
if (!string.IsNullOrEmpty(DDL_State.SelectedValue))
{
_buffer.AppendFormat("TableName={0}&&", DDL_State.SelectedValue);
}
if (!string.IsNullOrEmpty(TXT_billnum.Text))
{
_buffer.AppendFormat("BillNum={0}&&", TXT_billnum.Text);
}
if (!string.IsNullOrEmpty(CurrentUser.UsedDomain))
{
_buffer.AppendFormat("Domain={0}",CurrentUser.UsedDomain);
}
string s = _buffer.ToString();
PageContext.Redirect(string.Format("UNIAPI.aspx?{0}", s));
}
}
}

78
SCP/Admin/UNIAPI.aspx.designer.cs

@ -0,0 +1,78 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Admin {
public partial class UNIAPI {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// DDL_State 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList DDL_State;
/// <summary>
/// TXT_billnum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextArea TXT_billnum;
/// <summary>
/// BtnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnSearch;
/// <summary>
/// Grid 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid;
}
}

8
SCP/SCP.csproj

@ -197,6 +197,7 @@
<Content Include="Admin\title_new.aspx" /> <Content Include="Admin\title_new.aspx" />
<Content Include="Admin\title_user.aspx" /> <Content Include="Admin\title_user.aspx" />
<Content Include="Admin\title_user_addnew.aspx" /> <Content Include="Admin\title_user_addnew.aspx" />
<Content Include="Admin\UNIAPI.aspx" />
<Content Include="Admin\user.aspx" /> <Content Include="Admin\user.aspx" />
<Content Include="Admin\user_changepassword.aspx" /> <Content Include="Admin\user_changepassword.aspx" />
<Content Include="Admin\user_edit.aspx" /> <Content Include="Admin\user_edit.aspx" />
@ -4802,6 +4803,13 @@
<Compile Include="Admin\title_user_addnew.aspx.designer.cs"> <Compile Include="Admin\title_user_addnew.aspx.designer.cs">
<DependentUpon>title_user_addnew.aspx</DependentUpon> <DependentUpon>title_user_addnew.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="Admin\UNIAPI.aspx.cs">
<DependentUpon>UNIAPI.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Admin\UNIAPI.aspx.designer.cs">
<DependentUpon>UNIAPI.aspx</DependentUpon>
</Compile>
<Compile Include="Admin\user.aspx.cs"> <Compile Include="Admin\user.aspx.cs">
<DependentUpon>user.aspx</DependentUpon> <DependentUpon>user.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>

Loading…
Cancel
Save