Example #1
0
        public static string DeleteFeedUrl(string RssId, Model.DatabaseRepository dbr, Helper.AppSettings _appSettings)
        {
            try
            {
                MongoRepository _RssRepository = new MongoRepository("Rss", _appSettings);
                List <Domain.Socioboard.Models.Mongo.Rss> lstRss = new List <Domain.Socioboard.Models.Mongo.Rss>();
                var ret  = _RssRepository.Find <Domain.Socioboard.Models.Mongo.Rss>(t => t.strId == RssId);
                var task = Task.Run(async() =>
                {
                    return(await ret);
                });
                lstRss = task.Result.ToList();

                Domain.Socioboard.Models.RssFeedUrl feedurl = dbr.FindSingle <Domain.Socioboard.Models.RssFeedUrl>(t => t.rssurl.Equals(lstRss.First().RssFeedUrl) && t.ProfileId == lstRss.First().ProfileId);
                if (feedurl != null)
                {
                    dbr.Delete <Domain.Socioboard.Models.RssFeedUrl>(feedurl);
                }

                var builders = Builders <Domain.Socioboard.Models.Mongo.Rss> .Filter;
                FilterDefinition <Domain.Socioboard.Models.Mongo.Rss> filter = builders.Eq("strId", RssId);

                _RssRepository.Delete <Domain.Socioboard.Models.Mongo.Rss>(filter);


                return("success");
            }
            catch (Exception ex)
            {
                return("Error");
            }
        }
 public static Domain.Socioboard.Models.RssFeedUrl AddRssUrl(string Url, Model.DatabaseRepository dbr)
 {
     Domain.Socioboard.Models.RssFeedUrl _RssFeedUrl = dbr.FindSingle <Domain.Socioboard.Models.RssFeedUrl>(t => t.rssurl.Contains(Url));
     if (_RssFeedUrl != null)
     {
         return(_RssFeedUrl);
     }
     else
     {
         _RssFeedUrl            = new Domain.Socioboard.Models.RssFeedUrl();
         _RssFeedUrl.rssurl     = Url;
         _RssFeedUrl.LastUpdate = DateTime.UtcNow;
         dbr.Add <Domain.Socioboard.Models.RssFeedUrl>(_RssFeedUrl);
         _RssFeedUrl = dbr.FindSingle <Domain.Socioboard.Models.RssFeedUrl>(t => t.rssurl.Contains(Url));
         return(_RssFeedUrl);
     }
 }
        public static string AddRssFeed(string TextUrl, long Userid, string profileId, Domain.Socioboard.Enum.SocialProfileType ProfileType, string profileimageurl, string profilename, Model.DatabaseRepository dbr, Helper.AppSettings _appSettings)
        {
            int             UrlAdded       = 0;
            string          RetMsg         = string.Empty;
            MongoRepository _RssRepository = new MongoRepository("Rss", _appSettings);

            Domain.Socioboard.Models.RssFeedUrl rssobj = new Domain.Socioboard.Models.RssFeedUrl();
            rssobj = dbr.FindSingle <Domain.Socioboard.Models.RssFeedUrl>(t => t.ProfileId == profileId && t.rssurl == TextUrl);
            string rt   = ParseFeedUrl(TextUrl, ProfileType, profileId, Userid, profilename, profileimageurl, _appSettings);
            var    ret  = _RssRepository.Find <Domain.Socioboard.Models.Mongo.Rss>(t => t.RssFeedUrl.Equals(TextUrl) && t.ProfileId.Contains(profileId) && t.ProfileType == ProfileType && t.UserId.Equals(Userid));
            var    task = Task.Run(async() =>
            {
                return(await ret);
            });
            int count = task.Result.Count;



            if (count < 1)
            {
                if (rt == "ok")
                {
                    Domain.Socioboard.Models.Mongo.Rss _Rss = new Domain.Socioboard.Models.Mongo.Rss();
                    _Rss.Id              = ObjectId.GenerateNewId();
                    _Rss.strId           = ObjectId.GenerateNewId().ToString();
                    _Rss.RssFeedUrl      = TextUrl;
                    _Rss.ProfileType     = ProfileType;
                    _Rss.ProfileId       = profileId;
                    _Rss.UserId          = Userid;
                    _Rss.ProfileImageUrl = profileimageurl;
                    _Rss.ProfileName     = profilename;
                    _Rss.rssFeedUrl      = rssobj;
                    _Rss.CreatedOn       = DateTime.UtcNow.ToString("yyyy/MM/dd HH:mm:ss");
                    _RssRepository.Add(_Rss);
                    UrlAdded++;
                }
                else
                {
                    return("Please Fill Correct Url For Feeds");
                }
            }
            else
            {
            }
            if (UrlAdded == 1)
            {
                RetMsg = "Url for " + UrlAdded.ToString() + " account is added";
            }
            else if (UrlAdded > 1)
            {
                RetMsg = "Url for " + UrlAdded.ToString() + " accounts is added";
            }
            else
            {
                RetMsg = "Url has already added";
            }
            return(RetMsg);
        }
