Esempio n. 1
0
        public static Issue AdminGetIssue(Int32 VolumeIssueId)
        {
            Issue issue = new Issue();

            try
            {
                DataSet issueSet = IssueQueryHelper.AdminGetIssue(VolumeIssueId);

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

                        issue.IssueId = (Int32)issRow["IssueId"];

                        issue.IssueName = (string)issRow["IssueName"];

                        issue.IsActive = (bool)issRow["Active"];
                    }

                    //Get the documents
                    if (issueSet.Tables[1].Rows.Count > 0)
                    {
                        IssueDocument issDoc;

                        issue.Documents = new List <IssueDocument>();

                        foreach (DataRow docRow in issueSet.Tables[1].Rows)
                        {
                            issDoc = new IssueDocument();

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

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

                            issDoc.IssueDocTypeDescription = (string)docRow["IssueDocTypeDescription"];

                            issDoc.IssueDocTypeId = (Int32)docRow["IssueDocTypeId"];

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

                            issDoc.IsNew = false;

                            issue.Documents.Add(issDoc);
                        }
                    }
                }

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

                throw new DataException("An exception occured getting the issue details.", sqlEx);
            }
        }
Esempio n. 2
0
        public static IssueArchive GetActiveIssues(Int32 VolumeId)
        {
            IssueArchive issArch = new IssueArchive();

            try
            {
                DataSet issueSet = IssueQueryHelper.GetActiveIssues(VolumeId);

                if (issueSet.Tables.Count == 2)
                {
                    List <Issue> issueList = new List <Issue>();

                    Volume vol;

                    Issue issue;

                    //Get the volume Name
                    if (issueSet.Tables[0].Rows.Count > 0)
                    {
                        vol = new Volume();

                        vol.VolumeName = (string)issueSet.Tables[0].Rows[0]["VolumeName"];

                        vol.VolumeYear = (string)issueSet.Tables[0].Rows[0]["VolumeYear"];

                        issArch.VolumeDto = vol;
                    }

                    //Get the issues
                    if (issueSet.Tables[1].Rows.Count > 0)
                    {
                        foreach (DataRow dr in issueSet.Tables[1].Rows)
                        {
                            issue = new Issue();

                            issue.VolumeIssueId = (Int32)dr["VolumeIssueId"];

                            issue.IssueName = (string)dr["IssueName"];

                            issueList.Add(issue);
                        }
                        issArch.IssueList = issueList;
                    }
                }

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

                throw new DataException("An exception occured getting the issue list.", sqlEx);
            }
        }
Esempio n. 3
0
        public static DataTable AdminGetIssues(Int32 VolumeId)
        {
            try
            {
                return(IssueQueryHelper.AdminGetIssues(VolumeId));
            }
            catch (SqlException sqlEx)
            {
                Console.WriteLine(sqlEx.ToString());

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