コード例 #1
0
ファイル: MultimediaLogic.cs プロジェクト: ramyothman/RBM
 public List<Multimedia> GetAll()
 {
     MultimediaDAC _multimediaComponent = new MultimediaDAC();
      IDataReader reader =  _multimediaComponent.GetAllMultimedia().CreateDataReader();
      List<Multimedia> _multimediaList = new List<Multimedia>();
      while(reader.Read())
      {
      if(_multimediaList == null)
          _multimediaList = new List<Multimedia>();
          Multimedia _multimedia = new Multimedia();
          if(reader["MultimediaID"] != DBNull.Value)
              _multimedia.MultimediaID = Convert.ToInt32(reader["MultimediaID"]);
          if(reader["MultimediaTypeID"] != DBNull.Value)
              _multimedia.MultimediaTypeID = Convert.ToInt32(reader["MultimediaTypeID"]);
          if(reader["Url"] != DBNull.Value)
              _multimedia.Url = Convert.ToString(reader["Url"]);
          if(reader["ThumbnainUrl"] != DBNull.Value)
              _multimedia.ThumbnainUrl = Convert.ToString(reader["ThumbnainUrl"]);
          if(reader["Title"] != DBNull.Value)
              _multimedia.Title = Convert.ToString(reader["Title"]);
          if(reader["Description"] != DBNull.Value)
              _multimedia.Description = Convert.ToString(reader["Description"]);
          if(reader["PublishDate"] != DBNull.Value)
              _multimedia.PublishDate = Convert.ToDateTime(reader["PublishDate"]);
          if(reader["CreatedDate"] != DBNull.Value)
              _multimedia.CreatedDate = Convert.ToDateTime(reader["CreatedDate"]);
      _multimedia.NewRecord = false;
      _multimediaList.Add(_multimedia);
      }             reader.Close();
      return _multimediaList;
 }
コード例 #2
0
ファイル: MultimediaLogic.cs プロジェクト: ramyothman/RBM
 public Multimedia GetByID(int _multimediaID)
 {
     MultimediaDAC _multimediaComponent = new MultimediaDAC();
      IDataReader reader = _multimediaComponent.GetByIDMultimedia(_multimediaID);
      Multimedia _multimedia = null;
      while(reader.Read())
      {
          _multimedia = new Multimedia();
          if(reader["MultimediaID"] != DBNull.Value)
              _multimedia.MultimediaID = Convert.ToInt32(reader["MultimediaID"]);
          if(reader["MultimediaTypeID"] != DBNull.Value)
              _multimedia.MultimediaTypeID = Convert.ToInt32(reader["MultimediaTypeID"]);
          if(reader["Url"] != DBNull.Value)
              _multimedia.Url = Convert.ToString(reader["Url"]);
          if(reader["ThumbnainUrl"] != DBNull.Value)
              _multimedia.ThumbnainUrl = Convert.ToString(reader["ThumbnainUrl"]);
          if(reader["Title"] != DBNull.Value)
              _multimedia.Title = Convert.ToString(reader["Title"]);
          if(reader["Description"] != DBNull.Value)
              _multimedia.Description = Convert.ToString(reader["Description"]);
          if(reader["PublishDate"] != DBNull.Value)
              _multimedia.PublishDate = Convert.ToDateTime(reader["PublishDate"]);
          if(reader["CreatedDate"] != DBNull.Value)
              _multimedia.CreatedDate = Convert.ToDateTime(reader["CreatedDate"]);
      _multimedia.NewRecord = false;             }             reader.Close();
      return _multimedia;
 }
コード例 #3
0
ファイル: MultimediaLogic.cs プロジェクト: ramyothman/RBM
 public bool Insert(Multimedia multimedia)
 {
     int autonumber = 0;
     MultimediaDAC multimediaComponent = new MultimediaDAC();
     bool endedSuccessfuly = multimediaComponent.InsertNewMultimedia( ref autonumber,  multimedia.MultimediaTypeID,  multimedia.Url,  multimedia.ThumbnainUrl,  multimedia.Title,  multimedia.Description,  multimedia.PublishDate,  multimedia.CreatedDate);
     if(endedSuccessfuly)
     {
         multimedia.MultimediaID = autonumber;
     }
     return endedSuccessfuly;
 }
コード例 #4
0
ファイル: MultimediaLogic.cs プロジェクト: ramyothman/RBM
 public bool Update(Multimedia multimedia ,int old_multimediaID)
 {
     MultimediaDAC multimediaComponent = new MultimediaDAC();
     return multimediaComponent.UpdateMultimedia( multimedia.MultimediaTypeID,  multimedia.Url,  multimedia.ThumbnainUrl,  multimedia.Title,  multimedia.Description,  multimedia.PublishDate,  multimedia.CreatedDate,  old_multimediaID);
 }