예제 #1
0
 public static MasterDataSet.WebsiteDataTable GetWebsites()
 {
     using (WebsiteTableAdapter adapter = new WebsiteTableAdapter())
     {
         return(adapter.GetWebsites());
     }
 }
예제 #2
0
 /// <summary>
 /// Returns the identifier of the web site that the specified organization is associated with.
 /// </summary>
 /// <param name="organizationId">The unique identifier of the organization.</param>
 /// <returns>The unique identifier of the web site if it's found; otherwise, System.Guid.Empty.</returns>
 internal static Guid GetWebsiteIdByOrganizationId(Guid organizationId)
 {
     using (WebsiteTableAdapter adapter = new WebsiteTableAdapter())
     {
         MasterDataSet.WebsiteDataTable table = adapter.GetWebsiteByOrganizationId(organizationId);
         return((table.Count > 0) ? table[0].WebsiteId : Guid.Empty);
     }
 }
예제 #3
0
 public static MasterDataSet.WebsiteRow GetWebsiteRow(Guid websiteId)
 {
     using (WebsiteTableAdapter adapter = new WebsiteTableAdapter())
     {
         MasterDataSet.WebsiteDataTable table = adapter.GetWebsite(websiteId);
         return((table.Count > 0) ? table[0] : null);
     }
 }
예제 #4
0
        public static void UpdateWebsite(Guid websiteId, string name, string url, string description, string adminContactInfo)
        {
            using (WebsiteTableAdapter adapter = new WebsiteTableAdapter())
            {
                adapter.Update(websiteId, name, url, description, adminContactInfo, false);
            }

            RemoveWebsiteUrlsFromCache();
        }
예제 #5
0
        public static Guid InsertWebsite(string name, string url, string description, string adminContactInfo)
        {
            Guid websiteId = Guid.NewGuid();

            using (WebsiteTableAdapter adapter = new WebsiteTableAdapter())
            {
                adapter.Insert(websiteId, name, url, description, adminContactInfo, false);
            }

            RemoveWebsiteUrlsFromCache();

            return(websiteId);
        }
예제 #6
0
        public static void DeleteWebsite(Guid websiteId)
        {
            MasterDataSet.WebsiteRow row = GetWebsiteRow(websiteId);
            if (row != null)
            {
                row.Deleted = true;

                using (WebsiteTableAdapter adapter = new WebsiteTableAdapter())
                {
                    adapter.Update(row);
                }

                RemoveWebsiteUrlsFromCache();
            }
        }