コード例 #1
0
ファイル: SiteSectionLogic.cs プロジェクト: ramyothman/RBM
 public List<SiteSection> GetAll()
 {
     SiteSectionDAC _siteSectionComponent = new SiteSectionDAC();
      IDataReader reader =  _siteSectionComponent.GetAllSiteSection().CreateDataReader();
      List<SiteSection> _siteSectionList = new List<SiteSection>();
      while(reader.Read())
      {
      if(_siteSectionList == null)
          _siteSectionList = new List<SiteSection>();
          SiteSection _siteSection = new SiteSection();
          if(reader["SiteSectionId"] != DBNull.Value)
              _siteSection.SiteSectionId = Convert.ToInt32(reader["SiteSectionId"]);
          if(reader["Name"] != DBNull.Value)
              _siteSection.Name = Convert.ToString(reader["Name"]);
          if(reader["SiteSectionParentId"] != DBNull.Value)
              _siteSection.SiteSectionParentId = Convert.ToInt32(reader["SiteSectionParentId"]);
          if(reader["SectionStatusId"] != DBNull.Value)
              _siteSection.SectionStatusId = Convert.ToInt32(reader["SectionStatusId"]);
          if(reader["SiteId"] != DBNull.Value)
              _siteSection.SiteId = Convert.ToInt32(reader["SiteId"]);
          if(reader["PersonId"] != DBNull.Value)
              _siteSection.PersonId = Convert.ToInt32(reader["PersonId"]);
          if(reader["SecurityAccessTypeId"] != DBNull.Value)
              _siteSection.SecurityAccessTypeId = Convert.ToInt32(reader["SecurityAccessTypeId"]);
          if(reader["RowGuid"] != DBNull.Value)
              _siteSection.RowGuid = new Guid(reader["RowGuid"].ToString());
          if(reader["ModifiedDate"] != DBNull.Value)
              _siteSection.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
          if (reader["Alias"] != DBNull.Value)
              _siteSection.Alias = Convert.ToString(reader["Alias"]);
      _siteSection.NewRecord = false;
      _siteSectionList.Add(_siteSection);
      }             reader.Close();
      return _siteSectionList;
 }
