From cc1b763fc8b4b3c5bb747c1ede583397fa40430b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Wed, 9 Sep 2020 16:56:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/UniApiController.cs | 50 ++++++++++++++++++++ SCP/Admin/UNIAPI.aspx | 54 +++++++++++++++++++++ SCP/Admin/UNIAPI.aspx.cs | 74 +++++++++++++++++++++++++++++ SCP/Admin/UNIAPI.aspx.designer.cs | 78 +++++++++++++++++++++++++++++++ SCP/SCP.csproj | 8 ++++ 5 files changed, 264 insertions(+) create mode 100644 SCP/Admin/UNIAPI.aspx create mode 100644 SCP/Admin/UNIAPI.aspx.cs create mode 100644 SCP/Admin/UNIAPI.aspx.designer.cs diff --git a/Controller/UniApiController.cs b/Controller/UniApiController.cs index 1aa15ee..cb42e69 100644 --- a/Controller/UniApiController.cs +++ b/Controller/UniApiController.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; +using System.Data; using System.Data.Entity.Core; +using System.Data.SqlClient; using System.Linq; using System.Text; using CK.SCP.Models; @@ -218,6 +220,54 @@ namespace CK.SCP.Controller 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) diff --git a/SCP/Admin/UNIAPI.aspx b/SCP/Admin/UNIAPI.aspx new file mode 100644 index 0000000..ba98cb7 --- /dev/null +++ b/SCP/Admin/UNIAPI.aspx @@ -0,0 +1,54 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UNIAPI.aspx.cs" Inherits="SCP.Admin.UNIAPI" %> + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SCP/Admin/UNIAPI.aspx.cs b/SCP/Admin/UNIAPI.aspx.cs new file mode 100644 index 0000000..f30d2ef --- /dev/null +++ b/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)); + + } + } +} + + diff --git a/SCP/Admin/UNIAPI.aspx.designer.cs b/SCP/Admin/UNIAPI.aspx.designer.cs new file mode 100644 index 0000000..4d1f2fb --- /dev/null +++ b/SCP/Admin/UNIAPI.aspx.designer.cs @@ -0,0 +1,78 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace SCP.Admin { + + + public partial class UNIAPI { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Panel Panel1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Toolbar Toolbar2; + + /// + /// DDL_State 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.DropDownList DDL_State; + + /// + /// TXT_billnum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.TextArea TXT_billnum; + + /// + /// BtnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Button BtnSearch; + + /// + /// Grid 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Grid Grid; + } +} diff --git a/SCP/SCP.csproj b/SCP/SCP.csproj index 9c91f6b..c75f6bb 100644 --- a/SCP/SCP.csproj +++ b/SCP/SCP.csproj @@ -197,6 +197,7 @@ + @@ -4802,6 +4803,13 @@ title_user_addnew.aspx + + UNIAPI.aspx + ASPXCodeBehind + + + UNIAPI.aspx + user.aspx ASPXCodeBehind