Example #4
0
        public static List <TaskCommentsViewModel> GetAllCompletedTasksOfUserAndGroup(Int64 recipientUserId, Int64 groupId, ILogger _logger, Helper.Cache _redisCache, Helper.AppSettings _appSettings, Model.DatabaseRepository _dbr)
        {
            try
            {
                List <TaskCommentsViewModel> lstTaskCommentsViewModel = new List <TaskCommentsViewModel>();
                MongoRepository taskmongorepo        = new MongoRepository("Tasks", _appSettings);
                MongoRepository taskcommentmongorepo = new MongoRepository("TaskComments", _appSettings);
                var             ret  = taskmongorepo.Find <Tasks>(t => t.groupId == groupId && t.recipientUserId == recipientUserId && t.taskStatus == Domain.Socioboard.Enum.TaskStatus.Completed);
                var             task = Task.Run(async() =>
                {
                    return(await ret);
                });
                IList <Tasks> lstTask = task.Result.ToList();
                foreach (Tasks item in lstTask)
                {
                    TaskCommentsViewModel taskCommentsViewModel = new TaskCommentsViewModel();
                    var ret1  = taskcommentmongorepo.Find <TaskComments>(t => t.taskId == item.strId);
                    var task1 = Task.Run(async() =>
                    {
                        return(await ret1);
                    });
                    taskCommentsViewModel.tasks = item;
                    taskCommentsViewModel.user  = _dbr.FindSingle <User>(t => t.Id == item.senderUserId);
                    IList <TaskComments>        lstTaskComment      = task1.Result.ToList();
                    List <TaskCommentViewModel> lstCommentViewModel = new List <TaskCommentViewModel>();
                    foreach (TaskComments item1 in lstTaskComment)
                    {
                        TaskCommentViewModel commentViewModel = new TaskCommentViewModel();
                        commentViewModel.taskComments = item1;
                        commentViewModel.user         = _dbr.FindSingle <User>(t => t.Id == item1.userId);
                        lstCommentViewModel.Add(commentViewModel);
                    }

                    taskCommentsViewModel.lstTaskComments = lstCommentViewModel;
                    lstTaskCommentsViewModel.Add(taskCommentsViewModel);
                }
                return(lstTaskCommentsViewModel);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.Message);
                return(new List <TaskCommentsViewModel>());
            }
        }
        public static string AddRssUrl(string profileId, string Url, Model.DatabaseRepository dbr)
        {
            string[] profilesList = null;
            if (profileId != null)
            {
                profilesList = profileId.Split(',');
                profileId    = profilesList[0];
            }

            foreach (var item in profilesList)
            {
                string prid = null;
                if (item.Contains("page_"))
                {
                    prid = item.Substring(5, item.Length - 5);
                }
                else if (item.Contains("tw_"))
                {
                    prid = item.Substring(3, item.Length - 3);
                }
                else
                {
                    prid = item.Substring(3, item.Length - 3);
                }

                Domain.Socioboard.Models.RssFeedUrl _RssFeedUrl = dbr.FindSingle <Domain.Socioboard.Models.RssFeedUrl>(t => t.rssurl.Contains(Url) && t.Keywords == null && t.ProfileId == prid);

                if (_RssFeedUrl != null)
                {
                    return("null");
                }
                else
                {
                    _RssFeedUrl            = new Domain.Socioboard.Models.RssFeedUrl();
                    _RssFeedUrl.rssurl     = Url;
                    _RssFeedUrl.ProfileId  = prid;
                    _RssFeedUrl.LastUpdate = DateTime.UtcNow;
                    dbr.Add <Domain.Socioboard.Models.RssFeedUrl>(_RssFeedUrl);
                    _RssFeedUrl = dbr.FindSingle <Domain.Socioboard.Models.RssFeedUrl>(t => t.rssurl.Contains(Url) && t.Keywords == null);
                }
            }
            return("success");
        }
 public IActionResult UpdateRecurringUser(string subscr_id, string txn_id)
 {
     try
     {
         Model.DatabaseRepository dbr = new Model.DatabaseRepository(_logger, _appEnv);
         Domain.Socioboard.Models.PaymentTransaction _PaymentTransaction = dbr.FindSingle <Domain.Socioboard.Models.PaymentTransaction>(t => t.paymentId.Contains(subscr_id));
         Domain.Socioboard.Models.User _user = dbr.FindSingle <Domain.Socioboard.Models.User>(x => x.Id == _PaymentTransaction.userid);
         _user.ExpiryDate  = _user.ExpiryDate.AddDays(30);
         _user.TrailStatus = Domain.Socioboard.Enum.UserTrailStatus.active;
         dbr.Update <Domain.Socioboard.Models.User>(_user);
         _PaymentTransaction.trasactionId = txn_id;
         dbr.Update <Domain.Socioboard.Models.PaymentTransaction>(_PaymentTransaction);
     }
     catch (Exception ex)
     {
         _logger.LogError("UpdateRecurringUser======" + ex.StackTrace);
         _logger.LogError("UpdateRecurringUser=========" + ex.Message);
     }
     return(Ok());
 }
        public IActionResult UpdateRecurringUser(string subscr_id, string txn_id, DateTime subscr_date, string payer_email, string Payername, string payment_status, string item_name, string amount, string media)
        {
            try
            {
                string path = _appEnv.WebRootPath + "\\views\\mailtemplates\\invoice.html";
                string html = System.IO.File.ReadAllText(path);
                html = html.Replace("[paymentId]", txn_id);
                html = html.Replace("[subscr_date]", subscr_date.ToString());
                html = html.Replace("[payer_email]", payer_email);
                html = html.Replace("[Payername]", Payername);
                html = html.Replace("[payment_status]", payment_status);
                html = html.Replace("[item_name]", item_name);
                html = html.Replace("[amount]", amount + "$");
                html = html.Replace("[media]", media);
                _emailSender.SendMailSendGrid(_appSettings.frommail, "", payer_email, "", "", "Socioboard Payment Invoice", html, _appSettings.SendgridUserName, _appSettings.SendGridPassword);

                Model.DatabaseRepository dbr = new Model.DatabaseRepository(_logger, _appEnv);
                Domain.Socioboard.Models.PaymentTransaction _PaymentTransaction = dbr.FindSingle <Domain.Socioboard.Models.PaymentTransaction>(t => t.paymentId.Contains(subscr_id));
                Domain.Socioboard.Models.User _user = dbr.FindSingle <Domain.Socioboard.Models.User>(x => x.Id == _PaymentTransaction.userid);
                _user.ExpiryDate  = _user.ExpiryDate.AddDays(30);
                _user.TrailStatus = Domain.Socioboard.Enum.UserTrailStatus.active;
                dbr.Update <Domain.Socioboard.Models.User>(_user);
                _PaymentTransaction.trasactionId  = txn_id;
                _PaymentTransaction.paymentdate   = DateTime.UtcNow;
                _PaymentTransaction.payeremail    = payer_email;
                _PaymentTransaction.Payername     = Payername;
                _PaymentTransaction.paymentstatus = payment_status;
                _PaymentTransaction.itemname      = item_name;
                _PaymentTransaction.media         = media;
                _PaymentTransaction.subscrdate    = subscr_date;
                _PaymentTransaction.amount        = amount;
                dbr.Update(_PaymentTransaction);
            }
            catch (Exception ex)
            {
                _logger.LogError("UpdateRecurringUser======" + ex.StackTrace);
                _logger.LogError("UpdateRecurringUser=========" + ex.Message);
            }
            return(Ok());
        }
