Esempio n. 1
0
        /// <summary>
        /// Gets an IList with page of instances of RedirectList.
        /// </summary>
        public static List <RedirectInfo> GetPage(int siteId, int pageNumber, int pageSize, out int totalPages)
        {
            totalPages = 1;
            IDataReader reader = DBRedirectList.GetPage(siteId, pageNumber, pageSize, out totalPages);

            return(LoadListFromReader(reader));
        }
Esempio n. 2
0
 /// <summary>
 /// Gets an instance of RedirectList.
 /// </summary>
 /// <param name="rowGuid"> rowGuid </param>
 private void GetRedirectList(Guid rowGuid)
 {
     using (IDataReader reader = DBRedirectList.GetOne(rowGuid))
     {
         PopulateFromReader(reader);
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Updates this instance of RedirectList. Returns true on success.
 /// </summary>
 /// <returns>bool</returns>
 private bool Update()
 {
     return(DBRedirectList.Update(
                this.rowGuid,
                this.oldUrl,
                this.newUrl,
                this.expireUtc));
 }
Esempio n. 4
0
        /// <summary>
        /// Updates this instance of RedirectList. Returns true on success.
        /// </summary>
        /// <returns>bool</returns>
        private bool Update()
        {
            //https://www.mojoportal.com/Forums/Thread.aspx?pageid=5&t=11174~1#post46572
            if (string.IsNullOrEmpty(this.oldUrl))
            {
                return(false);
            }

            return(DBRedirectList.Update(
                       this.rowGuid,
                       this.oldUrl,
                       this.newUrl,
                       this.expireUtc));
        }
Esempio n. 5
0
        /// <summary>
        /// Persists a new instance of RedirectList. Returns true on success.
        /// </summary>
        /// <returns></returns>
        private bool Create()
        {
            this.rowGuid = Guid.NewGuid();

            int rowsAffected = DBRedirectList.Create(
                this.rowGuid,
                this.siteGuid,
                this.siteId,
                this.oldUrl,
                this.newUrl,
                this.createdUtc,
                this.expireUtc);

            return(rowsAffected > 0);
        }
Esempio n. 6
0
        /// <summary>
        /// Persists a new instance of RedirectList. Returns true on success.
        /// </summary>
        /// <returns></returns>
        private bool Create()
        {
            this.rowGuid = Guid.NewGuid();
            //https://www.mojoportal.com/Forums/Thread.aspx?pageid=5&t=11174~1#post46572
            if (string.IsNullOrEmpty(this.oldUrl))
            {
                return(false);
            }

            int rowsAffected = DBRedirectList.Create(
                this.rowGuid,
                this.siteGuid,
                this.siteId,
                this.oldUrl,
                this.newUrl,
                this.createdUtc,
                this.expireUtc);

            return(rowsAffected > 0);
        }
Esempio n. 7
0
 /// <summary>
 /// returns true if the record exists
 /// </summary>
 public static bool Exists(int siteId, string oldUrl)
 {
     return(DBRedirectList.Exists(siteId, oldUrl));
 }
Esempio n. 8
0
 /// <summary>
 /// Gets an IDataReader with one row from the mp_RedirectList table.
 /// </summary>
 public static IDataReader GetBySiteAndUrl(int siteId, string oldUrl)
 {
     return(DBRedirectList.GetBySiteAndUrl(siteId, oldUrl));
 }
Esempio n. 9
0
 /// <summary>
 /// Gets a count of RedirectList.
 /// </summary>
 public static int GetCount(int siteId)
 {
     return(DBRedirectList.GetCount(siteId));
 }
Esempio n. 10
0
 /// <summary>
 /// Deletes an instance of RedirectList. Returns true on success.
 /// </summary>
 /// <param name="rowGuid"> rowGuid </param>
 /// <returns>bool</returns>
 public static bool Delete(Guid rowGuid)
 {
     return(DBRedirectList.Delete(rowGuid));
 }