Exemple #1
0
        public bool Insert(string MenuName, int ContentEntityId, string ContentEntityType)
        {
            MenuEntityDAC menuentityComponent = new MenuEntityDAC();
            int           MenuEntityId        = 0;

            return(menuentityComponent.InsertNewMenuEntity(ref MenuEntityId, MenuName, ContentEntityId));
        }
Exemple #2
0
        public List <MenuEntity> GetAll()
        {
            MenuEntityDAC     _menuEntityComponent = new MenuEntityDAC();
            IDataReader       reader          = _menuEntityComponent.GetAllMenuEntity().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["ContentEntityType"] != DBNull.Value)
                {
                    _menuEntity.ContentEntityType = Convert.ToString(reader["ContentEntityType"]);
                }
                _menuEntity.NewRecord = false;
                _menuEntityList.Add(_menuEntity);
            }
            reader.Close();
            return(_menuEntityList);
        }
Exemple #3
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["ContentEntityType"] != DBNull.Value)
                {
                    _menuEntity.ContentEntityType = Convert.ToString(reader["ContentEntityType"]);
                }
                _menuEntity.NewRecord = false;
            }
            reader.Close();
            return(_menuEntity);
        }
Exemple #4
0
        public bool Insert(MenuEntity menuentity)
        {
            int           autonumber          = 0;
            MenuEntityDAC menuentityComponent = new MenuEntityDAC();
            bool          endedSuccessfuly    = menuentityComponent.InsertNewMenuEntity(ref autonumber, menuentity.MenuName, menuentity.ContentEntityId);

            if (endedSuccessfuly)
            {
                menuentity.MenuEntityId = autonumber;
            }
            return(endedSuccessfuly);
        }
Exemple #5
0
        public bool Update(string MenuName, int ContentEntityId, int Original_MenuEntityId)
        {
            MenuEntityDAC menuentityComponent = new MenuEntityDAC();

            return(menuentityComponent.UpdateMenuEntity(MenuName, ContentEntityId, Original_MenuEntityId));
        }
Exemple #6
0
        public bool Update(MenuEntity menuentity, int old_menuEntityId)
        {
            MenuEntityDAC menuentityComponent = new MenuEntityDAC();

            return(menuentityComponent.UpdateMenuEntity(menuentity.MenuName, menuentity.ContentEntityId, old_menuEntityId));
        }
Exemple #7
0
        public int UpdateDataset(System.Data.DataSet dataset)
        {
            MenuEntityDAC menuentitycomponent = new MenuEntityDAC();

            return(menuentitycomponent.UpdateDataset(dataset));
        }
Exemple #8
0
        public void Delete(int Original_MenuEntityId)
        {
            MenuEntityDAC menuentityComponent = new MenuEntityDAC();

            menuentityComponent.DeleteMenuEntity(Original_MenuEntityId);
        }