コード例 #1
0
        public static bool UpdatePublisher(string newPublisher)
        {
            bool result = true;

            if (CountPublisher(newPublisher) == 0)
            {
                result = 1 == PublisherAccessor.CreatePublisher(newPublisher, true);
            }

            return(result);
        }
コード例 #2
0
 public Publisher GetPublisherByID(string publisherID)
 {
     try
     {
         Publisher publisher = PublisherAccessor.FetchPublisherByID(publisherID);
         return(publisher);
     }
     catch (Exception)
     {
         throw;
     }
 }
コード例 #3
0
        public static int CountPublisher(string publisher)
        {
            int count = 0;

            try
            {
                count = PublisherAccessor.CountPublisher(publisher);
            }
            catch (Exception)
            {
                throw;
            }

            return(count);
        }
コード例 #4
0
        public static bool ApprovePublisher(string publisher)
        {
            bool result = false;

            try
            {
                PublisherAccessor.ApprovePublisher(publisher);
            }
            catch (Exception)
            {
                throw;
            }

            return(result);
        }
コード例 #5
0
        public static bool VerifyPublisher(string oldPublisher)
        {
            bool result = true;

            if (string.IsNullOrEmpty(oldPublisher))
            {
                return(true);
            }
            if (CountPublisher(oldPublisher) == 0)
            {
                result = 1 == PublisherAccessor.DeletePublisher(oldPublisher);
            }

            return(result);
        }
コード例 #6
0
        public static bool CreatePublisher(string publisher, bool admin = false)
        {
            bool result = false;

            try
            {
                result = 1 == PublisherAccessor.CreatePublisher(publisher, admin);
            }
            catch (Exception)
            {
                throw;
            }

            return(result);
        }
コード例 #7
0
        public static List <string> RetrievePublishers(bool active = true)
        {
            List <string> publishers = null;

            try
            {
                publishers = PublisherAccessor.RetrievePublishers(active);
            }
            catch (Exception)
            {
                throw;
            }

            return(publishers);
        }
コード例 #8
0
        public bool DeletePublisher(Publisher publisher, bool toRestore)
        {
            try
            {
                if (PublisherAccessor.InactivatePublisher(publisher, toRestore))
                {
                    return(true);
                }
            }
            catch (Exception)
            {
                throw;
            }

            return(false);
        }
コード例 #9
0
        public bool EditPublisher(Publisher publisher)
        {
            try
            {
                if (PublisherAccessor.UpdatePublisher(publisher))
                {
                    return(true);
                }
            }
            catch (Exception)
            {
                throw;
            }

            return(false);
        }
コード例 #10
0
        public bool AddNewPublisher(Publisher publisher)
        {
            try
            {
                if (PublisherAccessor.InsertPublisher(publisher))
                {
                    return(true);
                }
            }
            catch (Exception)
            {
                throw;
            }

            return(false);
        }
コード例 #11
0
        public List <Publisher> GetPublisherList(Active group)
        {
            try
            {
                var publisherList = PublisherAccessor.FetchPublisherList(group);

                if (publisherList.Count > 0)
                {
                    return(publisherList);
                }
                else
                {
                    throw new ApplicationException("There were no records found.");
                }
            }
            catch (Exception)
            {
                throw;
            }
        }