public void UpdateHtmlText(HtmlTextInfo htmlText, bool blnCreateNewVersion, int maximumVersionHistory)
        {
            Requires.NotNull("htmlText", htmlText);
            //Requires.PropertyNotNegative("htmlText", "ItemId", htmlText.ItemId);
            Requires.PropertyNotNegative("htmlText", "ModuleId", htmlText.ModuleId);

            //flag create new version if ItemId is not valid
            if (htmlText.ItemId == -1)
            {
                blnCreateNewVersion = true;
            }

            if (blnCreateNewVersion)
            {
                //add new version content
                htmlText.CreatedByUserID      = UserController.Instance.GetCurrentUserInfo().UserID;
                htmlText.CreatedOnDate        = DateTime.Now;
                htmlText.LastModifiedByUserId = UserController.Instance.GetCurrentUserInfo().UserID;
                htmlText.LastModifiedOnDate   = DateTime.Now;
                repository.Add(htmlText, maximumVersionHistory);
            }
            else
            {
                //update existing content
                htmlText.LastModifiedByUserId = UserController.Instance.GetCurrentUserInfo().UserID;
                htmlText.LastModifiedOnDate   = DateTime.Now;
                repository.Update(htmlText);
            }
        }