Exemple #1
0
        public bool UpdateSettings(UserMaster obj)
        {
            bool isDone = false;

            if (obj.Id <= 0)
            {
                throw new Exception("<li>Invalid User selected</li>");
            }

            string errorMessage = obj.CheckValidation();

            if (errorMessage.Trim().Length > 0)
            {
                throw new ApplicationException(errorMessage);
            }

            //Starting Transaction
            using (TransactionDecorator transaction = new TransactionDecorator())
            {
                //Saving Data by calling Dao Method
                isDone = daoObject.UpdateSettings(obj);

                //If Id is returned as Zero from Data Layer, then throwing Exception and rolling back the Transaction
                if (!isDone)
                {
                    throw new Exception("Error Saving Data.", null);
                }

                //If no Error, then Commiting Transaction
                transaction.Complete();
            }

            return(isDone);
        }
        public void Decorate_Exception_Test()
        {
            // Arrange
            TransactionDecorator target = new TransactionDecorator();

            // Act/Assert
            TestUtils.ExecuteExcectedException <QuillException>(
                () => target.Decorate(c => { /* Dummy */ }));
        }
Exemple #3
0
            public static ICommandHandler <TCommand> Default <TCommand>(object handler, IServiceProvider provider)
            {
                var logger               = provider.GetService <ILogger>();
                var validations          = provider.GetServices <IValidator <TCommand> >();
                var transactionDecorator = new TransactionDecorator <TCommand>((ICommandHandler <TCommand>)handler);
                var loggingDecorator     = new LoggingDecorator <TCommand>(transactionDecorator, logger);
                var validationDecorator  = new ValidationDecorator <TCommand>(loggingDecorator, validations);

                return(validationDecorator); // order is revers for decorators
            }
Exemple #4
0
        public bool UpdatePassword(UserMaster obj, string NewPassword)
        {
            bool isDone = false;

            if (obj.Id <= 0)
            {
                throw new Exception("<li>Invalid User selected</li>");
            }

            if (obj.Password == null)
            {
                obj.Password = "";
            }

            if (NewPassword == null)
            {
                NewPassword = "";
            }

            obj.Password = obj.Password.Trim();
            NewPassword  = NewPassword.Trim();

            if (obj.Password == "")
            {
                throw new Exception("<li>Please give Current Password.</li>");
            }

            if (NewPassword == "")
            {
                throw new Exception("<li>Please give New Password.</li>");
            }

            if (NewPassword == obj.Password)
            {
                throw new Exception("<li>Current password and New password cannot be same.</li>");
            }

            //Starting Transaction
            using (TransactionDecorator transaction = new TransactionDecorator())
            {
                //Saving Data by calling Dao Method
                isDone = daoObject.UpdatePassword(obj, NewPassword);

                //If Id is returned as Zero from Data Layer, then throwing Exception and rolling back the Transaction
                if (!isDone)
                {
                    throw new Exception("Error Saving Data.", null);
                }

                //If no Error, then Commiting Transaction
                transaction.Complete();
            }

            return(isDone);
        }
        public void DeletePortalModule(params int[] ModuleIdList)
        {
            // TODO: add access security here..
            // TODO: add argument validation here..

            // Run within the context of a database transaction.
            // The Decorator Design Pattern.
            using (TransactionDecorator transaction = new TransactionDecorator())
            {
                portalModulesDAO.DeletePortalModule(ModuleIdList);
                transaction.Complete();
            }
        }
        public void AddUserRole(int roleId, int userId)
        {
            // TODO: add access security here..
            // TODO: add argument validation here..

            // Run within the context of a database transaction.
            // The Decorator Design Pattern.
            using (TransactionDecorator transaction = new TransactionDecorator())
            {
                rolesDAO.AddUserRole(roleId, userId);
                transaction.Complete();
            }
        }
Exemple #7
0
            public static ICommandHandler <TCommand> DefaultWithRetry <TCommand>(object handler, IServiceProvider provider)
            {
                var logger      = provider.GetService <ILogger>();
                var cache       = provider.GetService <ICache>();
                var validations = provider.GetServices <IValidator <TCommand> >();

                var transactionDecorator = new TransactionDecorator <TCommand>((ICommandHandler <TCommand>)handler);
                var loggingDecorator     = new LoggingDecorator <TCommand>(transactionDecorator, logger);
                var validationDecorator  = new ValidationDecorator <TCommand>(loggingDecorator, validations);
                var retryDecorator       = new RetryDecorator <TCommand>(validationDecorator, logger, nrRetry: 3);
                var cacheDecorator       = new CacheDecorator <TCommand>(retryDecorator, cache);

                return(cacheDecorator); // order is revers for decorators
            }
