Exemple #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;
 }
Exemple #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;
 }
Exemple #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;
 }
Exemple #4
0
 public bool Update(CommentStatus commentstatus ,int old_commentStatusId)
 {
     CommentStatusDAC commentstatusComponent = new CommentStatusDAC();
     return commentstatusComponent.UpdateCommentStatus( commentstatus.CommentStatusName,  old_commentStatusId);
 }
Exemple #5
0
        public bool Insert( string CommentStatusName)
        {
            CommentStatusDAC commentstatusComponent = new CommentStatusDAC();
            int CommentStatusId = 0;

            return commentstatusComponent.InsertNewCommentStatus( ref CommentStatusId,  CommentStatusName);
        }
Exemple #6
0
 public void Delete(int Original_CommentStatusId)
 {
     CommentStatusDAC commentstatusComponent = new CommentStatusDAC();
     commentstatusComponent.DeleteCommentStatus(Original_CommentStatusId);
 }
Exemple #7
0
 public int UpdateDataset(System.Data.DataSet dataset)
 {
     CommentStatusDAC commentstatuscomponent = new CommentStatusDAC();
     return commentstatuscomponent.UpdateDataset(dataset);
 }
Exemple #8
0
 public bool Update( string CommentStatusName,  int Original_CommentStatusId)
 {
     CommentStatusDAC commentstatusComponent = new CommentStatusDAC();
     return commentstatusComponent.UpdateCommentStatus( CommentStatusName,  Original_CommentStatusId);
 }