示例#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));
        }
示例#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);
     }
 }
 /// <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));
 }
示例#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));
        }
        /// <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);
        }
示例#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);
        }
示例#7
0
 /// <summary>
 /// returns true if the record exists
 /// </summary>
 public static bool Exists(int siteId, string oldUrl)
 {
     return(DBRedirectList.Exists(siteId, oldUrl));
 }
示例#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));
 }
示例#9
0
 /// <summary>
 /// Gets a count of RedirectList.
 /// </summary>
 public static int GetCount(int siteId)
 {
     return(DBRedirectList.GetCount(siteId));
 }
示例#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));
 }