public EmailTypeList GetAll() { StudentDB database = new StudentDB("Student"); database.Command.Parameters.Clear(); database.Command.CommandType = System.Data.CommandType.StoredProcedure; database.Command.CommandText = "tblEmailType_GETALL"; DataTable dt = database.ExecuteQuery(); foreach (DataRow dr in dt.Rows) { EmailType emailtype = new EmailType(); emailtype.Initialize(dr); emailtype.InitializeBusinessData(dr); emailtype.isNew = false; emailtype.isDirty = false; _List.Add(emailtype); } return(this); }
public EmailTypeList GetAll() { Database database = new Database("Employer"); database.Command.Parameters.Clear(); database.Command.CommandType = System.Data.CommandType.StoredProcedure; database.Command.CommandText = "tblEmailTypeGetAll"; DataTable dt = database.ExecuteQuery(); EmailType blank = new EmailType(); blank.Type = "Select an Email Type"; _List.Add(blank); foreach (DataRow dr in dt.Rows) { EmailType e = new EmailType(); e.Initialize(dr); e.InitializeBusinessData(dr); e.IsNew = false; e.IsDirty = false; e.Savable += EmailType_Savable; _List.Add(e); } return this; }