public static bool UpdatePublisher(string newPublisher) { bool result = true; if (CountPublisher(newPublisher) == 0) { result = 1 == PublisherAccessor.CreatePublisher(newPublisher, true); } return(result); }
public Publisher GetPublisherByID(string publisherID) { try { Publisher publisher = PublisherAccessor.FetchPublisherByID(publisherID); return(publisher); } catch (Exception) { throw; } }
public static int CountPublisher(string publisher) { int count = 0; try { count = PublisherAccessor.CountPublisher(publisher); } catch (Exception) { throw; } return(count); }
public static bool ApprovePublisher(string publisher) { bool result = false; try { PublisherAccessor.ApprovePublisher(publisher); } catch (Exception) { throw; } return(result); }
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); }
public static bool CreatePublisher(string publisher, bool admin = false) { bool result = false; try { result = 1 == PublisherAccessor.CreatePublisher(publisher, admin); } catch (Exception) { throw; } return(result); }
public static List <string> RetrievePublishers(bool active = true) { List <string> publishers = null; try { publishers = PublisherAccessor.RetrievePublishers(active); } catch (Exception) { throw; } return(publishers); }
public bool DeletePublisher(Publisher publisher, bool toRestore) { try { if (PublisherAccessor.InactivatePublisher(publisher, toRestore)) { return(true); } } catch (Exception) { throw; } return(false); }
public bool EditPublisher(Publisher publisher) { try { if (PublisherAccessor.UpdatePublisher(publisher)) { return(true); } } catch (Exception) { throw; } return(false); }
public bool AddNewPublisher(Publisher publisher) { try { if (PublisherAccessor.InsertPublisher(publisher)) { return(true); } } catch (Exception) { throw; } return(false); }
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; } }