コード例 #1
0
ファイル: ArticleStatusLogic.cs プロジェクト: ramyothman/RBM
 public bool Insert(ArticleStatus articlestatus)
 {
     int autonumber = 0;
     ArticleStatusDAC articlestatusComponent = new ArticleStatusDAC();
     bool endedSuccessfuly = articlestatusComponent.InsertNewArticleStatus( ref autonumber,  articlestatus.Name,  articlestatus.RowGuid,  articlestatus.ModifiedDate);
     if(endedSuccessfuly)
     {
         articlestatus.ArticleStatusId = autonumber;
     }
     return endedSuccessfuly;
 }
コード例 #2
0
ファイル: ArticleStatusLogic.cs プロジェクト: ramyothman/RBM
 public ArticleStatus GetByID(int _articleStatusId)
 {
     ArticleStatusDAC _articleStatusComponent = new ArticleStatusDAC();
      IDataReader reader = _articleStatusComponent.GetByIDArticleStatus(_articleStatusId);
      ArticleStatus _articleStatus = null;
      while(reader.Read())
      {
          _articleStatus = new ArticleStatus();
          if(reader["ArticleStatusId"] != DBNull.Value)
              _articleStatus.ArticleStatusId = Convert.ToInt32(reader["ArticleStatusId"]);
          if(reader["Name"] != DBNull.Value)
              _articleStatus.Name = Convert.ToString(reader["Name"]);
          if(reader["RowGuid"] != DBNull.Value)
              _articleStatus.RowGuid = new Guid(reader["RowGuid"].ToString());
          if(reader["ModifiedDate"] != DBNull.Value)
              _articleStatus.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
      _articleStatus.NewRecord = false;             }             reader.Close();
      return _articleStatus;
 }
コード例 #3
0
ファイル: ArticleStatusLogic.cs プロジェクト: ramyothman/RBM
 public List<ArticleStatus> GetAll()
 {
     ArticleStatusDAC _articleStatusComponent = new ArticleStatusDAC();
      IDataReader reader =  _articleStatusComponent.GetAllArticleStatus().CreateDataReader();
      List<ArticleStatus> _articleStatusList = new List<ArticleStatus>();
      while(reader.Read())
      {
      if(_articleStatusList == null)
          _articleStatusList = new List<ArticleStatus>();
          ArticleStatus _articleStatus = new ArticleStatus();
          if(reader["ArticleStatusId"] != DBNull.Value)
              _articleStatus.ArticleStatusId = Convert.ToInt32(reader["ArticleStatusId"]);
          if(reader["Name"] != DBNull.Value)
              _articleStatus.Name = Convert.ToString(reader["Name"]);
          if(reader["RowGuid"] != DBNull.Value)
              _articleStatus.RowGuid = new Guid(reader["RowGuid"].ToString());
          if(reader["ModifiedDate"] != DBNull.Value)
              _articleStatus.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
      _articleStatus.NewRecord = false;
      _articleStatusList.Add(_articleStatus);
      }             reader.Close();
      return _articleStatusList;
 }
コード例 #4
0
ファイル: ArticleStatusLogic.cs プロジェクト: ramyothman/RBM
 public bool Update(ArticleStatus articlestatus ,int old_articleStatusId)
 {
     ArticleStatusDAC articlestatusComponent = new ArticleStatusDAC();
     return articlestatusComponent.UpdateArticleStatus( articlestatus.Name,  articlestatus.RowGuid,  articlestatus.ModifiedDate,  old_articleStatusId);
 }