Exemple #8
0
        /// <summary>
        /// Method used to Enable / Disable a Record
        /// </summary>
        /// <param name="Id">Record Id</param>
        /// <param name="RowVersion">Row Version of Record</param>
        /// <param name="Status">New Status to be Updated</param>
        /// <param name="ModifiedByUserId">Id of User who is Modifying the Record</param>
        /// <param name="TableName">Name of the Table to which the record belogs</param>
        /// <returns></returns>
        public bool UpdateRecordStatus(string Guid, int RowVersion, bool Status, string TableName, string DatabaseName = "")
        {
            bool   isDone       = true;
            string errorMessage = "";
            int    Id           = 1;

            try
            {
                if (Id <= 0)
                {
                    errorMessage += ("<li>Invalid Record Id</li>");
                }

                if (RowVersion <= 0)
                {
                    errorMessage += ("<li>Invalid Row Version</li>");
                }

                if (TableName.Trim().Length <= 0)
                {
                    errorMessage += ("<li>Invalid Table Details</li>");
                }

                if (errorMessage != "")
                {
                    throw new ApplicationException(errorMessage);
                }

                //Starting Transaction
                using (TransactionDecorator transaction = new TransactionDecorator())
                {
                    //Saving Data by calling Dao Method
                    if (daoObject.UpdateRecordStatus(Id, RowVersion, Status, Localizer.CurrentUser.Id, TableName, DatabaseName) == false)
                    {
                        throw new ApplicationException("<li>Error Updating Record Status</li>", null);
                    }

                    //If no Error, then Commiting Transaction
                    transaction.Complete();
                }
            }
            catch (ApplicationException ex)
            {
                isDone = false;
                throw new ApplicationException(ex.Message, null);
            }

            return(isDone);
        }
        public int AddUser(PortalUser user)
        {
            // TODO: add access security here..
            // TODO: add argument validation here..

            int retval;
            // Run within the context of a database transaction.
            // The Decorator Design Pattern.
            using (TransactionDecorator transaction = new TransactionDecorator())
            {
                retval = usersDAO.AddUser(user.Name, user.Email, user.Password);
                transaction.Complete();
            }
            return retval;
        }
        public int AddRole(PortalRole role)
        {
            // TODO: add access security here..
            // TODO: add argument validation here..

            int retval;
            // Run within the context of a database transaction.
            // The Decorator Design Pattern.
            using (TransactionDecorator transaction = new TransactionDecorator())
            {
                retval = rolesDAO.AddRole(role.PortalID, role.RoleName);
                transaction.Complete();
            }
            return retval;
        }
Exemple #11
0
        public bool SortUserFavoriteMenus(List <UserFavoriteMenuMaster> lstData)
        {
            bool isDone = false;

            try
            {
                string errorMessage = "";

                for (int i = 0; i < lstData.Count; i++)
                {
                    if (lstData[i].Id <= 0)
                    {
                        errorMessage += ("Invalid User Id.");
                    }

                    if (lstData[i].SortId <= 0)
                    {
                        errorMessage += ("Invalid Sort Id.");
                    }
                }

                if (errorMessage != "")
                {
                    throw new ApplicationException(errorMessage);
                }
                //Starting Transaction
                using (TransactionDecorator transaction = new TransactionDecorator())
                {
                    //Saving Data by calling Dao Method
                    isDone = daoObject.SortUserFavoriteMenus(lstData);

                    if (isDone == false)
                    {
                        throw new ApplicationException("Error Sorting Data.", null);
                    }

                    //If no Error, then Commiting Transaction
                    transaction.Complete();
                }
            }
            catch (ApplicationException ex)
            {
                throw new ApplicationException(ex.Message, null);
            }

            return(isDone);
        }