Example #8
0
        public static string EditFeedUrl(string NewFeedUrl, string OldFeedUrl, string RssId, Helper.AppSettings _appSettings, Model.DatabaseRepository dbr)
        {
            Domain.Socioboard.Models.RssFeedUrl _RssFeedUrl = new Domain.Socioboard.Models.RssFeedUrl();
            _RssFeedUrl        = dbr.Find <Domain.Socioboard.Models.RssFeedUrl>(t => t.rssurl.Contains(OldFeedUrl)).FirstOrDefault();
            _RssFeedUrl.rssurl = NewFeedUrl;
            dbr.Update <Domain.Socioboard.Models.RssFeedUrl>(_RssFeedUrl);
            _RssFeedUrl = dbr.FindSingle <Domain.Socioboard.Models.RssFeedUrl>(t => t.rssurl.Contains(NewFeedUrl));
            try
            {
                MongoRepository _RssRepository         = new MongoRepository("Rss", _appSettings);
                var             builders               = Builders <BsonDocument> .Filter;
                FilterDefinition <BsonDocument> filter = builders.Eq("strId", RssId);
                var update = Builders <BsonDocument> .Update.Set("RssFeedUrl", NewFeedUrl).Set("rssFeedUrl", _RssFeedUrl);

                _RssRepository.Update <Domain.Socioboard.Models.Mongo.Rss>(update, filter);
                return("Success");
            }
            catch (Exception ex)
            {
                return("Error");
            }
        }
        public IActionResult PostBlueSnapSubscription(string XMLData, string emailId)
        {
            string responseFromServer = string.Empty;

            try
            {
                // Create a request using a URL that can receive a post.
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://sandbox.bluesnap.com/services/2/recurring/subscriptions");
                // Set the Method property of the request to POST.
                request.Method = "POST";
                request.Headers["Authorization"] = "Basic " + _appSettings.bluesnapBase64;
                request.UserAgent = ".NET Framework Test Client";
                string postData  = XMLData;
                byte[] byteArray = Encoding.UTF8.GetBytes(postData);
                request.ContentType   = "application/xml";
                request.ContentLength = byteArray.Length;

                ServicePointManager.Expect100Continue = true;
                ServicePointManager.SecurityProtocol  = SecurityProtocolType.Tls12;

                Stream dataStream = request.GetRequestStream();
                dataStream.Write(byteArray, 0, byteArray.Length);
                dataStream.Close();

                // Get the response.

                HttpWebResponse myHttpWebResponse = (HttpWebResponse)request.GetResponse();
                Console.WriteLine((myHttpWebResponse.StatusDescription));
                dataStream = myHttpWebResponse.GetResponseStream();
                StreamReader reader = new StreamReader(dataStream);
                responseFromServer = reader.ReadToEnd();
                Console.WriteLine(responseFromServer);
                reader.Close();
                dataStream.Close();
                myHttpWebResponse.Close();
            }
            catch (WebException wex)
            {
                var pageContent = new StreamReader(wex.Response.GetResponseStream())
                                  .ReadToEnd();

                Console.WriteLine(wex.Message);
                return(BadRequest());
            }



            DatabaseRepository dbr = new Model.DatabaseRepository(_logger, _appEnv);

            try
            {
                //JSON
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(responseFromServer);
                JObject jsonTextResponse = JObject.Parse(JsonConvert.SerializeXmlNode(doc));


                User userObj = dbr.FindSingle <User>(t => t.EmailId == emailId);

                PaymentTransaction objPaymentTransaction = new PaymentTransaction();
                objPaymentTransaction.amount       = jsonTextResponse["recurring-subscription"]["recurring-charge-amount"].ToString();
                objPaymentTransaction.userid       = userObj.Id;
                objPaymentTransaction.email        = userObj.EmailId;
                objPaymentTransaction.paymentdate  = DateTime.UtcNow;
                objPaymentTransaction.trasactionId = jsonTextResponse["recurring-subscription"]["subscription-id"].ToString();
                try
                {
                    objPaymentTransaction.paymentId = jsonTextResponse["recurring-subscription"]["charge"]["charge-id"].ToString();
                }
                catch
                {
                    objPaymentTransaction.paymentId = "NA";
                }
                objPaymentTransaction.PaymentType = Domain.Socioboard.Enum.PaymentType.bluesnap;
                try
                {
                    objPaymentTransaction.paymentstatus = jsonTextResponse["recurring-subscription"]["status"].ToString();
                }
                catch
                {
                    objPaymentTransaction.paymentstatus = "NA";
                }
                objPaymentTransaction.itemname  = "Socioboard" + userObj.AccountType.ToString();
                objPaymentTransaction.Payername = userObj.FirstName + " " + userObj.LastName;
                objPaymentTransaction.email     = userObj.EmailId;
                dbr.Add <PaymentTransaction>(objPaymentTransaction);

                userObj.ExpiryDate          = DateTime.Now.AddYears(1);
                userObj.PaymentStatus       = Domain.Socioboard.Enum.SBPaymentStatus.Paid;
                userObj.TrailStatus         = Domain.Socioboard.Enum.UserTrailStatus.active;
                userObj.PayPalAccountStatus = Domain.Socioboard.Enum.PayPalAccountStatus.added;
                userObj.PaymentType         = Domain.Socioboard.Enum.PaymentType.bluesnap;

                dbr.Update <User>(userObj);

                return(Ok());
            }
            catch
            {
                return(BadRequest());
            }
        }
