Exemplo n.º 1
0
        public static DataTable AdminGetArticles(Int32 VolumeIssueId)
        {
            try
            {
                return(ArticleQueryHelper.AdminGetArticles(VolumeIssueId));
            }
            catch (SqlException sqlEx)
            {
                Console.WriteLine(sqlEx.ToString());

                throw new DataException("An exception occured getting all articles.", sqlEx);
            }
        }
Exemplo n.º 2
0
        public static Article AdminGetArticle(Int32 ArticleId)
        {
            Article art = new Article();

            try
            {
                DataSet articleSet = ArticleQueryHelper.AdminGetArticle(ArticleId);

                if (articleSet.Tables.Count == 2)
                {
                    //Get the issue details
                    if (articleSet.Tables[0].Rows.Count > 0)
                    {
                        DataRow artRow = articleSet.Tables[0].Rows[0];

                        art.ArticleId = (Int32)artRow["ArticleId"];

                        art.Title = (string)artRow["Title"];

                        art.Authors = (string)artRow["Authors"];

                        art.Keywords = (string)artRow["Keywords"];

                        art.PageNumber = (Int32)artRow["PageNumber"];

                        art.IsActive = (bool)artRow["Active"];
                    }

                    //Get the documents
                    if (articleSet.Tables[1].Rows.Count > 0)
                    {
                        ArticleDocument artDoc;

                        art.Documents = new List <ArticleDocument>();

                        foreach (DataRow docRow in articleSet.Tables[1].Rows)
                        {
                            artDoc = new ArticleDocument();

                            artDoc.DocId = (Int32)docRow["DocId"];

                            artDoc.FullFileName = (string)docRow["FileName"];

                            artDoc.ArtDocTypeDescription = (string)docRow["ArtDocTypeDescription"];

                            artDoc.ArtDocTypeId = (Int32)docRow["ArtDocTypeId"];

                            artDoc.IsActive = (bool)docRow["Active"];

                            artDoc.IsNew = false;

                            art.Documents.Add(artDoc);
                        }
                    }
                }

                return(art);
            }
            catch (SqlException sqlEx)
            {
                Console.WriteLine(sqlEx.ToString());

                throw new DataException("An exception occured getting the article details.", sqlEx);
            }
        }