Exemple #1
0
        public int Insert(Models.DbModels.Boards model)
        {
            try
            {
                _boardRepository.Insert(model);

                return(model.Id);
            }
            catch (Exception ex)
            {
                // Do some logging stuff
                return(-1);
            }
        }
Exemple #2
0
        public bool Update(int id, Models.DbModels.Boards model)
        {
            try
            {
                var board = this.GetByID(id);
                if (!String.IsNullOrEmpty(model.ByName))
                {
                    board.ByName = model.ByName;
                }
                board.IsPublished = model.IsPublished;
                _boardRepository.Update(board);

                return(true);
            }
            catch (Exception ex)
            {
                // Do some logging stuff
                return(false);
            }
        }