tdsreturninfo.cs
来自「航空公司用的简单管理系统」· CS 代码 · 共 51 行
CS
51 行
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 + =
减小字号Ctrl + -
显示快捷键?