Example #10
0
        public static string AddRssContentsUrl(string keywords, long userId, Helper.AppSettings _appSettings, Model.DatabaseRepository dbr)
        {
            MongoRepository _rssNewsContents = new MongoRepository("RssNewsContents", _appSettings);
            //Domain.Socioboard.Models.RssFeedUrl _RssFeedUrl = dbr.FindSingle<Domain.Socioboard.Models.RssFeedUrl>(t => t.rssurl.Contains(url));
            List <string> list = new List <string>();

            list = findUrl(keywords).ToList();

            Domain.Socioboard.Models.Mongo.RssNewsContents _rssnews = new Domain.Socioboard.Models.Mongo.RssNewsContents();

            Domain.Socioboard.Models.RssFeedUrl _RssContentFeeds = new Domain.Socioboard.Models.RssFeedUrl();


            foreach (var urlValue in list)
            {
                if (urlValue != null)
                {
                    string rt = ParseFeedUrl(urlValue.ToString(), keywords, userId.ToString(), _appSettings);

                    _RssContentFeeds = dbr.FindSingle <Domain.Socioboard.Models.RssFeedUrl>(t => t.rssurl.Contains(urlValue) && t.Keywords != null);

                    if (_RssContentFeeds != null)
                    {
                        //return _RssFeedUrl.ToString();
                    }
                    else
                    {
                        _RssContentFeeds            = new Domain.Socioboard.Models.RssFeedUrl();
                        _RssContentFeeds.rssurl     = urlValue;
                        _RssContentFeeds.LastUpdate = DateTime.UtcNow;
                        _RssContentFeeds.Keywords   = keywords;
                        try
                        {
                            dbr.Add <Domain.Socioboard.Models.RssFeedUrl>(_RssContentFeeds);
                        }
                        catch (Exception error)
                        {
                        }

                        //_RssContentFeedUrl = dbr.FindSingle<Domain.Socioboard.Models.RssFeedUrl>(t => t.rssurl.Contains(urlValue) && t.Keywords == null);
                        //return urlValue;
                    }
                    var ret  = _rssNewsContents.Find <Domain.Socioboard.Models.Mongo.RssNewsContents>(t => t.RssFeedUrl.Equals(urlValue) && t.ProfileId.Contains(userId.ToString()));
                    var task = Task.Run(async() =>
                    {
                        return(await ret);
                    });
                    int count = task.Result.Count;
                    if (count < 1)
                    {
                        _rssnews.Id         = ObjectId.GenerateNewId();
                        _rssnews.ProfileId  = userId.ToString();
                        _rssnews.RssFeedUrl = urlValue.ToString();
                        _rssnews.LastUpdate = Domain.Socioboard.Helpers.SBHelper.ConvertToUnixTimestamp(DateTime.UtcNow);
                        _rssNewsContents.Add(_rssnews);
                    }
                    else
                    {
                        return("Data already added");
                    }
                }
            }
            return("added successfully");
        }