コード例 #2
0
ファイル: ArticleLogic.cs プロジェクト: ramyothman/RBM
        public List<Article> GetAllArticles(string LanguageID)
        {
            ArticleDAC _articleComponent = new ArticleDAC();
            string whereCondition = "";

            IDataReader reader = _articleComponent.ViewAllArticles("LanguageID = " + LanguageID).CreateDataReader();
            List<Article> _articleList = new List<Article>();
            while (reader.Read())
            {
                if (_articleList == null)
                    _articleList = new List<Article>();
                Article _article = new Article();
                #region Article Information

                if (reader["ArticleId"] != DBNull.Value)
                    _article.ArticleId = Convert.ToInt32(reader["ArticleId"]);
                if (reader["SiteSectionId"] != DBNull.Value)
                    _article.SiteSectionId = Convert.ToInt32(reader["SiteSectionId"]);
                if (reader["CreatorId"] != DBNull.Value)
                    _article.CreatorId = Convert.ToInt32(reader["CreatorId"]);
                if (reader["ArticleStatusId"] != DBNull.Value)
                    _article.ArticleStatusId = Convert.ToInt32(reader["ArticleStatusId"]);
                if (reader["AuthorId"] != DBNull.Value)
                    _article.AuthorId = Convert.ToInt32(reader["AuthorId"]);
                if (reader["PostDate"] != DBNull.Value)
                    _article.PostDate = Convert.ToDateTime(reader["PostDate"]);
                if (reader["AllowLanguageSpecificTags"] != DBNull.Value)
                    _article.AllowLanguageSpecificTags = Convert.ToBoolean(reader["AllowLanguageSpecificTags"]);
                if (reader["RowGuid"] != DBNull.Value)
                    _article.RowGuid = new Guid(reader["RowGuid"].ToString());
                if (reader["ModifiedDate"] != DBNull.Value)
                    _article.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
                if (reader["CommentsTypeId"] != DBNull.Value)
                    _article.CommentsTypeId = Convert.ToInt32(reader["CommentsTypeId"]);
                if (reader["EnableModeteration"] != DBNull.Value)
                    _article.EnableModeteration = Convert.ToBoolean(reader["EnableModeteration"]);
                if (reader["SiteId"] != DBNull.Value)
                    _article.SiteId = Convert.ToInt32(reader["SiteId"]);
                if (reader["ArticleTypeID"] != DBNull.Value)
                    _article.ArticleTypeID = Convert.ToInt32(reader["ArticleTypeID"]);
                if (reader["ViewsCount"] != DBNull.Value)
                    _article.ViewsCount = Convert.ToInt32(reader["ViewsCount"]);
                if (reader["CommentsCount"] != DBNull.Value)
                    _article.CommentsCount = Convert.ToInt32(reader["CommentsCount"]);
                if (reader["CreatorName"] != DBNull.Value)
                    _article.CreatorName = Convert.ToString(reader["CreatorName"].ToString());
                _article.NewRecord = false;
                #endregion

                #region Article Languages
                List<ArticleLanguage> _articleLanguageList = new List<ArticleLanguage>();

                ArticleLanguage _articleLanguage = new ArticleLanguage();
                if (reader["ArticleLanguageId"] != DBNull.Value)
                    _articleLanguage.ArticleLanguageId = Convert.ToInt32(reader["ArticleLanguageId"]);

                if (reader["ArticleId"] != DBNull.Value)
                    _articleLanguage.ArticleId = Convert.ToInt32(reader["ArticleId"]);
                if (reader["LanguageId"] != DBNull.Value)
                    _articleLanguage.LanguageId = Convert.ToInt32(reader["LanguageId"]);
                if (reader["ArticleName"] != DBNull.Value)
                    _articleLanguage.ArticleName = Convert.ToString(reader["ArticleName"]);
                if (reader["ArticleContent"] != DBNull.Value)
                    _articleLanguage.ArticleContent = Convert.ToString(reader["ArticleContent"]);
                if (reader["ArticleAttachment"] != DBNull.Value)
                    _articleLanguage.ArticleAttachment = Convert.ToString(reader["ArticleAttachment"]);
                if (reader["AuthorAlias"] != DBNull.Value)
                    _articleLanguage.AuthorAlias = Convert.ToString(reader["AuthorAlias"]);
                if (reader["ArticleAlias"] != DBNull.Value)
                    _articleLanguage.ArticleAlias = Convert.ToString(reader["ArticleAlias"]);
                if (reader["LanguagePostDate"] != DBNull.Value)
                    _articleLanguage.PostDate = Convert.ToDateTime(reader["LanguagePostDate"]);
                if (reader["PublishStartDate"] != DBNull.Value)
                    _articleLanguage.PublishStartDate = Convert.ToDateTime(reader["PublishStartDate"]);
                if (reader["PublishEndDate"] != DBNull.Value)
                    _articleLanguage.PublishEndDate = Convert.ToDateTime(reader["PublishEndDate"]);
                if (reader["RevisionDate"] != DBNull.Value)
                    _articleLanguage.RevisionDate = Convert.ToDateTime(reader["RevisionDate"]);
                if (reader["ModifiedDate"] != DBNull.Value)
                    _articleLanguage.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
                if (reader["ArticleSummary"] != DBNull.Value)
                    _articleLanguage.ArticleSummary = Convert.ToString(reader["ArticleSummary"]);
                if (reader["ArticleSubTitle"] != DBNull.Value)
                    _articleLanguage.ArticleSubTitle = Convert.ToString(reader["ArticleSubTitle"]);
                if (reader["ArticleShortTitle"] != DBNull.Value)
                    _articleLanguage.ArticleShortTitle = Convert.ToString(reader["ArticleShortTitle"]);
                _articleLanguage.NewRecord = false;
                _articleLanguageList.Add(_articleLanguage);
                #endregion

                #region Article Section

                SiteSection _siteSection = new SiteSection();
                if (reader["SiteSectionId"] != DBNull.Value)
                    _siteSection.SiteSectionId = Convert.ToInt32(reader["SiteSectionId"]);
                if (reader["SiteSectionName"] != DBNull.Value)
                    _siteSection.Name = Convert.ToString(reader["SiteSectionName"]);
                if (reader["SiteSectionParentId"] != DBNull.Value)
                    _siteSection.SiteSectionParentId = Convert.ToInt32(reader["SiteSectionParentId"]);
                if (reader["SectionStatusId"] != DBNull.Value)
                    _siteSection.SectionStatusId = Convert.ToInt32(reader["SectionStatusId"]);
                if (reader["SiteId"] != DBNull.Value)
                    _siteSection.SiteId = Convert.ToInt32(reader["SiteId"]);
                if (reader["PersonId"] != DBNull.Value)
                    _siteSection.PersonId = Convert.ToInt32(reader["PersonId"]);
                if (reader["SecurityAccessTypeId"] != DBNull.Value)
                    _siteSection.SecurityAccessTypeId = Convert.ToInt32(reader["SecurityAccessTypeId"]);

                _siteSection.NewRecord = false;
                _article.CurrentSection = _siteSection;
                #endregion

                #region Article Type
                ArticleType _articleType = new ArticleType();
                if (reader["ArticleTypeID"] != DBNull.Value)
                    _articleType.ArticleTypeID = Convert.ToInt32(reader["ArticleTypeID"]);
                if (reader["ArticleTypeName"] != DBNull.Value)
                    _articleType.Name = Convert.ToString(reader["ArticleTypeName"]);
                if (reader["ArticleTypeCode"] != DBNull.Value)
                    _articleType.Code = Convert.ToString(reader["ArticleTypeCode"]);
                #endregion

                #region Author Information
                BusinessLogicLayer.Entities.Persons.Person _person = new Entities.Persons.Person();
                if (reader["AuthorId"] != DBNull.Value)
                    _person.BusinessEntityId = Convert.ToInt32(reader["AuthorId"]);
                if (reader["NameStyle"] != DBNull.Value)
                    _person.NameStyle = Convert.ToBoolean(reader["NameStyle"]);
                if (reader["PersonImage"] != DBNull.Value)
                    _person.PersonImage = Convert.ToString(reader["PersonImage"]);
                BusinessLogicLayer.Entities.Persons.PersonLanguages _personLanguages = new BusinessLogicLayer.Entities.Persons.PersonLanguages();
                if (reader["PersonLanguageId"] != DBNull.Value)
                    _personLanguages.PersonLanguageId = Convert.ToInt32(reader["PersonLanguageId"]);
                if (reader["AuthorId"] != DBNull.Value)
                    _personLanguages.PersonId = Convert.ToInt32(reader["AuthorId"]);
                if (reader["LanguageId"] != DBNull.Value)
                    _personLanguages.LanguageId = Convert.ToInt32(reader["LanguageId"]);
                if (reader["Title"] != DBNull.Value)
                    _personLanguages.Title = Convert.ToString(reader["Title"]);
                if (reader["FirstName"] != DBNull.Value)
                    _personLanguages.FirstName = Convert.ToString(reader["FirstName"]);
                if (reader["MiddleName"] != DBNull.Value)
                    _personLanguages.MiddleName = Convert.ToString(reader["MiddleName"]);
                if (reader["LastName"] != DBNull.Value)
                    _personLanguages.LastName = Convert.ToString(reader["LastName"]);
                if (reader["Suffix"] != DBNull.Value)
                    _personLanguages.Suffix = Convert.ToString(reader["Suffix"]);
                if (reader["DisplayName"] != DBNull.Value)
                    _personLanguages.DisplayName = Convert.ToString(reader["DisplayName"]);
                _person.PersonLanguages = new List<Entities.Persons.PersonLanguages>();
                _person.PersonLanguages.Add(_personLanguages);
                _article.Author = _person;
                #endregion

                _article.CurrentArticleLanguage = _articleLanguageList;
                _articleList.Add(_article);
            } reader.Close();
            return _articleList;
        }
