public bool Insert(string CommentTypeName) { CommentTypeDAC commenttypeComponent = new CommentTypeDAC(); int CommentTypeId = 0; return(commenttypeComponent.InsertNewCommentType(ref CommentTypeId, CommentTypeName)); }
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); }
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); }
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); }
public void Delete(int Original_CommentTypeId) { CommentTypeDAC commenttypeComponent = new CommentTypeDAC(); commenttypeComponent.DeleteCommentType(Original_CommentTypeId); }
public bool Update(string CommentTypeName, int Original_CommentTypeId) { CommentTypeDAC commenttypeComponent = new CommentTypeDAC(); return(commenttypeComponent.UpdateCommentType(CommentTypeName, Original_CommentTypeId)); }
public bool Update(CommentType commenttype, int old_commentTypeId) { CommentTypeDAC commenttypeComponent = new CommentTypeDAC(); return(commenttypeComponent.UpdateCommentType(commenttype.CommentTypeName, old_commentTypeId)); }
public int UpdateDataset(System.Data.DataSet dataset) { CommentTypeDAC commenttypecomponent = new CommentTypeDAC(); return(commenttypecomponent.UpdateDataset(dataset)); }