Exemplo n.º 1
0
        //private void GetInstagramMessages(string userId)
        //{
        //    string query = "select Insta_inboxUserId,PlateformType,Message,ImageSource from TblJobFb where Fbcomment_InboxUserId='" + userId + "'";
        //    var dt = sql.GetDataTable(query);
        //    foreach (DataRow item in dt.Rows)
        //    {
        //        string InstainboxUserId = Convert.ToString(item["Insta_inboxUserId"]);
        //        string PlateformType = Convert.ToString(item["PlateformType"]);
        //        string Message = Convert.ToString(item["Message"]);
        //        string ImgSource = Convert.ToString(item["ImageSource"]);
        //        messagingInstapageListInfo.Add(new FbUserMessageInfo() { Message = Message });
        //    }
        //}

        public ObservableCollection <SocialUser> GetInstaUserList(string userId)
        {
            SqLiteHelper sql = new SqLiteHelper();

            ObservableCollection <SocialUser> InstaListmembers = new ObservableCollection <SocialUser>();
            string query = "select Insta_inboxUserId,Insta_inboxUserName,Insta_inboxUserImage,InstaInboxNavigationUrl from Tbl_Instagram where Parent_User_Id='" + userId + "'";
            var    dt    = sql.GetDataTable(query);

            foreach (DataRow item in dt.Rows)
            {
                string InstainboxUserId        = Convert.ToString(item["Insta_inboxUserId"]);
                string Insta_inboxUserName     = Convert.ToString(item["Insta_inboxUserName"]);
                string Insta_inboxUserImage    = Convert.ToString(item["Insta_inboxUserImage"]);
                string InstaInboxNavigationUrl = Convert.ToString(item["InstaInboxNavigationUrl"]);
                if (!InstaListmembers.Any(m => m.InboxUserName.Equals(Insta_inboxUserName)))
                {
                    InstaListmembers.Add(new SocialUser()
                    {
                        InboxUserId        = InstainboxUserId,
                        InboxUserName      = Insta_inboxUserName,
                        InboxUserImage     = Insta_inboxUserImage,
                        InboxNavigationUrl = InstaInboxNavigationUrl,
                        MessageUserType    = TabType.Instagram.ToString()
                    });
                }
            }
            return(InstaListmembers);
        }
Exemplo n.º 2
0
        public ObservableCollection <SocialUser> GetFacebookListData(string userId)
        {
            SqLiteHelper sql = GetSqliteHelper();
            ObservableCollection <SocialUser> FbPageListmembers = new ObservableCollection <SocialUser>();

            string query = "select Fbcomment_InboxUserId, Fbcomment_InboxUserName,Fbcomment_InboxUserImage,FBInboxNavigationUrl from TblFbComment where Parent_User_Id='" + userId + "'";

            var dt = sql.GetDataTable(query);

            foreach (DataRow item in dt.Rows)
            {
                string Fbcomment_InboxUserId    = Convert.ToString(item["Fbcomment_InboxUserId"]);
                string Fbcomment_InboxUserName  = Convert.ToString(item["Fbcomment_InboxUserName"]);
                string Fbcomment_InboxUserImage = Convert.ToString(item["Fbcomment_InboxUserImage"]);
                string FBInboxNavigationUrl     = Convert.ToString(item["FBInboxNavigationUrl"]);
                if (!FbPageListmembers.Any(m => m.InboxUserName.Equals(Fbcomment_InboxUserName)))
                {
                    FbPageListmembers.Add(new SocialUser()
                    {
                        InboxUserId        = Fbcomment_InboxUserId,
                        InboxUserName      = Fbcomment_InboxUserName,
                        InboxUserImage     = Fbcomment_InboxUserImage,
                        InboxNavigationUrl = FBInboxNavigationUrl,
                        MessageUserType    = TabType.Facebook.ToString()
                    });
                }
            }

            return(FbPageListmembers);
        }
Exemplo n.º 3
0
        public ObservableCollection <SocialUser> GetLeftMessengerListData(string userId, TabType tabType, string pageid)
        {
            SqLiteHelper sql = new SqLiteHelper();
            ObservableCollection <SocialUser> userListInfo = new ObservableCollection <SocialUser>();


            //string query = string.Format("select FacebookId,DisplayName,ImageUrl,NavigationUrl from FacebookUsers where Parent_User_Id='{0}' and JobType={1} ", userId, (int)tabType);
            string query = "select FacebookId,DisplayName,ImageUrl,NavigationUrl,PageId from FacebookUsers where Parent_User_Id='" + userId + "' and JobType='" + (int)tabType + "' and PageId='" + pageid + "'";

            var dt = sql.GetDataTable(query);

            foreach (DataRow item in dt.Rows)
            {
                string inboxUserId        = Convert.ToString(item["FacebookId"]);
                string inboxUserName      = Convert.ToString(item["DisplayName"]);
                string inboxUserImage     = Convert.ToString(item["ImageUrl"]);
                string inboxNavigationUrl = Convert.ToString(item["NavigationUrl"]);
                string pageId             = Convert.ToString(item["PageId"]);

                //if (!UserListInfo.Any(m => m.InboxUserName.Equals(M_inboxUserName)))
                if (!userListInfo.Any(m => m.InboxUserId.Equals(inboxUserId)))
                {
                    userListInfo.Add(new SocialUser()
                    {
                        InboxUserId        = inboxUserId, InboxUserName = inboxUserName,
                        InboxUserImage     = inboxUserImage,
                        InboxNavigationUrl = inboxNavigationUrl,
                        MessageUserType    = tabType.ToString(),
                        PageId             = pageId
                    });
                }
            }
            return(userListInfo);
        }
        private void GetAllItems()
        {
            string       query = "select * from TblMessage";
            SqLiteHelper sql   = new SqLiteHelper();

            DtCampaign = sql.GetDataTable(query);
            // dataGrid.ItemsSource = DtCampaign;
        }