Ejemplo n.º 1
0
        public bool SaveActivity(TimelineItem obj)
        {
            Assert.IsNotNull(obj);

            TimelineItemInfo info = new TimelineItemInfo()
            {
                ClientId = obj.ClientId,
                EventType = obj.EventType,
                EventName = obj.EventName,
                UserId = obj.UserId,
                UserName = obj.UserName,
                UserType = obj.UserType,
                Title = obj.Title,
                Decription = obj.Decription,
                ImageUrl = obj.ImageUrl,
                DetailUrl = obj.DetailUrl,
                LinkUrl = obj.LinkUrl,
                UserUrl = obj.UserUrl,
                SiteName = obj.SiteName,
                SiteUrl = obj.SiteUrl,
                ActionTime = obj.ActionTime,
                Keywords = obj.Keywords
            };

            bool result = false;
            var chanel = CreateChannel();
            chanel.Call(p =>
            {
                result = p.SaveActivity(info);
            });

            return result;
        }
Ejemplo n.º 2
0
        public ServerResponse SaveActivity(string client, string userId, string eventType, string eventName, DateTime actionTime,
            string userType, string userName, string title, string desp, 
            string imgUrl, string detailUrl, string linkUrl, string userUrl, string siteName, string siteUrl,
            string keywords)
        {
            var obj = new TimelineItem()
            {
                ClientId = client,
                UserId = userId,
                EventType = eventType,
                EventName = eventName,
                UserType = userType,
                UserName = userName,
                Title = title,
                Decription = desp,
                ImageUrl = imgUrl,
                DetailUrl = detailUrl,
                LinkUrl = linkUrl,
                UserUrl = userUrl,
                SiteName = siteName,
                SiteUrl = siteUrl,
                ActionTime = actionTime,
                Keywords = keywords
            };

            ServerResponse result = new ServerResponse();
            try
            {
                if (provider.SaveActivity(obj))
                {
                    result.Status = ResponseStatus.Success;
                }
                else
                {
                    result.Status = ResponseStatus.Failed;
                }
            }
            catch (Exception ex)
            {
                result.Status = ResponseStatus.Exception;
                result.Message = ex.Message;
            }

            return result;
        }
Ejemplo n.º 3
0
 public bool SaveActivity(TimelineItemInfo obj)
 {
     var item = new TimelineItem()
     {
         ClientId = obj.ClientId,
         EventType = obj.EventType,
         EventName = obj.EventName,
         UserId = obj.UserId,
         UserName = obj.UserName,
         UserType = obj.UserType,
         Title = obj.Title,
         Decription = obj.Decription,
         ImageUrl = obj.ImageUrl,
         DetailUrl = obj.DetailUrl,
         LinkUrl = obj.LinkUrl,
         UserUrl = obj.UserUrl,
         SiteName = obj.SiteName,
         SiteUrl = obj.SiteUrl,
         ActionTime = obj.ActionTime,
         Keywords = obj.Keywords
     };
     return provider.SaveActivity(item);
 }
Ejemplo n.º 4
0
 public bool SaveActivity(TimelineItem obj)
 {
     if (string.IsNullOrEmpty(obj.ItemId))
     {
         obj.ItemId = generator.NewId();
     }
     return repoTi.Save(o => o.ItemId == obj.ItemId, obj);
 }