Exemple #12
0
        public bool UpdateUserFavoriteMenu(int menuId, bool isFavoriteMenu)
        {
            bool isDone = false;

            if (menuId <= 0)
            {
                throw new Exception("<li>Invalid Menu</li>");
            }

            //Starting Transaction
            using (TransactionDecorator transaction = new TransactionDecorator())
            {
                //Saving Data by calling Dao Method
                isDone = daoObject.UpdateUserFavoriteMenu(menuId, isFavoriteMenu);

                //If Id is returned as Zero from Data Layer, then throwing Exception and rolling back the Transaction
                if (!isDone)
                {
                    throw new Exception("Error Saving Data.", null);
                }

                //If no Error, then Commiting Transaction
                transaction.Complete();
            }

            UserMaster user = Localizer.CurrentUser;

            foreach (UserMenuMaster menu in user.LstChildMenu)
            {
                if (menu.MenuId == menuId)
                {
                    menu.IsFavoriteMenu = isFavoriteMenu;
                }
            }

            foreach (UserFavoriteMenuMaster menu in user.FavoriteMenus)
            {
                if (menu.MenuId == menuId)
                {
                    menu.IsSelected = isFavoriteMenu;
                }
            }

            HttpContext.Current.Session["WSM_USER_MASTER_SESSION"] = user;

            return(isDone);
        }
        public int AddContact(PortalContact contact)
        {
            // TODO: add access security here..
            // TODO: add argument validation here..

            int retval;
            // Run within the context of a database transaction.
            // The Decorator Design Pattern.
            using (TransactionDecorator transaction = new TransactionDecorator())
            {
                retval = contactsDAO.AddContact(contact.ModuleID, contact.ItemID, contact.CreatedByUser,
                                                contact.Name, contact.Role, contact.Email,
                                                contact.Contact1, contact.Contact2);
                transaction.Complete();
            }
            return retval;
        }
        public int AddEvent(PortalEvent portalevent)
        {
            // TODO: add access security here..
            // TODO: add argument validation here..

            int retval;
            // Run within the context of a database transaction.
            // The Decorator Design Pattern.
            using (TransactionDecorator transaction = new TransactionDecorator())
            {
                retval = eventsDAO.AddEvent(portalevent.ModuleID, portalevent.ItemID, portalevent.CreatedByUser,
                                            portalevent.Title, portalevent.ExpireDate.Value,
                                            portalevent.Description, portalevent.WhereWhen);
                transaction.Complete();
            }
            return retval;
        }
        public int SaveBlockedIPAddress(string IPAddress, int maxLoginAttempts, string filePath, string protocol)
        {
            int Id = 0;

            try
            {
                //Checking the Validations
                if (IPAddress.Trim() == "")
                {
                    throw new ApplicationException("Invalid IP Address");
                }

                //Starting Transaction
                using (TransactionDecorator transaction = new TransactionDecorator())
                {
                    //Saving Data by calling Dao Method
                    Id = daoObject.SaveBlockedIPAddress(IPAddress);

                    // Code to send email to admin for the blocked user
                    string toEmailAddress = "*****@*****.**";
                    string userName       = "******";
                    string title          = "Unblock IP Address : " + IPAddress;

                    var requestContext = HttpContext.Current.Request.RequestContext;
                    var urlHelper      = new UrlHelper(requestContext);

                    string url = urlHelper.Action("UnBlockIPAddress", "Home", new { Token = FrameWork.Core.Utility.EncryptData("`ID=" + Id + "`IP_ADDRESS=" + IPAddress) }, protocol);

                    string description = "The IP Address ( <b>" + IPAddress + "</b> ) has been blocked due to " + maxLoginAttempts + " consecutive failure attempts for login.";
                    string mailSubject = "IP Address ( " + IPAddress + " ) blocked in Web School Manager";

                    (new CommonFacade()).SendMail(filePath, toEmailAddress, userName, title, url, description, mailSubject);

                    //If no Error, then Commiting Transaction
                    transaction.Complete();
                }
            }
            catch (ApplicationException ex)
            {
                Id = 0;
                throw new ApplicationException(ex.Message, null);
            }

            return(Id);
        }