コード例 #3
0
ファイル: SiteSectionLogic.cs プロジェクト: ramyothman/RBM
 public bool Insert(SiteSection sitesection)
 {
     SiteSectionDAC sitesectionComponent = new SiteSectionDAC();
     return sitesectionComponent.InsertNewSiteSection( sitesection.SiteSectionId,  sitesection.Name,  sitesection.SiteSectionParentId,  sitesection.SectionStatusId,  sitesection.SiteId,  sitesection.PersonId,  sitesection.SecurityAccessTypeId,  sitesection.RowGuid,  sitesection.ModifiedDate,sitesection.Alias);
 }
コード例 #4
0
ファイル: SiteSectionLogic.cs プロジェクト: ramyothman/RBM
 public bool Update(SiteSection sitesection ,int old_siteSectionId)
 {
     SiteSectionDAC sitesectionComponent = new SiteSectionDAC();
     return sitesectionComponent.UpdateSiteSection( sitesection.SiteSectionId,  sitesection.Name,  sitesection.SiteSectionParentId,  sitesection.SectionStatusId,  sitesection.SiteId,  sitesection.PersonId,  sitesection.SecurityAccessTypeId,  sitesection.RowGuid,  sitesection.ModifiedDate, sitesection.Alias,  old_siteSectionId);
 }
