示例#1
0
 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;
 }
示例#2
0
 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;
 }
示例#3
0
 public bool Update(MenuEntityPosition menuentityposition ,int old_menuEntityPositionID)
 {
     MenuEntityPositionDAC menuentitypositionComponent = new MenuEntityPositionDAC();
     return menuentitypositionComponent.UpdateMenuEntityPosition( menuentityposition.MenuEntityPositionID,  menuentityposition.Name,  old_menuEntityPositionID);
 }
示例#4
0
 public bool Insert(MenuEntityPosition menuentityposition)
 {
     MenuEntityPositionDAC menuentitypositionComponent = new MenuEntityPositionDAC();
     return menuentitypositionComponent.InsertNewMenuEntityPosition( menuentityposition.MenuEntityPositionID,  menuentityposition.Name);
 }