Exemple #16
0
        public int SaveData(Holiday obj)
        {
            int Id = 0;

            try
            {
                //Checking the Validations
                string validationResult = obj.CheckValidation();

                if (validationResult.Length > 0)
                {
                    throw new ApplicationException(validationResult);
                }


                //Starting Transaction
                using (TransactionDecorator transaction = new TransactionDecorator())
                {
                    //Saving Data by calling Dao Method
                    Id = daoObject.SaveData(obj);

                    //If Id is returned as Zero from Data Layer, then throwing Exception and rolling back the Transaction
                    if (Id == 0 && obj.Id == 0)
                    {
                        throw new ApplicationException("Error Saving Data.", null);
                    }

                    //If Id is returned as Zero from Data Layer, then throwing Exception and rolling back the Transaction
                    if (Id == 0 && obj.Id != 0)
                    {
                        throw new ApplicationException("Record has been modified by some other user. Please reload the record and then modify.", null);
                    }

                    //If no Error, then Commiting Transaction
                    transaction.Complete();
                }
            }
            catch (ApplicationException ex)
            {
                Id = 0;
                throw new ApplicationException(ex.Message, null);
            }

            return(Id);
        }
Exemple #17
0
        public bool SaveUserFavoriteMenus(UserMaster obj)
        {
            bool isDone      = false;
            int  recordCount = 0;

            try
            {
                string errorMessage = "";

                if (obj.Id <= 0)
                {
                    errorMessage += ("Invalid User Id.");
                }

                //if (obj.FavoriteMenus.Where(m => m.IsSelected == true).ToList().Count > maxFavoriteMenusCount)
                //    errorMessage += ("Maximum " + maxFavoriteMenusCount + " Menus can be saved as Favorite Menus");

                if (errorMessage != "")
                {
                    throw new ApplicationException(errorMessage);
                }

                //Starting Transaction
                using (TransactionDecorator transaction = new TransactionDecorator())
                {
                    //Saving Data by calling Dao Method
                    recordCount = daoObject.SaveUserFavoriteMenus(obj);

                    if (recordCount != obj.FavoriteMenus.Where(m => m.IsSelected).Count())
                    {
                        throw new ApplicationException("Error Saving Data.", null);
                    }

                    isDone = true;
                    //If no Error, then Commiting Transaction
                    transaction.Complete();
                }
            }
            catch (ApplicationException ex)
            {
                throw new ApplicationException(ex.Message, null);
            }

            return(isDone);
        }
        public int AddAnnouncement(PortalAnnouncement announcement)
        {
            // TODO: add access security here..
            // TODO: add argument validation here..

            int retval;
            // Run within the context of a database transaction.
            // The Decorator Design Pattern.
            using (TransactionDecorator transaction = new TransactionDecorator())
            {
                retval =
                    announcementsDAO.AddAnnouncement(announcement.ModuleID, announcement.ItemID,
                                                     announcement.CreatedByUser,
                                                     announcement.Title, announcement.ExpireDate.Value,
                                                     announcement.Description, announcement.MoreLink,
                                                     announcement.MobileMoreLink);
                transaction.Complete();
            }
            return retval;
        }
        public void Decorate_TxAction_Test()
        {
            // Arrange
            TransactionDecorator target = new TransactionDecorator();
            ConnectionDecorator  cd     = new ConnectionDecorator();

            cd.DataSource = new TestDataSource();
            FieldInfo cdField = target.GetType().GetField(
                "_connectionDecorator", BindingFlags.NonPublic | BindingFlags.Instance);

            cdField.SetValue(target, cd);

            // Act/Assert
            target.Decorate(tx => {
                Assert.IsNotNull(tx);
                Assert.AreEqual(ConnectionState.Open, tx.Connection.State);
            });

            // Assert
            Assert.IsTrue(TestTx.IsCalledCommit);
            Assert.IsTrue(TestTx.IsCalledDispose);
            Assert.IsFalse(TestTx.IsCalledRollbacked);
        }
        public void UpdateHtmlText(PortalHtmlText html)
        {
            // TODO: add access security here..
            // TODO: add argument validation here..

            // Run within the context of a database transaction.
            // The Decorator Design Pattern.
            using (TransactionDecorator transaction = new TransactionDecorator())
            {
                htmlTextDAO.UpdateHtmlText(html.ModuleID, html.DesktopHtml, html.MobileSummary, html.MobileDetails);
                transaction.Complete();
            }
        }
        public void UpdateRole(PortalRole role)
        {
            // TODO: add access security here..
            // TODO: add argument validation here..

            // Run within the context of a database transaction.
            // The Decorator Design Pattern.
            using (TransactionDecorator transaction = new TransactionDecorator())
            {
                rolesDAO.UpdateRole(role.RoleID, role.RoleName);
                transaction.Complete();
            }
        }
        public void UpdateUser(PortalUser user)
        {
            // TODO: add access security here..
            // TODO: add argument validation here..

            // Run within the context of a database transaction.
            // The Decorator Design Pattern.
            using (TransactionDecorator transaction = new TransactionDecorator())
            {
                usersDAO.UpdateUser(user.UserID, user.Email, user.Password);
                transaction.Complete();
            }
        }
        public void DeleteDocument(int itemID)
        {
            // TODO: add access security here..
            // TODO: add argument validation here..

            // Run within the context of a database transaction.
            // The Decorator Design Pattern.
            using (TransactionDecorator transaction = new TransactionDecorator())
            {
                documentDAO.DeleteDocument(itemID);
                transaction.Complete();
            }
        }
