示例#1
0
 public bool Insert(PageStatus pagestatus)
 {
     int autonumber = 0;
     PageStatusDAC pagestatusComponent = new PageStatusDAC();
     bool endedSuccessfuly = pagestatusComponent.InsertNewPageStatus( ref autonumber,  pagestatus.Name,  pagestatus.RowGuid,  pagestatus.ModifiedDate);
     if(endedSuccessfuly)
     {
         pagestatus.PageStatusId = autonumber;
     }
     return endedSuccessfuly;
 }
示例#2
0
 public PageStatus GetByID(int _pageStatusId)
 {
     PageStatusDAC _pageStatusComponent = new PageStatusDAC();
      IDataReader reader = _pageStatusComponent.GetByIDPageStatus(_pageStatusId);
      PageStatus _pageStatus = null;
      while(reader.Read())
      {
          _pageStatus = new PageStatus();
          if(reader["PageStatusId"] != DBNull.Value)
              _pageStatus.PageStatusId = Convert.ToInt32(reader["PageStatusId"]);
          if(reader["Name"] != DBNull.Value)
              _pageStatus.Name = Convert.ToString(reader["Name"]);
          if(reader["RowGuid"] != DBNull.Value)
              _pageStatus.RowGuid = new Guid(reader["RowGuid"].ToString());
          if(reader["ModifiedDate"] != DBNull.Value)
              _pageStatus.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
      _pageStatus.NewRecord = false;             }             reader.Close();
      return _pageStatus;
 }
示例#3
0
 public List<PageStatus> GetAll()
 {
     PageStatusDAC _pageStatusComponent = new PageStatusDAC();
      IDataReader reader =  _pageStatusComponent.GetAllPageStatus().CreateDataReader();
      List<PageStatus> _pageStatusList = new List<PageStatus>();
      while(reader.Read())
      {
      if(_pageStatusList == null)
          _pageStatusList = new List<PageStatus>();
          PageStatus _pageStatus = new PageStatus();
          if(reader["PageStatusId"] != DBNull.Value)
              _pageStatus.PageStatusId = Convert.ToInt32(reader["PageStatusId"]);
          if(reader["Name"] != DBNull.Value)
              _pageStatus.Name = Convert.ToString(reader["Name"]);
          if(reader["RowGuid"] != DBNull.Value)
              _pageStatus.RowGuid = new Guid(reader["RowGuid"].ToString());
          if(reader["ModifiedDate"] != DBNull.Value)
              _pageStatus.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
      _pageStatus.NewRecord = false;
      _pageStatusList.Add(_pageStatus);
      }             reader.Close();
      return _pageStatusList;
 }
示例#4
0
 public bool Update(PageStatus pagestatus ,int old_pageStatusId)
 {
     PageStatusDAC pagestatusComponent = new PageStatusDAC();
     return pagestatusComponent.UpdatePageStatus( pagestatus.Name,  pagestatus.RowGuid,  pagestatus.ModifiedDate,  old_pageStatusId);
 }