Пример #1
0
        internal TagsEntity GetTagByTagId(int TagId)
        {
            TagsEntity results = new TagsEntity();

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "dnb.GetTagByTagId";
                sproc.StoredProceduresParameter.Add(GetParam("@TagId", TagId.ToString(), SQLServerDatatype.IntDataType));
                DataTable dt;
                dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc, "");
                if (dt != null && dt.Rows.Count > 0)
                {
                    TagsAdapter ta = new TagsAdapter();
                    foreach (DataRow rw in dt.Rows)
                    {
                        results = ta.AdaptItem(rw);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(results);
        }
Пример #2
0
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            if (IsInitialized)
            {
                return;
            }

            base.OnViewCreated(view, savedInstanceState);
            _searchView.Hint = AppSettings.LocalizationManager.GetText(LocalizationKeys.SearchHint);
            _searchView.SetFilters(new IInputFilter[] { new TextInputFilter(TextInputFilter.TagFilter) });
            _tagsButton.Text      = AppSettings.LocalizationManager.GetText(LocalizationKeys.Tag);
            _peopleButton.Text    = AppSettings.LocalizationManager.GetText(LocalizationKeys.Users);
            _clearButton.Text     = AppSettings.LocalizationManager.GetText(LocalizationKeys.Clear);
            _emptyQueryLabel.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.EmptyQuery);

            _searchView.TextChanged += OnSearchViewOnTextChanged;

            _categories.SetLayoutManager(new LinearLayoutManager(Activity));
            _users.SetLayoutManager(new LinearLayoutManager(Activity));

            _searchFacade.UserFriendPresenter.SourceChanged += UserFriendPresenterSourceChanged;
            _searchFacade.TagsPresenter.SourceChanged       += TagsPresenterSourceChanged;
            _categoriesAdapter  = new TagsAdapter(_searchFacade.TagsPresenter);
            _usersSearchAdapter = new FollowersAdapter(Activity, _searchFacade.UserFriendPresenter);
            _categories.SetAdapter(_categoriesAdapter);
            _users.SetAdapter(_usersSearchAdapter);

            _scrollListner = new ScrollListener();
            _scrollListner.ScrolledToBottom += GetTags;
            _users.AddOnScrollListener(_scrollListner);

            _categoriesAdapter.Click         += OnClick;
            _usersSearchAdapter.UserAction   += OnClick;
            _usersSearchAdapter.FollowAction += Follow;
            _timer = new Timer(OnTimer);

            _searchView.Typeface    = Style.Regular;
            _clearButton.Typeface   = Style.Regular;
            _clearButton.Visibility = ViewStates.Gone;
            _clearButton.Click     += OnClearClick;
            _tagsButton.Click      += TagsClick;
            _peopleButton.Click    += PeopleClick;
            SwitchSearchType(false);
            _searchView.RequestFocus();

            ((BaseActivity)Activity).OpenKeyboard(_searchView);

            _emptyQueryLabel.Typeface   = Style.Light;
            _emptyQueryLabel.Visibility = ViewStates.Invisible;
        }
