Example #1
0
        /// <summary>
        /// Borrow Returned
        /// </summary>
        public void BorrowReturned(ItemShare share)
        {
            var commentSproc = new GoodsSearchItemActionComment()
            {
                ItemActionIdentifier = share.Identifier,
                UserIdentifier       = share.RequesterUserIdentifier,
            };

            try
            {
                share.Item = itemCore.GetItem(share.ItemIdentifier, null, null, true);

                var template = new BorrowReturnedTemplate()
                {
                    ItemShare = share,
                    User      = profileCore.SearchSingle <ProfileFull>(share.RequesterUserIdentifier, null, null, true),
                    Friend    = profileCore.SearchSingle(share.OwnerIdentifier, null, null, true),
                    Comments  = commentSproc.CallObjects <ItemActionComment>(),
                };

                var subject = string.Format("[Borentra] Your friend {0} has returned your offer", template.Friend.Name);

                this.SendGeneric(template.User.Email, template.Friend.Name, subject, "Offer Returned", template.TransformText());
            }
            catch
            {
            }
        }
Example #2
0
        public void RejectBorrow(ItemShare share)
        {
            var activity = new Activity()
            {
                Type                = Reference.Item,
                Text                = string.Format("has found out that '{0}' is not available.", share.ItemTitle),
                UserIdentifier      = share.RequesterUserIdentifier,
                ReferenceIdentifier = share.ItemIdentifier,
            };

            this.Save(activity);
        }
Example #3
0
        public void RequestBorrow(ItemShare share)
        {
            var activity = new Activity()
            {
                Type                = Reference.Item,
                Text                = string.Format("has requested to borrow '{0}'.", share.ItemTitle),
                UserIdentifier      = share.RequesterUserIdentifier,
                ReferenceIdentifier = share.ItemIdentifier,
            };

            this.Save(activity);
        }
Example #4
0
        public void ReturnBorrow(ItemShare share)
        {
            var activity = new Activity()
            {
                Type                = Reference.Item,
                Text                = string.Format("has had '{0}' returned", share.ItemTitle),
                UserIdentifier      = share.RequesterUserIdentifier,
                ReferenceIdentifier = share.ItemIdentifier,
            };

            this.Save(activity);

            activity = new Activity()
            {
                Type                = Reference.User,
                Text                = string.Format("has returned '{0}'", share.ItemTitle),
                UserIdentifier      = share.OwnerIdentifier,
                ReferenceIdentifier = share.RequesterUserIdentifier,
            };

            this.Save(activity);
        }
Example #5
0
        public void AcceptBorrow(ItemShare share)
        {
            var activity = new Activity()
            {
                Type                = Reference.Item,
                Text                = string.Format("is now borrowing '{0}'", share.ItemTitle),
                UserIdentifier      = share.RequesterUserIdentifier,
                ReferenceIdentifier = share.ItemIdentifier,
            };

            this.Save(activity);

            activity = new Activity()
            {
                Type                = Reference.Item,
                Text                = string.Format("is now lending '{0}'", share.ItemTitle),
                UserIdentifier      = share.OwnerIdentifier,
                ReferenceIdentifier = share.ItemIdentifier,
            };

            this.Save(activity);
        }