Exemplo n.º 1
0
 public List<MenuEntity> GetAllByDisplayType(string displayType)
 {
     MenuEntityDAC _menuEntityComponent = new MenuEntityDAC();
     IDataReader reader = _menuEntityComponent.GetAllMenuEntity("DisplayType = '" + displayType + "'").CreateDataReader();
     List<MenuEntity> _menuEntityList = new List<MenuEntity>();
     while (reader.Read())
     {
         if (_menuEntityList == null)
             _menuEntityList = new List<MenuEntity>();
         MenuEntity _menuEntity = new MenuEntity();
         if (reader["MenuEntityId"] != DBNull.Value)
             _menuEntity.MenuEntityId = Convert.ToInt32(reader["MenuEntityId"]);
         if (reader["MenuName"] != DBNull.Value)
             _menuEntity.MenuName = Convert.ToString(reader["MenuName"]);
         if (reader["ContentEntityId"] != DBNull.Value)
             _menuEntity.ContentEntityId = Convert.ToInt32(reader["ContentEntityId"]);
         if (reader["DisplayType"] != DBNull.Value)
             _menuEntity.DisplayType = Convert.ToString(reader["DisplayType"]);
         _menuEntity.NewRecord = false;
         _menuEntityList.Add(_menuEntity);
     } reader.Close();
     return _menuEntityList;
 }
Exemplo n.º 2
0
 public MenuEntity GetByID(int _menuEntityId)
 {
     MenuEntityDAC _menuEntityComponent = new MenuEntityDAC();
      IDataReader reader = _menuEntityComponent.GetByIDMenuEntity(_menuEntityId);
      MenuEntity _menuEntity = null;
      while(reader.Read())
      {
          _menuEntity = new MenuEntity();
          if(reader["MenuEntityId"] != DBNull.Value)
              _menuEntity.MenuEntityId = Convert.ToInt32(reader["MenuEntityId"]);
          if(reader["MenuName"] != DBNull.Value)
              _menuEntity.MenuName = Convert.ToString(reader["MenuName"]);
          if(reader["ContentEntityId"] != DBNull.Value)
              _menuEntity.ContentEntityId = Convert.ToInt32(reader["ContentEntityId"]);
          if (reader["DisplayType"] != DBNull.Value)
              _menuEntity.DisplayType = Convert.ToString(reader["DisplayType"]);
      _menuEntity.NewRecord = false;             }             reader.Close();
      return _menuEntity;
 }
Exemplo n.º 3
0
 public void Delete(int Original_MenuEntityId)
 {
     MenuEntityDAC menuentityComponent = new MenuEntityDAC();
     menuentityComponent.DeleteMenuEntity(Original_MenuEntityId);
 }
Exemplo n.º 4
0
 public int UpdateDataset(System.Data.DataSet dataset)
 {
     MenuEntityDAC menuentitycomponent = new MenuEntityDAC();
     return menuentitycomponent.UpdateDataset(dataset);
 }
Exemplo n.º 5
0
 public bool Update( string MenuName,  int ContentEntityId, string DisplayType,  int Original_MenuEntityId)
 {
     MenuEntityDAC menuentityComponent = new MenuEntityDAC();
     return menuentityComponent.UpdateMenuEntity( MenuName,  ContentEntityId, DisplayType,  Original_MenuEntityId);
 }
Exemplo n.º 6
0
 public bool Update(MenuEntity menuentity ,int old_menuEntityId)
 {
     MenuEntityDAC menuentityComponent = new MenuEntityDAC();
     return menuentityComponent.UpdateMenuEntity( menuentity.MenuName,  menuentity.ContentEntityId, menuentity.DisplayType,  old_menuEntityId);
 }
Exemplo n.º 7
0
        public bool Insert( string MenuName,  int ContentEntityId,string DisplayType)
        {
            MenuEntityDAC menuentityComponent = new MenuEntityDAC();
            int MenuEntityId = 0;

            return menuentityComponent.InsertNewMenuEntity( ref MenuEntityId,  MenuName,  ContentEntityId, DisplayType);
        }
Exemplo n.º 8
0
 public bool Insert(MenuEntity menuentity)
 {
     int autonumber = 0;
     MenuEntityDAC menuentityComponent = new MenuEntityDAC();
     bool endedSuccessfuly = menuentityComponent.InsertNewMenuEntity( ref autonumber,  menuentity.MenuName,  menuentity.ContentEntityId, menuentity.DisplayType);
     if(endedSuccessfuly)
     {
         menuentity.MenuEntityId = autonumber;
     }
     return endedSuccessfuly;
 }