Пример #3
0
#pragma warning restore 0649

        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.lyt_post_description);
            Cheeseknife.Inject(this);

            _pageTitle.Typeface   = Style.Semibold;
            _title.Typeface       = Style.Regular;
            _description.Typeface = Style.Regular;
            _postButton.Typeface  = Style.Semibold;
            _postButton.Click    += OnPost;
            _photoFrame.Clickable = true;
            _photoFrame.Click    += PhotoFrameOnClick;
            _postButton.Text      = Localization.Texts.PublishButtonText;
            _postButton.Enabled   = true;

            _localTagsList.SetLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.Horizontal, false));
            _localTagsAdapter        = new SelectedTagsAdapter();
            _localTagsAdapter.Click += LocalTagsAdapterClick;
            _localTagsList.SetAdapter(_localTagsAdapter);
            _localTagsList.AddItemDecoration(new ListItemDecoration((int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 15, Resources.DisplayMetrics)));

            _tagsList.SetLayoutManager(new LinearLayoutManager(this));
            Presenter.SourceChanged += PresenterSourceChanged;
            _tagsAdapter             = new TagsAdapter(Presenter);
            _tagsAdapter.Click      += OnTagsAdapterClick;
            _tagsList.SetAdapter(_tagsAdapter);

            _tag.TextChanged       += OnTagOnTextChanged;
            _tag.KeyboardDownEvent += HideTagsList;
            _tag.OkKeyEvent        += HideTagsList;
            _tag.FocusChange       += OnTagOnFocusChange;

            _topMarginTagsLayout.Click += OnTagsLayoutClick;
            _backButton.Click          += OnBack;
            _rootLayout.Click          += OnRootLayoutClick;

            _timer = new Timer(OnTimer);

            InitPhoto();
            SetPostingTimer();
            SearchTextChanged();

            _model = new PreparePostModel(BasePresenter.User.UserInfo);
        }
        protected View OnCreateDialogView()
        {
            tags.Clear();
            foreach (var currentTag in currentTags)
            {
                tags.Add(currentTag);
            }

            View view = base.OnCreateDialogView();

            listView         = (ListView)view.FindViewById(Resource.Id.tags_list);
            adapter          = new TagsAdapter(this, Context, Resource.Layout.tag_preference_item);
            listView.Adapter = adapter;

            EditText editText = (EditText)view.FindViewById(Resource.Id.new_tag_text);

            ImageButton button = (ImageButton)view.FindViewById(Resource.Id.new_tag_button);

            button.Click += delegate {
                String newTag = editText.Text.ToString();
                editText.Text = null;
                InputMethodManager imm = (InputMethodManager)Context.GetSystemService(
                    Context.InputMethodService);
                imm.HideSoftInputFromWindow(editText.WindowToken, 0);

                if (!UAStringUtil.IsEmpty(newTag))
                {
                    if (tags.Contains(newTag))
                    {
                        ShowDuplicateItemToast();
                    }
                    else
                    {
                        tags.Insert(0, newTag);
                        adapter.NotifyDataSetChanged();
                    }
                }
            };

            return(view);
        }
Пример #5
0
        internal List <TagsEntity> GetAutoAcceptanceFilterTags(string LOBTag)
        {
            List <TagsEntity> results = new List <TagsEntity>();

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "dnb.GetAutoAcceptanceFilterTags";
                sproc.StoredProceduresParameter.Add(GetParam("@LOBTag", string.IsNullOrEmpty(LOBTag) ? null : Convert.ToString(LOBTag), SQLServerDatatype.VarcharDataType));
                DataTable dt = new DataTable();
                dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc, "", DBIntent.Read.ToString());
                if (dt != null && dt.Rows.Count > 0)
                {
                    results = new TagsAdapter().Adapt(dt);
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(results);
        }
Пример #6
0
        internal List <TagsEntity> GetTagByTypeCode(string TagTypeCode)
        {
            List <TagsEntity> results = new List <TagsEntity>();

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "[dnb].[GetTagByTypeCode]";
                sproc.StoredProceduresParameter.Add(GetParam("@TagTypeCode", TagTypeCode.ToString(), SQLServerDatatype.VarcharDataType));
                DataTable dt = new DataTable();
                dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc, "", DBIntent.Read.ToString());
                if (dt != null && dt.Rows.Count > 0)
                {
                    results = new TagsAdapter().Adapt(dt);
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(results);
        }
Пример #7
0
        protected override View OnCreateDialogView()
        {
            tags.Clear();
            tags.AddRange(currentTags);

            View     view     = base.OnCreateDialogView();
            ListView listView = (ListView)view.FindViewById(Resource.Id.tags_list);

            tagsAdapter      = new TagsAdapter(Context, Resource.Layout.tag_preference_item, this);
            listView.Adapter = tagsAdapter;

            EditText editText = (EditText)view.FindViewById(Resource.Id.new_tag_text);

            ImageButton button = (ImageButton)view.FindViewById(Resource.Id.new_tag_button);

            button.Click += (sender, e) =>
            {
                String newTag = editText.Text;
                editText.Text = null;
                InputMethodManager imm = (InputMethodManager)Context.GetSystemService(Context.InputMethodService);
                imm.HideSoftInputFromWindow(editText.WindowToken, 0);

                if (!String.IsNullOrEmpty(newTag))
                {
                    if (tags.Contains(newTag))
                    {
                        Toast.MakeText(Context, Resource.String.duplicate_tag_warning, ToastLength.Short).Show();
                    }
                    else
                    {
                        tags.Add(newTag);
                        tagsAdapter.NotifyDataSetChanged();
                    }
                }
            };

            return(view);
        }
