public CategoryTypeList GetAll() { _list.Clear(); Database db = new Database("student"); db.Command.CommandType = System.Data.CommandType.StoredProcedure; db.Command.CommandText = "tblCategoryGetAll"; DataTable dt = db.ExecuteQuery(); CategoryType Blank = new CategoryType(); Blank.Type = "Select Catetory Type"; _list.Add(Blank); foreach (DataRow dr in dt.Rows) { CategoryType e = new CategoryType(); e.Initialize(dr); e.InitializeBusinessData(dr); e.IsDirty = false; e.IsNew = false; e.evtIsSavable += new IsSavableHandler(s_evtIsSavable); _list.Add(e); } return this; }
public CategoryTypeList GetAll() { _list.Clear(); Database db = new Database("student"); db.Command.CommandType = System.Data.CommandType.StoredProcedure; db.Command.CommandText = "tblCategoryGetAll"; DataTable dt = db.ExecuteQuery(); CategoryType Blank = new CategoryType(); Blank.Type = "Select Catetory Type"; _list.Add(Blank); foreach (DataRow dr in dt.Rows) { CategoryType e = new CategoryType(); e.Initialize(dr); e.InitializeBusinessData(dr); e.IsDirty = false; e.IsNew = false; e.evtIsSavable += new IsSavableHandler(s_evtIsSavable); _list.Add(e); } return(this); }