示例#1
0
 public List<SitePageCategory> GetAllBySitePageId(int SitePageId)
 {
     SitePageCategoryDAC _sitePageCategoryComponent = new SitePageCategoryDAC();
     IDataReader reader = _sitePageCategoryComponent.GetAllSitePageCategory(" SitePageId = " + SitePageId).CreateDataReader();
     List<SitePageCategory> _sitePageCategoryList = new List<SitePageCategory>();
     while (reader.Read())
     {
         if (_sitePageCategoryList == null)
             _sitePageCategoryList = new List<SitePageCategory>();
         SitePageCategory _sitePageCategory = new SitePageCategory();
         if (reader["SitePageCategoryId"] != DBNull.Value)
             _sitePageCategory.SitePageCategoryId = Convert.ToInt32(reader["SitePageCategoryId"]);
         if (reader["SiteCategoryId"] != DBNull.Value)
             _sitePageCategory.SiteCategoryId = Convert.ToInt32(reader["SiteCategoryId"]);
         if (reader["SitePageId"] != DBNull.Value)
             _sitePageCategory.SitePageId = Convert.ToInt32(reader["SitePageId"]);
         if (reader["ModifiedDate"] != DBNull.Value)
             _sitePageCategory.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
         _sitePageCategory.NewRecord = false;
         _sitePageCategoryList.Add(_sitePageCategory);
     } reader.Close();
     return _sitePageCategoryList;
 }
示例#2
0
 public SitePageCategory GetByID(int _sitePageCategoryId)
 {
     SitePageCategoryDAC _sitePageCategoryComponent = new SitePageCategoryDAC();
      IDataReader reader = _sitePageCategoryComponent.GetByIDSitePageCategory(_sitePageCategoryId);
      SitePageCategory _sitePageCategory = null;
      while(reader.Read())
      {
          _sitePageCategory = new SitePageCategory();
          if(reader["SitePageCategoryId"] != DBNull.Value)
              _sitePageCategory.SitePageCategoryId = Convert.ToInt32(reader["SitePageCategoryId"]);
          if(reader["SiteCategoryId"] != DBNull.Value)
              _sitePageCategory.SiteCategoryId = Convert.ToInt32(reader["SiteCategoryId"]);
          if(reader["SitePageId"] != DBNull.Value)
              _sitePageCategory.SitePageId = Convert.ToInt32(reader["SitePageId"]);
          if(reader["ModifiedDate"] != DBNull.Value)
              _sitePageCategory.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
         _sitePageCategory.NewRecord = false;
      }
      reader.Close();
      return _sitePageCategory;
 }
示例#3
0
 public bool Update(SitePageCategory sitepagecategory ,int old_sitePageCategoryId)
 {
     SitePageCategoryDAC sitepagecategoryComponent = new SitePageCategoryDAC();
     return sitepagecategoryComponent.UpdateSitePageCategory( sitepagecategory.SiteCategoryId,  sitepagecategory.SitePageId,  sitepagecategory.ModifiedDate,  old_sitePageCategoryId);
 }
示例#4
0
 public bool Insert(SitePageCategory sitepagecategory)
 {
     int autonumber = 0;
     SitePageCategoryDAC sitepagecategoryComponent = new SitePageCategoryDAC();
     bool endedSuccessfuly = sitepagecategoryComponent.InsertNewSitePageCategory( ref autonumber,  sitepagecategory.SiteCategoryId,  sitepagecategory.SitePageId,  sitepagecategory.ModifiedDate);
     if(endedSuccessfuly)
     {
         sitepagecategory.SitePageCategoryId = autonumber;
     }
     return endedSuccessfuly;
 }