Exemple #24
0
        public int SaveData(UserMaster obj)
        {
            int    Id           = 0;
            string errorMessage = "";

            try
            {
                //Checking the Validations
                string validationResult = obj.CheckValidation();

                if (validationResult.Length > 0)
                {
                    throw new ApplicationException(validationResult);
                }

                //Checking if the Name already exists
                if (common.CheckValueAlreadyExists(obj.Id, "NAME", obj.Name, obj.DatabaseTableName))
                {
                    errorMessage += ("<li>User Name already exists.</li>");
                }

                //Checking if the Email already exists
                if (common.CheckValueAlreadyExists(obj.Id, "EMAIL_ID", obj.EmailId, obj.DatabaseTableName))
                {
                    errorMessage += ("<li>Email Id already exists.</li>");
                }

                //Checking if the Mobile Number already exists
                if (common.CheckValueAlreadyExists(obj.Id, "MOBILE_NO", obj.MobileNo, obj.DatabaseTableName))
                {
                    errorMessage += ("<li>Mobile No. already exists.</li>");
                }

                if (obj.Id != 0)
                {
                    if (common.CheckRowVersion(obj.Id, obj.RowVersion, obj.DatabaseTableName) == false)
                    {
                        errorMessage += ("<li>Record has been modified by some other user. Please reload the record and then modify.</li>");
                    }
                }

                if (errorMessage != "")
                {
                    throw new ApplicationException(errorMessage);
                }

                //Starting Transaction
                using (TransactionDecorator transaction = new TransactionDecorator())
                {
                    //Saving Data by calling Dao Method
                    Id = daoObject.SaveData(obj);

                    //If Id is returned as Zero from Data Layer, then throwing Exception and rolling back the Transaction
                    if (Id == 0 && obj.Id == 0)
                    {
                        throw new ApplicationException("Error Saving Data.", null);
                    }

                    //If Id is returned as Zero from Data Layer, then throwing Exception and rolling back the Transaction
                    if (Id == 0 && obj.Id != 0)
                    {
                        throw new ApplicationException("Record has been modified by some other user. Please reload the record and then modify.", null);
                    }

                    //If no Error, then Commiting Transaction
                    transaction.Complete();
                }
            }
            catch (ApplicationException ex)
            {
                Id = 0;
                throw new ApplicationException(ex.Message, null);
            }

            return(Id);
        }
