public void AddReportList(string incommingNumber)
        {
            UserReport report = new UserReport();

            report.phoneNumber = incommingNumber;
            report.reportDate  = DateTime.Now;
            report.IsSync      = false;
            reportDatabaseHelper.AddReport(report);
        }
Exemplo n.º 2
0
        // HÀNH ĐỘNG NHẤN PHÍM REPORT
        public async void OnReportAsync(object sender, EventArgs e)
        {
            var  mi     = ((MenuItem)sender);
            bool answer = await DisplayAlert("Confirm", "Do you want to report " + mi.CommandParameter.ToString() + " ?", "Yes", "No");

            if (answer)
            {
                report             = new UserReport();
                report.phoneNumber = mi.CommandParameter.ToString();
                report.reportDate  = DateTime.Now;
                report.IsSync      = false;
                reportDatabaseHelper.AddReport(report);
                LoadData();
            }
        }
    public void ManualReport(string incommingNumber)
    {
        // MANUAL CREATE CONNECTION
        Android_SQLite   android_SQLite = new Android_SQLite();
        SQLiteConnection connection     = android_SQLite.GetConnection();

        reportDatabaseHelper = new UserReportDatabaseHelper("" +
                                                            "IF_WE_ADD_THIS_TEXT_OUR_CLASS_WILL_" +
                                                            "USE_A_DEFALT_CONSTRUCTOR_WITHOUT_PLATFORM_ERROR" +
                                                            "WHEN_RUNNING_IN_BACKGROUND");

        // MANUAL ADD CONNECT FOR THIS CLASS
        reportDatabaseHelper.connection = connection;
        reportDatabaseHelper.CreateTable();

        UserReport report = new UserReport();

        report.phoneNumber = incommingNumber;
        report.reportDate  = DateTime.Now;
        report.IsSync      = false;
        reportDatabaseHelper.AddReport(report);
    }
Exemplo n.º 4
0
        void OnButtonClicked(object sender, EventArgs args)
        {
            if (string.IsNullOrEmpty(txtSDT.Text))
            {
                return;
            }
            if (isPhoneNumber(txtSDT.Text))
            {
                report = new UserReport();
                reportDatabaseHelper = new UserReportDatabaseHelper();

                report.phoneNumber = txtSDT.Text;
                report.reportDate  = DateTime.Now;
                report.IsSync      = false;
                reportDatabaseHelper.AddReport(report);
                CloseAllPopup();
            }
            else
            {
                DisplayAlert("Error", "Wrong fortmat!!!", "OK");
            }
        }