private void TxtAddQuestionOnTouch(object sender, View.TouchEventArgs e)
        {
            try
            {
                if (e.Event.Action != MotionEventActions.Down)
                {
                    return;
                }

                if (MAdapter.ItemCount < 4)
                {
                    TypeDialog = "AddQuestion";

                    var dialogList = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light);

                    var arrayAdapter = WoWonderTools.GetAddQuestionList(this).Select(item => item.Value).ToList();

                    dialogList.Title(GetText(Resource.String.Lbl_TypeQuestion));
                    dialogList.Items(arrayAdapter);
                    dialogList.NegativeText(GetText(Resource.String.Lbl_Close)).OnNegative(this);
                    dialogList.AlwaysCallSingleChoiceCallback();
                    dialogList.ItemsCallback(this).Build().Show();
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
        private void TxtAddQuestionOnTouch(object sender, View.TouchEventArgs e)
        {
            try
            {
                if (e?.Event?.Action != MotionEventActions.Down)
                {
                    return;
                }

                switch (MAdapter.ItemCount)
                {
                case < 4:
                {
                    TypeDialog = "AddQuestion";

                    var dialogList = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light);

                    var arrayAdapter = WoWonderTools.GetAddQuestionList(this).Select(item => item.Value).ToList();

                    dialogList.Title(GetText(Resource.String.Lbl_TypeQuestion)).TitleColorRes(Resource.Color.primary);
                    dialogList.Items(arrayAdapter);
                    dialogList.NegativeText(GetText(Resource.String.Lbl_Close)).OnNegative(this);
                    dialogList.AlwaysCallSingleChoiceCallback();
                    dialogList.ItemsCallback(this).Build().Show();
                    break;
                }
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
        public void OnSelection(MaterialDialog p0, View p1, int itemId, ICharSequence itemString)
        {
            try
            {
                if (TypeDialog == "Categories")
                {
                    CategoryId       = CategoriesController.ListCategoriesJob.FirstOrDefault(categories => categories.CategoriesName == itemString.ToString())?.CategoriesId;
                    TxtCategory.Text = itemString.ToString();
                }
                else if (TypeDialog == "JobType")
                {
                    JobTypeId       = WoWonderTools.GetJobTypeList(this)?.FirstOrDefault(a => a.Value == itemString.ToString()).Key.ToString();
                    TxtJobType.Text = itemString.ToString();
                }
                else if (TypeDialog == "SalaryDate")
                {
                    SalaryDateId       = WoWonderTools.GetSalaryDateList(this)?.FirstOrDefault(a => a.Value == itemString.ToString()).Key.ToString();
                    TxtSalaryDate.Text = itemString.ToString();
                }
                else if (TypeDialog == "Currency")
                {
                    TxtCurrency.Text = itemString.ToString();
                    CurrencyId       = itemId.ToString();
                }
                else if (TypeDialog == "AddQuestion")
                {
                    TxtAddQuestion.Text = GetText(Resource.String.Lbl_AddQuestion) + "(" + MAdapter.ItemCount + ")";

                    var addQuestionId = WoWonderTools.GetAddQuestionList(this)?.FirstOrDefault(a => a.Value == itemString.ToString()).Key.ToString();
                    //SetQuestionOne(addQuestionId);
                    MAdapter.QuestionList.Add(new QuestionJob()
                    {
                        Id           = MAdapter.ItemCount,
                        QuestionType = addQuestionId
                    });
                    MAdapter.NotifyItemInserted(MAdapter.QuestionList.IndexOf(MAdapter.QuestionList.Last()));
                }
                else if (TypeDialog == "AddQuestionAdapter")
                {
                    TxtAddQuestion.Text = GetText(Resource.String.Lbl_AddQuestion) + "(" + MAdapter.ItemCount + ")";

                    var addQuestionId = WoWonderTools.GetAddQuestionList(this)?.FirstOrDefault(a => a.Value == itemString.ToString()).Key.ToString();

                    var data = MAdapter.QuestionList.FirstOrDefault(a => a.Id == ItemQuestionJob.Id && a.QuestionType == ItemQuestionJob.QuestionType);
                    if (data != null)
                    {
                        data.QuestionType = addQuestionId;
                        MAdapter.NotifyItemChanged(MAdapter.QuestionList.IndexOf(data));
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public void OpenDialogSetQuestion(QuestionJob item)
        {
            try
            {
                ItemQuestionJob = item;

                TypeDialog = "AddQuestionAdapter";

                var dialogList   = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light);
                var arrayAdapter = WoWonderTools.GetAddQuestionList(this).Select(pair => pair.Value).ToList();
                dialogList.Title(GetText(Resource.String.Lbl_TypeQuestion));
                dialogList.Items(arrayAdapter);
                dialogList.NegativeText(GetText(Resource.String.Lbl_Close)).OnNegative(this);
                dialogList.AlwaysCallSingleChoiceCallback();
                dialogList.ItemsCallback(this).Build().Show();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public void OnSelection(MaterialDialog p0, View p1, int itemId, ICharSequence itemString)
        {
            try
            {
                switch (TypeDialog)
                {
                case "Categories":
                    CategoryId       = CategoriesController.ListCategoriesJob.FirstOrDefault(categories => categories.CategoriesName == itemString.ToString())?.CategoriesId;
                    TxtCategory.Text = itemString.ToString();
                    break;

                case "JobType":
                    JobTypeId       = WoWonderTools.GetJobTypeList(this)?.FirstOrDefault(a => a.Value == itemString.ToString()).Key.ToString();
                    TxtJobType.Text = itemString.ToString();
                    break;

                case "SalaryDate":
                    SalaryDateId       = WoWonderTools.GetSalaryDateList(this)?.FirstOrDefault(a => a.Value == itemString.ToString()).Key.ToString();
                    TxtSalaryDate.Text = itemString.ToString();
                    break;

                case "Currency":
                    TxtCurrency.Text = itemString.ToString();
                    CurrencyId       = WoWonderTools.GetIdCurrency(itemString.ToString());
                    break;

                case "AddQuestion":
                {
                    TxtAddQuestion.Text = GetText(Resource.String.Lbl_AddQuestion) + "(" + MAdapter.ItemCount + ")";

                    var addQuestionId = WoWonderTools.GetAddQuestionList(this)?.FirstOrDefault(a => a.Value == itemString.ToString()).Key.ToString();
                    //SetQuestionOne(addQuestionId);
                    MAdapter.QuestionList.Add(new QuestionJob
                        {
                            Id           = MAdapter.ItemCount,
                            QuestionType = addQuestionId
                        });
                    MAdapter.NotifyItemInserted(MAdapter.QuestionList.IndexOf(MAdapter.QuestionList.Last()));
                    break;
                }

                case "AddQuestionAdapter":
                {
                    TxtAddQuestion.Text = GetText(Resource.String.Lbl_AddQuestion) + "(" + MAdapter.ItemCount + ")";

                    var addQuestionId = WoWonderTools.GetAddQuestionList(this)?.FirstOrDefault(a => a.Value == itemString.ToString()).Key.ToString();

                    var data = MAdapter.QuestionList.FirstOrDefault(a => a.Id == ItemQuestionJob.Id && a.QuestionType == ItemQuestionJob.QuestionType);
                    if (data != null)
                    {
                        data.QuestionType = addQuestionId;
                        MAdapter.NotifyItemChanged(MAdapter.QuestionList.IndexOf(data));
                    }

                    break;
                }
                }
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }