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 TableMstrDA { 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("TableMstr_GetAll_WD", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; con.Open(); SqlDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { TableMstr_WD rec = new TableMstr_WD(); rec.Id = (int)rdr["Id"]; rec.TableCode = rdr["TableCode"].ToString(); rec.TableDescShort = rdr["TableDescShort"].ToString(); rec.TableDescLong = rdr["TableDescLong"].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; } } }