Example #11
0
        public static string saveContentDataIdReposi(List <Domain.Socioboard.Models.Mongo.ContentFeedsShareathon> shareathon, long userId, string fbPageId, int timeInterval, Helper.Cache _redisCache, Helper.AppSettings settings, Model.DatabaseRepository dbr)
        {
            string[] lstProfileIds = null;
            if (fbPageId != null)
            {
                lstProfileIds = fbPageId.Split(',');
                fbPageId      = lstProfileIds[0];
            }

            MongoRepository mongorepo        = new MongoRepository("ContentFeedsShareathon", settings);
            MongoRepository mongoreposhareId = new MongoRepository("ContentStudioShareathonIdData", settings);



            int totalval = 0;

            // DateTime timeval = DateTime.Now;
            foreach (var fbid in lstProfileIds)
            {
                Domain.Socioboard.Models.Facebookaccounts listfb = dbr.FindSingle <Domain.Socioboard.Models.Facebookaccounts>(t => t.FbUserId == fbid);
                int    countval     = 0;
                int    countitem    = 0;
                string timevalue    = null;
                string sectimevalue = null;
                foreach (var item in shareathon)
                {
                    var retval  = mongoreposhareId.Find <Domain.Socioboard.Models.Mongo.ContentStudioShareathonIdData>(t => t.FbPageId.Contains(fbid) && t.postId == item.postId);
                    var taskval = Task.Run(async() =>
                    {
                        return(await retval);
                    });
                    int countvalue = taskval.Result.Count;
                    if (countvalue < 1)
                    {
                        Domain.Socioboard.Models.Mongo.ContentStudioShareathonIdData lstIdforPost = new Domain.Socioboard.Models.Mongo.ContentStudioShareathonIdData();
                        lstIdforPost.Id                  = ObjectId.GenerateNewId();
                        lstIdforPost.strId               = ObjectId.GenerateNewId().ToString();
                        lstIdforPost.FbPageId            = fbid;
                        lstIdforPost.Status              = false;
                        lstIdforPost.UserId              = listfb.UserId;
                        lstIdforPost.Timeintervalminutes = timeInterval;
                        lstIdforPost.postId              = item.postId;
                        lstIdforPost.lastsharestamp      = SBHelper.ConvertToUnixTimestamp(DateTime.UtcNow);
                        if (countitem == 0)
                        {
                            lstIdforPost.latsSharetime = DateTime.UtcNow;
                        }
                        else
                        {
                            // a.AddMinutes
                            DateTime secval = Convert.ToDateTime(timevalue);
                            lstIdforPost.latsSharetime = secval.AddMinutes(timeInterval);//timevalue.latsSharetime.AddMinutes(timeInterval);
                            // var result = TimeSpan.FromMinutes(timeInterval);
                            //  lstIdforPost.lastsharestamp = lstIdforPost.lastsharestamp + datetotimestamp;
                        }


                        try
                        {
                            mongoreposhareId.Add(lstIdforPost);
                        }
                        catch (Exception ex)
                        {
                            //return "not added";
                        }
                        DateTime timeval = lstIdforPost.latsSharetime;
                        timevalue = timeval.ToString();
                    }
                    int count = 0;
                    try
                    {
                        var ret  = mongorepo.Find <Domain.Socioboard.Models.Mongo.ContentFeedsShareathon>(t => t.postId.Contains(item.postId) && t.FbPageId.Contains(fbid));
                        var task = Task.Run(async() =>
                        {
                            return(await ret);
                        });
                        count = task.Result.Count;
                    }
                    catch
                    {
                        var ret  = mongorepo.Find <Domain.Socioboard.Models.Mongo.ContentFeedsShareathon>(t => t.strId.Contains(item.strId) && t.FbPageId.Contains(fbid));
                        var task = Task.Run(async() =>
                        {
                            return(await ret);
                        });
                        count = task.Result.Count;
                    }


                    if (count < 1)
                    {
                        Domain.Socioboard.Models.Mongo.ContentFeedsShareathon lstforShareathon = new Domain.Socioboard.Models.Mongo.ContentFeedsShareathon();

                        lstforShareathon.Id                  = ObjectId.GenerateNewId();
                        lstforShareathon.strId               = ObjectId.GenerateNewId().ToString();
                        lstforShareathon.FbPageId            = fbid;
                        lstforShareathon.postId              = item.postId;
                        lstforShareathon.networkType         = item.networkType;
                        lstforShareathon.title               = item.title;
                        lstforShareathon.facebookAccount     = listfb.FbUserName;
                        lstforShareathon.ImageUrl            = item.ImageUrl;
                        lstforShareathon.postUrl             = item.postUrl;
                        lstforShareathon.videourl            = item.videourl;
                        lstforShareathon.UserId              = userId;
                        lstforShareathon.Timeintervalminutes = timeInterval;
                        lstforShareathon.lastsharestamp      = SBHelper.ConvertToUnixTimestamp(DateTime.UtcNow);

                        lstforShareathon.Status = false;
                        if (countitem == 0)
                        {
                            lstforShareathon.latsSharetime = DateTime.UtcNow;
                        }
                        else
                        {
                            // a.AddMinutes
                            DateTime sectableaddtime = Convert.ToDateTime(sectimevalue);
                            lstforShareathon.latsSharetime = sectableaddtime.AddMinutes(timeInterval);
                        }
                        try
                        {
                            mongorepo.Add(lstforShareathon);
                            countval++;
                        }
                        catch (Exception ex)
                        {
                            //return "not added";
                        }

                        DateTime timevalsec = lstforShareathon.latsSharetime;
                        sectimevalue = timevalsec.ToString();
                    }
                    else
                    {
                        // return "some problem while adding";
                    }
                    countitem++;
                    totalval = countval;
                }
            }


            if (totalval > 0)
            {
                return("added successfully");
            }
            else
            {
                return("feed has already added");
            }
        }