📄 tdsreturninfo.cs
字号:
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Data.Common;
using System.ComponentModel;
using System;
namespace SouthernAir.Business.TypeDataSet {
[DataObject]
partial class tdsReturnInfo
{
protected static string strPros = "dbo.GetReturnInfo";
[DataObjectMethod(DataObjectMethodType.Select, true)]
public static BSAReturnInfoDataTable GetReturnInfo(string strName, string strOriginalID, string strTicketID)
{
try
{
BSAReturnInfoDataTable oDataTable = new BSAReturnInfoDataTable();
if (strName != null && strOriginalID != null && strTicketID != null)
{
int intTicketID = Convert.ToInt32(strTicketID);
string strConn = "Data Source=TRTGR\\SQLEXPRESS;AttachDbFilename=D:\\Project\\SouthernAir\\SouthernAir.Business\\SouthernAirData.mdf;Integrated Security=True";
using (SqlConnection conn = new SqlConnection(strConn))
{
conn.Open();
SqlCommand cmd = new SqlCommand(strPros, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@CustomerName", strName);
cmd.Parameters.AddWithValue("@OriginalID", strOriginalID);
cmd.Parameters.AddWithValue("@TicketID", intTicketID);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "ReturnInfo");
oDataTable.Merge(ds.Tables["ReturnInfo"]);
}
}
return oDataTable;
}
catch
{
BSAReturnInfoDataTable oDataTable = new BSAReturnInfoDataTable();
return oDataTable;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -