public MenuEntityPosition GetByID(int _menuEntityPositionID) { MenuEntityPositionDAC _menuEntityPositionComponent = new MenuEntityPositionDAC(); IDataReader reader = _menuEntityPositionComponent.GetByIDMenuEntityPosition(_menuEntityPositionID); MenuEntityPosition _menuEntityPosition = null; while(reader.Read()) { _menuEntityPosition = new MenuEntityPosition(); if(reader["MenuEntityPositionID"] != DBNull.Value) _menuEntityPosition.MenuEntityPositionID = Convert.ToInt32(reader["MenuEntityPositionID"]); if(reader["Name"] != DBNull.Value) _menuEntityPosition.Name = Convert.ToString(reader["Name"]); _menuEntityPosition.NewRecord = false; } reader.Close(); return _menuEntityPosition; }
public List<MenuEntityPosition> GetAll() { MenuEntityPositionDAC _menuEntityPositionComponent = new MenuEntityPositionDAC(); IDataReader reader = _menuEntityPositionComponent.GetAllMenuEntityPosition().CreateDataReader(); List<MenuEntityPosition> _menuEntityPositionList = new List<MenuEntityPosition>(); while(reader.Read()) { if(_menuEntityPositionList == null) _menuEntityPositionList = new List<MenuEntityPosition>(); MenuEntityPosition _menuEntityPosition = new MenuEntityPosition(); if(reader["MenuEntityPositionID"] != DBNull.Value) _menuEntityPosition.MenuEntityPositionID = Convert.ToInt32(reader["MenuEntityPositionID"]); if(reader["Name"] != DBNull.Value) _menuEntityPosition.Name = Convert.ToString(reader["Name"]); _menuEntityPosition.NewRecord = false; _menuEntityPositionList.Add(_menuEntityPosition); } reader.Close(); return _menuEntityPositionList; }
public bool Update(MenuEntityPosition menuentityposition ,int old_menuEntityPositionID) { MenuEntityPositionDAC menuentitypositionComponent = new MenuEntityPositionDAC(); return menuentitypositionComponent.UpdateMenuEntityPosition( menuentityposition.MenuEntityPositionID, menuentityposition.Name, old_menuEntityPositionID); }
public bool Insert(MenuEntityPosition menuentityposition) { MenuEntityPositionDAC menuentitypositionComponent = new MenuEntityPositionDAC(); return menuentitypositionComponent.InsertNewMenuEntityPosition( menuentityposition.MenuEntityPositionID, menuentityposition.Name); }