mirror of
https://github.com/stokebob/bnhtrade.git
synced 2026-03-19 06:27:15 +00:00
wip
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace bnhtrade.Core.Data.Database.Purchase
|
||||
{
|
||||
internal class PurchaseLineStatus : Connection
|
||||
{
|
||||
public List<Model.Purchase.PurchaseLineStatus> Read()
|
||||
{
|
||||
var returnList = new List<Model.Purchase.PurchaseLineStatus>();
|
||||
|
||||
using (SqlConnection conn = new SqlConnection(SqlConnectionString))
|
||||
{
|
||||
conn.Open();
|
||||
|
||||
using (SqlCommand cmd = new SqlCommand(@"
|
||||
SELECT [PurchaseLineStatusID]
|
||||
,[PurchaseLineStatus]
|
||||
,[ListSort]
|
||||
,[TimeStamp]
|
||||
FROM [e2A].[dbo].[tblPurchaseLineStatus]
|
||||
ORDER BY [ListSort]
|
||||
", conn))
|
||||
{
|
||||
|
||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
if (!reader.HasRows)
|
||||
{
|
||||
// do something
|
||||
}
|
||||
else
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
int id = reader.GetInt32(0);
|
||||
string name = reader.GetString(1);
|
||||
int lineSort = reader.GetInt32(2);
|
||||
|
||||
var returnItem = new Model.Purchase.PurchaseLineStatus(id, name,lineSort);
|
||||
returnList.Add( returnItem );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return returnList;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user