Exemplo n.º 1
0
 public bool Insert(CommentStatus commentstatus)
 {
     int autonumber = 0;
     CommentStatusDAC commentstatusComponent = new CommentStatusDAC();
     bool endedSuccessfuly = commentstatusComponent.InsertNewCommentStatus( ref autonumber,  commentstatus.CommentStatusName);
     if(endedSuccessfuly)
     {
         commentstatus.CommentStatusId = autonumber;
     }
     return endedSuccessfuly;
 }
Exemplo n.º 2
0
 public CommentStatus GetByID(int _commentStatusId)
 {
     CommentStatusDAC _commentStatusComponent = new CommentStatusDAC();
      IDataReader reader = _commentStatusComponent.GetByIDCommentStatus(_commentStatusId);
      CommentStatus _commentStatus = null;
      while(reader.Read())
      {
          _commentStatus = new CommentStatus();
          if(reader["CommentStatusId"] != DBNull.Value)
              _commentStatus.CommentStatusId = Convert.ToInt32(reader["CommentStatusId"]);
          if(reader["CommentStatusName"] != DBNull.Value)
              _commentStatus.CommentStatusName = Convert.ToString(reader["CommentStatusName"]);
      _commentStatus.NewRecord = false;             }             reader.Close();
      return _commentStatus;
 }
Exemplo n.º 3
0
 public List<CommentStatus> GetAll()
 {
     CommentStatusDAC _commentStatusComponent = new CommentStatusDAC();
      IDataReader reader =  _commentStatusComponent.GetAllCommentStatus().CreateDataReader();
      List<CommentStatus> _commentStatusList = new List<CommentStatus>();
      while(reader.Read())
      {
      if(_commentStatusList == null)
          _commentStatusList = new List<CommentStatus>();
          CommentStatus _commentStatus = new CommentStatus();
          if(reader["CommentStatusId"] != DBNull.Value)
              _commentStatus.CommentStatusId = Convert.ToInt32(reader["CommentStatusId"]);
          if(reader["CommentStatusName"] != DBNull.Value)
              _commentStatus.CommentStatusName = Convert.ToString(reader["CommentStatusName"]);
      _commentStatus.NewRecord = false;
      _commentStatusList.Add(_commentStatus);
      }             reader.Close();
      return _commentStatusList;
 }
Exemplo n.º 4
0
 public bool Update(CommentStatus commentstatus ,int old_commentStatusId)
 {
     CommentStatusDAC commentstatusComponent = new CommentStatusDAC();
     return commentstatusComponent.UpdateCommentStatus( commentstatus.CommentStatusName,  old_commentStatusId);
 }