Пример #8
0
        internal List <TagsEntity> GetExportedDataTags(string LOBTag, string SecurityTags, int UserId)
        {
            List <TagsEntity> results = new List <TagsEntity>();

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "[dnb].[GetExportedDataTags]";
                sproc.StoredProceduresParameter.Add(GetParam("@LOBTag", string.IsNullOrEmpty(LOBTag) ? null : Convert.ToString(LOBTag), SQLServerDatatype.VarcharDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@SecurityTags", string.IsNullOrEmpty(SecurityTags) ? null : Convert.ToString(SecurityTags), SQLServerDatatype.VarcharDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@UserId", UserId.ToString(), SQLServerDatatype.IntDataType));
                DataTable dt = new DataTable();
                dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc, "", DBIntent.Read.ToString());
                if (dt != null && dt.Rows.Count > 0)
                {
                    results = new TagsAdapter().Adapt(dt);
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(results);
        }
Пример #9
0
        public List <TagsEntity> GetAllTagsListPaging()
        {
            List <TagsEntity> results = new List <TagsEntity>();

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "dnb.GetTagListPaging";

                string    outParam = "";
                DataTable dt;
                dt = sql.ExecuteDataTableWithOutputParam(CommandType.StoredProcedure, sproc, out outParam, "");

                if (dt != null && dt.Rows.Count > 0)
                {
                    results = new TagsAdapter().Adapt(dt);
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(results);
        }
#pragma warning restore 0649

        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.lyt_post_description);
            Cheeseknife.Bind(this);

            _tag.Hint         = AppSettings.LocalizationManager.GetText(LocalizationKeys.AddHashtag);
            _title.Hint       = AppSettings.LocalizationManager.GetText(LocalizationKeys.EnterPostTitle);
            _description.Hint = AppSettings.LocalizationManager.GetText(LocalizationKeys.EnterPostDescription);
            _postButton.Text  = AppSettings.LocalizationManager.GetText(LocalizationKeys.PublishButtonText);
            _pageTitle.Text   = AppSettings.LocalizationManager.GetText(LocalizationKeys.PostSettings);

            _pageTitle.Typeface   = Style.Semibold;
            _title.Typeface       = Style.Regular;
            _description.Typeface = Style.Regular;
            _postButton.Typeface  = Style.Semibold;
            _postButton.Click    += OnPost;
            _photoFrame.Clickable = true;
            _rotate.Click        += RotateOnClick;

            _postButton.Enabled = true;

            _localTagsList.SetLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.Horizontal, false));
            _localTagsAdapter        = new SelectedTagsAdapter();
            _localTagsAdapter.Click += LocalTagsAdapterClick;
            _localTagsList.SetAdapter(_localTagsAdapter);
            _localTagsList.AddItemDecoration(new ListItemDecoration((int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 15, Resources.DisplayMetrics)));

            var editPost = Intent.GetStringExtra(EditPost);

            if (!string.IsNullOrEmpty(editPost))
            {
                _editpost = JsonConvert.DeserializeObject <Post>(editPost);
                _model    = new PreparePostModel(BasePresenter.User.UserInfo, _editpost.Permlink);
                SetEditPost(_editpost);
                _rotate.Visibility = ViewStates.Gone;
            }
            else
            {
                _model = new PreparePostModel(BasePresenter.User.UserInfo);
                InitPhoto();
                SetPostingTimer();
            }

            _tagsList.SetLayoutManager(new LinearLayoutManager(this));
            Presenter.SourceChanged += PresenterSourceChanged;
            _tagsAdapter             = new TagsAdapter(Presenter);
            _tagsAdapter.Click      += OnTagsAdapterClick;
            _tagsList.SetAdapter(_tagsAdapter);

            _tag.TextChanged       += OnTagOnTextChanged;
            _tag.KeyboardDownEvent += HideTagsList;
            _tag.OkKeyEvent        += HideTagsList;
            _tag.FocusChange       += OnTagOnFocusChange;

            _topMarginTagsLayout.Click += OnTagsLayoutClick;
            _backButton.Click          += OnBack;
            _rootLayout.Click          += OnRootLayoutClick;

            _timer = new Timer(OnTimer);

            SearchTextChanged();
        }