コード例 #5
0
ファイル: SiteSectionLogic.cs プロジェクト: ramyothman/RBM
 public SiteSection GetByID(int _siteSectionId)
 {
     SiteSectionDAC _siteSectionComponent = new SiteSectionDAC();
      IDataReader reader = _siteSectionComponent.GetByIDSiteSection(_siteSectionId);
      SiteSection _siteSection = null;
      while(reader.Read())
      {
          _siteSection = new SiteSection();
          if(reader["SiteSectionId"] != DBNull.Value)
              _siteSection.SiteSectionId = Convert.ToInt32(reader["SiteSectionId"]);
          if(reader["Name"] != DBNull.Value)
              _siteSection.Name = Convert.ToString(reader["Name"]);
          if(reader["SiteSectionParentId"] != DBNull.Value)
              _siteSection.SiteSectionParentId = Convert.ToInt32(reader["SiteSectionParentId"]);
          if(reader["SectionStatusId"] != DBNull.Value)
              _siteSection.SectionStatusId = Convert.ToInt32(reader["SectionStatusId"]);
          if(reader["SiteId"] != DBNull.Value)
              _siteSection.SiteId = Convert.ToInt32(reader["SiteId"]);
          if(reader["PersonId"] != DBNull.Value)
              _siteSection.PersonId = Convert.ToInt32(reader["PersonId"]);
          if(reader["SecurityAccessTypeId"] != DBNull.Value)
              _siteSection.SecurityAccessTypeId = Convert.ToInt32(reader["SecurityAccessTypeId"]);
          if(reader["RowGuid"] != DBNull.Value)
              _siteSection.RowGuid = new Guid(reader["RowGuid"].ToString());
          if(reader["ModifiedDate"] != DBNull.Value)
              _siteSection.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
          if (reader["Alias"] != DBNull.Value)
              _siteSection.Alias = Convert.ToString(reader["Alias"]);
      _siteSection.NewRecord = false;             }             reader.Close();
      return _siteSection;
 }