public BookList GetAll() { _list.Clear(); Database db = new Database("Books"); db.Command.CommandType = System.Data.CommandType.StoredProcedure; db.Command.CommandText = "tblBookGETALL"; DataTable dt = db.ExecuteQuery(); //dgvStudent.DataSource = dt; foreach (DataRow dr in dt.Rows) { Book s = new Book(); s.Initialize(dr); s.InitializeBusinessData(dr); s.IsDirty = false; s.IsNew = false; s.evtIsSavable += new IsSavableHandler(s_evtIsSavable); _list.Add(s); } return this; }
public BookList GetByBookTypeID(Guid bookTypeID) { _list.Clear(); Database db = new Database("Books"); db.Command.CommandType = System.Data.CommandType.StoredProcedure; db.Command.CommandText = "tblBookGETBYBOOKTYPEID"; db.Command.Parameters.Add("@BookTypeID", SqlDbType.UniqueIdentifier).Value = bookTypeID; DataTable dt = db.ExecuteQuery(); //dgvStudent.DataSource = dt; foreach (DataRow dr in dt.Rows) { Book s = new Book(); s.Initialize(dr); s.InitializeBusinessData(dr); s.IsDirty = false; s.IsNew = false; s.evtIsSavable += new IsSavableHandler(s_evtIsSavable); _list.Add(s); } return this; }
public BookList GetAll() { _list.Clear(); Database db = new Database("Books"); db.Command.CommandType = System.Data.CommandType.StoredProcedure; db.Command.CommandText = "tblBookGETALL"; DataTable dt = db.ExecuteQuery(); //dgvStudent.DataSource = dt; foreach (DataRow dr in dt.Rows) { Book s = new Book(); s.Initialize(dr); s.InitializeBusinessData(dr); s.IsDirty = false; s.IsNew = false; s.evtIsSavable += new IsSavableHandler(s_evtIsSavable); _list.Add(s); } return(this); }
public BookList GetByBookTypeID(Guid bookTypeID) { _list.Clear(); Database db = new Database("Books"); db.Command.CommandType = System.Data.CommandType.StoredProcedure; db.Command.CommandText = "tblBookGETBYBOOKTYPEID"; db.Command.Parameters.Add("@BookTypeID", SqlDbType.UniqueIdentifier).Value = bookTypeID; DataTable dt = db.ExecuteQuery(); //dgvStudent.DataSource = dt; foreach (DataRow dr in dt.Rows) { Book s = new Book(); s.Initialize(dr); s.InitializeBusinessData(dr); s.IsDirty = false; s.IsNew = false; s.evtIsSavable += new IsSavableHandler(s_evtIsSavable); _list.Add(s); } return(this); }