Exemple #1
0
        public bool Insert(string CommentTypeName)
        {
            CommentTypeDAC commenttypeComponent = new CommentTypeDAC();
            int            CommentTypeId        = 0;

            return(commenttypeComponent.InsertNewCommentType(ref CommentTypeId, CommentTypeName));
        }
Exemple #2
0
        public List <CommentType> GetAll()
        {
            CommentTypeDAC     _commentTypeComponent = new CommentTypeDAC();
            IDataReader        reader           = _commentTypeComponent.GetAllCommentType().CreateDataReader();
            List <CommentType> _commentTypeList = new List <CommentType>();

            while (reader.Read())
            {
                if (_commentTypeList == null)
                {
                    _commentTypeList = new List <CommentType>();
                }
                CommentType _commentType = new CommentType();
                if (reader["CommentTypeId"] != DBNull.Value)
                {
                    _commentType.CommentTypeId = Convert.ToInt32(reader["CommentTypeId"]);
                }
                if (reader["CommentTypeName"] != DBNull.Value)
                {
                    _commentType.CommentTypeName = Convert.ToString(reader["CommentTypeName"]);
                }
                _commentType.NewRecord = false;
                _commentTypeList.Add(_commentType);
            }
            reader.Close();
            return(_commentTypeList);
        }
Exemple #3
0
        public bool Insert(CommentType commenttype)
        {
            int            autonumber           = 0;
            CommentTypeDAC commenttypeComponent = new CommentTypeDAC();
            bool           endedSuccessfuly     = commenttypeComponent.InsertNewCommentType(ref autonumber, commenttype.CommentTypeName);

            if (endedSuccessfuly)
            {
                commenttype.CommentTypeId = autonumber;
            }
            return(endedSuccessfuly);
        }
Exemple #4
0
        public CommentType GetByID(int _commentTypeId)
        {
            CommentTypeDAC _commentTypeComponent = new CommentTypeDAC();
            IDataReader    reader       = _commentTypeComponent.GetByIDCommentType(_commentTypeId);
            CommentType    _commentType = null;

            while (reader.Read())
            {
                _commentType = new CommentType();
                if (reader["CommentTypeId"] != DBNull.Value)
                {
                    _commentType.CommentTypeId = Convert.ToInt32(reader["CommentTypeId"]);
                }
                if (reader["CommentTypeName"] != DBNull.Value)
                {
                    _commentType.CommentTypeName = Convert.ToString(reader["CommentTypeName"]);
                }
                _commentType.NewRecord = false;
            }
            reader.Close();
            return(_commentType);
        }
Exemple #5
0
        public void Delete(int Original_CommentTypeId)
        {
            CommentTypeDAC commenttypeComponent = new CommentTypeDAC();

            commenttypeComponent.DeleteCommentType(Original_CommentTypeId);
        }
Exemple #6
0
        public bool Update(string CommentTypeName, int Original_CommentTypeId)
        {
            CommentTypeDAC commenttypeComponent = new CommentTypeDAC();

            return(commenttypeComponent.UpdateCommentType(CommentTypeName, Original_CommentTypeId));
        }
Exemple #7
0
        public bool Update(CommentType commenttype, int old_commentTypeId)
        {
            CommentTypeDAC commenttypeComponent = new CommentTypeDAC();

            return(commenttypeComponent.UpdateCommentType(commenttype.CommentTypeName, old_commentTypeId));
        }
Exemple #8
0
        public int UpdateDataset(System.Data.DataSet dataset)
        {
            CommentTypeDAC commenttypecomponent = new CommentTypeDAC();

            return(commenttypecomponent.UpdateDataset(dataset));
        }