Exemple #25
0
        /// <summary>
        /// Method to update the Particular Record from Database
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public bool SendPasswordResetLink(string emailId, string templatePath, string url)
        {
            bool isDone        = false;
            int  tokenValidity = 1440; //Token will be valid for 24 Hours

            CommonFacade commonFacade = new CommonFacade();

            try
            {
                string passwordResetToken = commonFacade.CreateRandomCode(50, true);

                //Starting Transaction
                using (TransactionDecorator transaction = new TransactionDecorator())
                {
                    UserMaster obj = new UserMaster();
                    obj.EmailId            = emailId.Trim().ToLower();
                    obj.PasswordResetToken = passwordResetToken.Trim();

                    //calling Dao Method to get the Details
                    obj = daoObject.SendPasswordResetLink(obj);

                    if (obj.Id <= 0)
                    {
                        throw new ApplicationException("Sorry! Email Id does not exists.");
                    }


                    url = url + "/Home/ResetPassword?Token=" + Utility.EncryptData("`PASSWORD_RESET_TOKEN=" + obj.PasswordResetToken + "`ID=" + obj.Id + "`EMAIL_ID=" + obj.EmailId + "`USER_NAME=" + obj.Name + "`TOKEN_GENERATE_TIME=" + DateTime.Now + "`VALID_FOR=" + tokenValidity + "`TOKEN_EXPIRE_TIME=" + DateTime.Now.AddMinutes(tokenValidity));

                    string toEmailAddress = emailId;
                    string title          = "Reset Password";

                    string resetLink = string.Format("<a style = 'text-decoration:none;background:#26B99A;border:1px solid #169F85;border-radius:3px;margin-bottom:5px;margin-right:5px;color:#fff;display:inline-block;padding:6px 12px;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;font-family:inherit;text-transform:none;overflow:visible;' href = {0}>{1}</a>", url, title);

                    StringBuilder sb = new StringBuilder();
                    sb.Append("We have received a request to reset your Web School Manager account password.");
                    sb.Append("<br/>");
                    sb.Append(Environment.NewLine);
                    sb.Append("You can reset the password by clicking on the below button:");
                    sb.Append("<br/>");
                    sb.Append("<br/>");
                    sb.Append(resetLink);
                    sb.Append("<br/>");
                    sb.Append("<br/>");
                    sb.Append("<b>Note:</b> This link is valid for next 24 hours only.");
                    sb.Append("<br/>");
                    sb.Append("<br/>");
                    sb.Append("If you did not request a new password, please ignore this email.");

                    string description = sb.ToString();

                    string mailSubject = "Reset your Web School Manager password";

                    isDone = commonFacade.SendPasswordResetMail(templatePath, toEmailAddress, obj.Name, title, url, description, mailSubject);

                    //If Id is returned as Zero from Data Layer, then throwing Exception and rolling back the Transaction
                    if (isDone == false)
                    {
                        throw new ApplicationException("Sorry! Unable to send Password reset Link. Please try again.", null);
                    }

                    //If no Error, then Commiting Transaction
                    transaction.Complete();
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, null);
            }

            return(isDone);
        }
        public int AddMessage(PortalDiscussion discussion, int parentId)
        {
            // TODO: add access security here..
            // TODO: add argument validation here..

            int retval;
            // Run within the context of a database transaction.
            // The Decorator Design Pattern.
            using (TransactionDecorator transaction = new TransactionDecorator())
            {
                retval = discussionDAO.AddMessage(discussion.ModuleID, parentId,
                                                  discussion.CreatedByUser, discussion.Title, discussion.Body);
                transaction.Complete();
            }
            return retval;
        }
        public void UpdateDocument(PortalDocument doc)
        {
            // TODO: add access security here..
            // TODO: add argument validation here..

            // Run within the context of a database transaction.
            // The Decorator Design Pattern.
            using (TransactionDecorator transaction = new TransactionDecorator())
            {
                documentDAO.UpdateDocument(doc.ModuleID, doc.ItemID, doc.CreatedByUser, doc.FileFriendlyName,
                                           doc.FileNameUrl, doc.Category,
                                           doc.Content, doc.ContentSize.Value, doc.ContentType);
                transaction.Complete();
            }
        }
        public void DeleteUser(int userId)
        {
            // TODO: add access security here..
            // TODO: add argument validation here..

            // Run within the context of a database transaction.
            // The Decorator Design Pattern.
            using (TransactionDecorator transaction = new TransactionDecorator())
            {
                usersDAO.DeleteUser(userId);
                transaction.Complete();
            }
        }
        public int AddLink(PortalLink link)
        {
            // TODO: add access security here..
            // TODO: add argument validation here..

            int retval;
            // Run within the context of a database transaction.
            // The Decorator Design Pattern.
            using (TransactionDecorator transaction = new TransactionDecorator())
            {
                retval =
                    linkDAO.AddLink(link.ModuleID, link.ItemID, link.CreatedByUser, link.Title, link.Url, link.MobileUrl,
                                    link.ViewOrder.Value, link.Description);
                transaction.Complete();
            }
            return retval;
        }