Esempio n. 1
0
        //Get Data Group and set Categories
        private void Get_Data_Group()
        {
            try
            {
                if (Groups_Type == "Joined_UserGroups")
                {
                    _JoinedGroups_Data =
                        JsonConvert.DeserializeObject <Get_User_Data_Object.Joined_Groups>(
                            Intent.GetStringExtra("UserGroups"));
                    if (_JoinedGroups_Data != null)
                    {
                        Txt_title.Text = _JoinedGroups_Data.group_title;
                        Txt_name.Text  = _JoinedGroups_Data.username;
                        Txt_about.Text =
                            IMethods.Fun_String.DecodeString(
                                IMethods.Fun_String.DecodeStringWithEnter(_JoinedGroups_Data.about));

                        if (_JoinedGroups_Data.privacy == "0")
                        {
                            RB_Private.Checked = true;
                            RB_Public.Checked  = false;
                        }
                        else
                        {
                            RB_Private.Checked = false;
                            RB_Public.Checked  = true;
                        }

                        GroupPrivacy = _JoinedGroups_Data.privacy;
                        CategoryId   = _JoinedGroups_Data.category_id;
                        //set value list Categories
                        CategoriesAdapter.Set_Categories(CategoryId, "EditInfoGroup");
                    }
                }
                else if (Groups_Type == "Joined_MyGroups")
                {
                    _MyGroups_Data =
                        JsonConvert.DeserializeObject <Get_Community_Object.Group>(Intent.GetStringExtra("MyGroups"));
                    if (_MyGroups_Data != null)
                    {
                        Txt_title.Text = _MyGroups_Data.GroupName;
                        Txt_name.Text  = _MyGroups_Data.Username;
                        Txt_about.Text =
                            IMethods.Fun_String.DecodeString(
                                IMethods.Fun_String.DecodeStringWithEnter(_MyGroups_Data.About));

                        if (_MyGroups_Data.Privacy == "0")
                        {
                            RB_Private.Checked = true;
                            RB_Public.Checked  = false;
                        }
                        else
                        {
                            RB_Private.Checked = false;
                            RB_Public.Checked  = true;
                        }

                        GroupPrivacy = _MyGroups_Data.Privacy;
                        CategoryId   = _MyGroups_Data.CategoryId;
                        //set value list Categories
                        CategoriesAdapter.Set_Categories(CategoryId, "EditInfoGroup");
                    }
                }
                else if (Groups_Type == "Search_Groups")
                {
                    _SearchGroups_Data =
                        JsonConvert.DeserializeObject <Get_Search_Object.Group>(Intent.GetStringExtra("SearchGroups"));
                    if (_SearchGroups_Data != null)
                    {
                        Txt_title.Text = _SearchGroups_Data.GroupName;
                        Txt_name.Text  = _SearchGroups_Data.Username;
                        Txt_about.Text =
                            IMethods.Fun_String.DecodeString(
                                IMethods.Fun_String.DecodeStringWithEnter(_SearchGroups_Data.About));

                        if (_SearchGroups_Data.Privacy == "0")
                        {
                            RB_Private.Checked = true;
                            RB_Public.Checked  = false;
                        }
                        else
                        {
                            RB_Private.Checked = false;
                            RB_Public.Checked  = true;
                        }

                        GroupPrivacy = _SearchGroups_Data.Privacy;
                        CategoryId   = _SearchGroups_Data.CategoryId;
                        //set value list Categories
                        CategoriesAdapter.Set_Categories(CategoryId, "EditInfoGroup");
                    }
                }
                else if (Groups_Type == "Group_Data")
                {
                    _Group_Data =
                        JsonConvert.DeserializeObject <Get_Group_Data_Object.Group_Data>(
                            Intent.GetStringExtra("GroupData"));
                    if (_Group_Data != null)
                    {
                        Txt_title.Text = _Group_Data.group_title;
                        Txt_name.Text  = _Group_Data.username;
                        Txt_about.Text =
                            IMethods.Fun_String.DecodeString(
                                IMethods.Fun_String.DecodeStringWithEnter(_Group_Data.about));

                        if (_Group_Data.privacy == "0")
                        {
                            RB_Private.Checked = true;
                            RB_Public.Checked  = false;
                        }
                        else
                        {
                            RB_Private.Checked = false;
                            RB_Public.Checked  = true;
                        }

                        GroupPrivacy = _Group_Data.privacy;
                        CategoryId   = _Group_Data.category_id;
                        //set value list Categories
                        CategoriesAdapter.Set_Categories(CategoryId, "EditInfoGroup");
                    }
                }
            }
            catch (Exception e)
            {
                Crashes.TrackError(e);
            }
        }
        //Get Data Page and set Categories
        private void Get_Data_Page()
        {
            try
            {
                if (Pages_Type == "Liked_UserPages")
                {
                    _LikedPages_Data =
                        JsonConvert.DeserializeObject <Get_User_Data_Object.Liked_Pages>(
                            Intent.GetStringExtra("UserPages"));
                    if (_LikedPages_Data != null)
                    {
                        Txt_title.Text = _LikedPages_Data.page_title;
                        Txt_name.Text  = _LikedPages_Data.username;
                        Txt_about.Text =
                            IMethods.Fun_String.DecodeString(
                                IMethods.Fun_String.DecodeStringWithEnter(_LikedPages_Data.about));

                        CategoryId = _LikedPages_Data.page_category;
                        //set value list Categories
                        CategoriesAdapter.Set_Categories(CategoryId, "EditInfoPage");
                    }
                }
                else if (Pages_Type == "Liked_MyPages")
                {
                    _MyPages_Data =
                        JsonConvert.DeserializeObject <Get_Community_Object.Page>(Intent.GetStringExtra("MyPages"));
                    if (_MyPages_Data != null)
                    {
                        Txt_title.Text = _MyPages_Data.PageTitle;
                        Txt_name.Text  = _MyPages_Data.Username;
                        Txt_about.Text =
                            IMethods.Fun_String.DecodeString(
                                IMethods.Fun_String.DecodeStringWithEnter(_MyPages_Data.About));

                        CategoryId = _MyPages_Data.PageCategory;
                        //set value list Categories
                        CategoriesAdapter.Set_Categories(CategoryId, "EditInfoPage");
                    }
                }
                else if (Pages_Type == "Saerch_Pages")
                {
                    _SearchPages_Data =
                        JsonConvert.DeserializeObject <Get_Search_Object.Page>(Intent.GetStringExtra("SaerchPages"));
                    if (_SearchPages_Data != null)
                    {
                        Txt_title.Text = _SearchPages_Data.PageTitle;
                        Txt_name.Text  = _SearchPages_Data.Username;
                        Txt_about.Text =
                            IMethods.Fun_String.DecodeString(
                                IMethods.Fun_String.DecodeStringWithEnter(_SearchPages_Data.About));

                        CategoryId = _SearchPages_Data.PageCategory;
                        //set value list Categories
                        CategoriesAdapter.Set_Categories(CategoryId, "EditInfoPage");
                    }
                }
                else if (Pages_Type == "Page_Data")
                {
                    _Page_Data =
                        JsonConvert.DeserializeObject <Get_Page_Data_Object.Page_Data>(
                            Intent.GetStringExtra("PageData"));
                    if (_Page_Data != null)
                    {
                        Txt_title.Text = _Page_Data.page_title;
                        Txt_name.Text  = _Page_Data.username;
                        Txt_about.Text =
                            IMethods.Fun_String.DecodeString(
                                IMethods.Fun_String.DecodeStringWithEnter(_Page_Data.about));

                        CategoryId = _Page_Data.page_category;
                        //set value list Categories
                        CategoriesAdapter.Set_Categories(CategoryId, "EditInfoPage");
                    }
                }
                else if (Pages_Type == "Liked_PromotedPages")
                {
                    _PromotedPages_Data =
                        JsonConvert.DeserializeObject <Get_General_Data_Object.Promoted_Pages>(
                            Intent.GetStringExtra("PromotedPages"));
                    if (_PromotedPages_Data != null)
                    {
                        Txt_title.Text = _PromotedPages_Data.page_title;
                        Txt_name.Text  = _PromotedPages_Data.username;
                        Txt_about.Text =
                            IMethods.Fun_String.DecodeString(
                                IMethods.Fun_String.DecodeStringWithEnter(_PromotedPages_Data.about));

                        CategoryId = _PromotedPages_Data.page_category;
                        //set value list Categories
                        CategoriesAdapter.Set_Categories(CategoryId, "EditInfoPage");
                    }
                }
            }
            catch (Exception e)
            {
                Crashes.TrackError(e);
            }
        }