using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using CertAuth.Domain; using Microsoft.Data.SqlClient; namespace CertAuthAdmin.Models { public class ItemsDA { public List tbl { get; set; } public IEnumerable GetAll_WD() { string connStr = Globals.connStr; List lst; lst = new List(); IEnumerable theList; using (SqlConnection con = new SqlConnection(connStr)) { SqlCommand cmd = new SqlCommand("Items_GetAllWD", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; con.Open(); SqlDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { Items_WD rec = new Items_WD(); rec.Id = (int)rdr["Id"]; rec.ItemType = rdr["ItemType"].ToString(); rec.ItemSubType = rdr["ItemSubType"].ToString(); rec.Category = rdr["Category"].ToString(); rec.SubCategory = rdr["SubCategory"].ToString(); rec.League = rdr["League"].ToString(); rec.Team = rdr["Team"].ToString(); rec.Entity = rdr["Entity"].ToString(); rec.ItemName = rdr["ItemName"].ToString(); rec.Description = rdr["Description"].ToString(); rec.InitialDate = (DateTime)rdr["InitialDate"]; rec.InitialVendorKey = (int)rdr["InitialAuthentication"]; rec.InitialVendorName = rdr["InitialVendorName"].ToString(); rec.RFIDKey = (int)rdr["RFIDKey"]; rec.TagUID = rdr["TagUID"].ToString(); rec.Status = rdr["Status"].ToString(); rec.StatusDesc = rdr["StatusDesc"].ToString(); rec.TimeStamp = (DateTime)rdr["TimeStamp"]; lst.Add(rec); } con.Close(); } theList = lst; return theList; } } }