Exemplo n.º 1
0
        /// <summary>
        /// Event taked when the text from Edt_la_ac_cadastrousuario_bithday changes
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Edt_la_ac_cadastrousuario_cpf_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
        {
            if (lockchange)
            {
                return;
            }

            if (string.IsNullOrEmpty(edt_la_ac_cadastrousuario_cpf.Text))
            {
                return;
            }

            lockchange = true;

            if (!(edt_la_ac_cadastrousuario_cpf.Text.ElementAt(edt_la_ac_cadastrousuario_cpf.Text.Length - 1).ToString().Contains('0') ||
                  edt_la_ac_cadastrousuario_cpf.Text.ElementAt(edt_la_ac_cadastrousuario_cpf.Text.Length - 1).ToString().Contains('1') ||
                  edt_la_ac_cadastrousuario_cpf.Text.ElementAt(edt_la_ac_cadastrousuario_cpf.Text.Length - 1).ToString().Contains('2') ||
                  edt_la_ac_cadastrousuario_cpf.Text.ElementAt(edt_la_ac_cadastrousuario_cpf.Text.Length - 1).ToString().Contains('3') ||
                  edt_la_ac_cadastrousuario_cpf.Text.ElementAt(edt_la_ac_cadastrousuario_cpf.Text.Length - 1).ToString().Contains('4') ||
                  edt_la_ac_cadastrousuario_cpf.Text.ElementAt(edt_la_ac_cadastrousuario_cpf.Text.Length - 1).ToString().Contains('5') ||
                  edt_la_ac_cadastrousuario_cpf.Text.ElementAt(edt_la_ac_cadastrousuario_cpf.Text.Length - 1).ToString().Contains('6') ||
                  edt_la_ac_cadastrousuario_cpf.Text.ElementAt(edt_la_ac_cadastrousuario_cpf.Text.Length - 1).ToString().Contains('7') ||
                  edt_la_ac_cadastrousuario_cpf.Text.ElementAt(edt_la_ac_cadastrousuario_cpf.Text.Length - 1).ToString().Contains('8') ||
                  edt_la_ac_cadastrousuario_cpf.Text.ElementAt(edt_la_ac_cadastrousuario_cpf.Text.Length - 1).ToString().Contains('9')))
            {
                edt_la_ac_cadastrousuario_cpf.Text = edt_la_ac_cadastrousuario_cpf.Text.ToString().Substring(0, edt_la_ac_cadastrousuario_cpf.Text.ToString().Length - 1);
            }

            lockchange = false;
        }
        private void Search_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
        {
            List <KhatawaniTapshilNaveJama> Result;

            try
            {
                total = 0;
                var db = new SQLiteConnection(dbPath);

                var data = db.Query <KhatawaniTapshilNaveJama>("SELECT CM.khatawani_No, GM.GirviRecordNo, GIM.metal_type, GIM.item_type, GIM.Total_Quantity, GIM.gross_wt, GIM.net_wt, GIM.fine_wt, GM.Amount, GM.Date_of_deposit, CM.FullName, CM.Contact_No, CM.Address,GM.Status FROM customer_master AS CM INNER JOIN GirviMaster AS GM ON CM.khatawani_No = GM.khatawani_No INNER JOIN GirviItemMaster AS GIM ON GM.GirviRecordNo = GIM.GirviNo where GM.Status = 'unchange' and CM.FullName = '" + Search.Text.Trim().ToString() + "'").ToList();

                Result            = data;
                mListView.Adapter = new KhatawaniTapshilAdapter(this, Result);

                for (int i = 0; i < Result.Count; i++)
                {
                    STotal = Result[i].Amount.ToString();
                    total  = total + Convert.ToDouble(STotal);
                }
            }
            catch
            {
            }

            btnTotal.Text = "0.0";
            btnTotal.Text = Convert.ToString(" नावे : " + total);
        }
Exemplo n.º 3
0
        private async void ValidateUserName(object sender, Android.Text.AfterTextChangedEventArgs e)
        {
            _isDataValid = true;
            var username = _userName.Text;

            if (string.IsNullOrWhiteSpace(username) || username.Length < 3)
            {
                _userName.Error = "Invalid username, must be at least 3 characters";
                _isDataValid    = false;
            }
            else
            {
                var userNameExists = await DataManager.checkUsernameAlreadyExists(username);

                if (userNameExists)
                {
                    _userName.Error = String.Format("The username {0} is taken", username);
                    _isDataValid    = false;
                }
                else
                {
                    _userName.Error = null;
                    _isDataValid    = true;
                }

                Console.WriteLine(String.Format("Username taken {0}", userNameExists));
            }
        }
Exemplo n.º 4
0
        private void EdtRepetirContraseña_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
        {
            try
            {
                if (edtRepetirContraseña.Text == "")
                {
                    tvValidaRepetirContraseña.Visibility = ViewStates.Visible;
                    tvCampoObligatorio.Visibility        = ViewStates.Visible;
                }
                else
                {
                    tvValidaRepetirContraseña.Visibility = ViewStates.Invisible;
                    tvCampoObligatorio.Visibility        = ViewStates.Invisible;
                }

                if (edtContraseña.Text != edtRepetirContraseña.Text)
                {
                    tvValidaRepetirContraseña.Visibility = ViewStates.Visible;
                    tvCampoObligatorio.Visibility        = ViewStates.Visible;
                    tvValidaRepetirContraseña.Text       = "Las contraseñas no coinciden";
                }
                else
                {
                    tvValidaRepetirContraseña.Visibility = ViewStates.Invisible;
                    tvCampoObligatorio.Visibility        = ViewStates.Invisible;
                }
            }
            catch (Exception)
            {
            }
        }
        private void CalculateInput(object sender, Android.Text.AfterTextChangedEventArgs e)
        {
            // throw new System.NotImplementedException();

            // https://forums.xamarin.com/discussion/71735/how-to-display-a-message-box-or-alert-message-in-c-xamarin-android
            Toast.MakeText(this.ApplicationContext, "Let's try to calc stuff..", ToastLength.Short).Show();
        }
Exemplo n.º 6
0
        private async void ValidateEmailAddress(object sender, Android.Text.AfterTextChangedEventArgs e)
        {
            _isDataValid = true;
            var userEmail = _emailAddress.Text;

            if (string.IsNullOrWhiteSpace(userEmail) || userEmail.Length < 3)
            {
                _emailAddress.Error = "Invalid email address";
                _isDataValid        = false;
            }
            else
            {
                var emailExists = await DataManager.checkEmailAlreadyExists(userEmail);

                if (emailExists)
                {
                    _emailAddress.Error = String.Format(string.Format("The email address {0} is already used", userEmail));
                    _isDataValid        = false;
                }
                else
                {
                    _emailAddress.Error = null;
                    _isDataValid        = true;
                }

                Console.WriteLine(string.Format("Email address taken {0}", emailExists));
            }
        }
Exemplo n.º 7
0
 void ET_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
 {
     if (sender is EditText)
     {
         var row = (LinearLayout)((EditText)sender).Parent;
         row.SetTag(Resource.String.IsChanged, true);
     }
 }
Exemplo n.º 8
0
 void tbSearch_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
 {
     Library.CustomerInfoList custInfoList = Library.CustomerInfoList.GetCustomerInfoList(activity, new Library.CustomerInfoList.Criteria()
     {
         CustCode = tbCustCode.Text,
         CustName = tbCustName.Text
     });
     lvCustomers.Adapter = new CustomersAdapter(activity, custInfoList);
 }
Exemplo n.º 9
0
        private void SearchText_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
        {
            AutoCompleteTextView SearchText = FindViewById <AutoCompleteTextView>(Resource.Id.autoCompleteSearchTextView);

            if (!SearchText.IsPopupShowing && SearchText.Text.Length > 0)
            {
                SearchText.ShowDropDown();
            }
        }
Exemplo n.º 10
0
        void DecimalValue_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
        {
            EditText       evValue = (EditText)sender;
            RelativeLayout rlValue = (RelativeLayout)evValue.Parent;
            int            IDdrug  = (int)rlValue.GetTag(Resource.String.IDdrug);
            int            IDinfo  = (int)rlValue.GetTag(Resource.String.IDinfo);

            AttendanceResultManager.SetResultValue(newAttendanceResults, IDinfo, IDdrug, e.Editable.ToString());
        }
Exemplo n.º 11
0
        private void TextView_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
        {
            var view    = (TextView)sender;
            var binding = FindBindingForView(view);

            if (binding != null)
            {
                binding.ViewModelPropertyInfo.SetValue(viewModel, view.Text);
            }
        }
 private void EditText_AfterTextChangedCantidadAdultos(object sender, Android.Text.AfterTextChangedEventArgs e)
 {
     try {
         Reserva.PaxAdulto = int.Parse(textCantidadAdultos.EditText.Text);
         ((ReservasNuevoActivity)Activity).establecerReserva(Reserva);
     }
     catch {
         Reserva.PaxAdulto = 0;
         ((ReservasNuevoActivity)Activity).establecerReserva(Reserva);
     }
 }
Exemplo n.º 13
0
        /// <summary>
        /// Event that checks all inputs to enable the calculate button or not
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
        {
            // Get references to all UI inputs to check
            EditText mortgageAmount  = this.FindViewById <EditText>(Resource.Id.editTextMortgageAmount);
            EditText interestRate    = this.FindViewById <EditText>(Resource.Id.editTextInterestRate);
            EditText years           = this.FindViewById <EditText>(Resource.Id.editTextMortgagePeriod);
            Button   calculateButton = this.FindViewById <Button>(Resource.Id.calculateButton);

            // If inputs are all filled then enabled calculate button
            calculateButton.Enabled = !(string.IsNullOrEmpty(mortgageAmount.Text) || string.IsNullOrEmpty(interestRate.Text) || string.IsNullOrEmpty(years.Text));
        }
Exemplo n.º 14
0
 /// <summary>
 /// This Function is used to confirm when the user has filled in all
 /// the input lines and enables the button
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
 {
     if (dataOne.Text.Length > 0 && dataTwo.Text.Length > 0 && dataThree.Text.Length > 0)
     {
         btnFinish.Enabled = true; //This was meant to be true lol
     }
     else
     {
         btnFinish.Enabled = false;
     }
 }
 private void EditText_AfterTextChangedValorNino(object sender, Android.Text.AfterTextChangedEventArgs e)
 {
     try
     {
         Reserva.PrecioInfante = int.Parse(textCantidadNinos.EditText.Text);
         ((ReservasNuevoActivity)Activity).establecerReserva(Reserva);
     }
     catch
     {
         Reserva.PrecioInfante = 0;
         ((ReservasNuevoActivity)Activity).establecerReserva(Reserva);
     }
 }
        private void Tv_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
        {
            int value      = System.Convert.ToInt16(numberTv.Text);
            int iprevValue = System.Convert.ToInt16(prevValue);

            if ((value > maxNumber) && (value < minNumber))
            {
                numberTv.Text = prevValue;
                return;
            }

            SignatureRecoveryActivity.NumberOfSignatories = value;
        }
 private void EditText_AfterTextChangedValorAdulto(object sender, Android.Text.AfterTextChangedEventArgs e)
 {
     try
     {
         Reserva.PrecioAdulto = int.Parse(textValorAdulto.EditText.Text);
         ((ReservasNuevoActivity)Activity).establecerReserva(Reserva);
     }
     catch
     {
         Reserva.PrecioAdulto = 0;
         ((ReservasNuevoActivity)Activity).establecerReserva(Reserva);
     }
 }
Exemplo n.º 18
0
 private void NameView_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e) //запоминаем данные ввода
                                                                                                 //и включаем след поле
 {
     try
     {
         savedNamePerson     = nameView.Text;
         surnameView.Enabled = true;
     }
     catch (Exception ex)
     {
         Toast.MakeText(ApplicationContext, ex.Message, ToastLength.Long).Show();
     }
 }
Exemplo n.º 19
0
        private void DepartureDateTime_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
        {
            DateTime departureDate;

            try {
                departureDate = Convert.ToDateTime(GetDepartureDate());
            } catch (FormatException) {
                return;
            }

            var rand = new Random();


            var tableLayout = FindViewById <TableLayout>(Resource.Id.tableLayout);

            tableLayout.RemoveAllViewsInLayout();

            for (int i = 0; i < rand.Next(1, 4); i++)
            {
                var sourceCruise = new TextView(this)
                {
                    Text = $"Отбытие {GenerateDateInCurrentDay(departureDate).TimeOfDay}"
                };

                var availableCruise = new TextView(this)
                {
                    Text = $"Прибытие в {GenerateDateInRandomNumberOfDays(departureDate)}"
                };

                var applyOrder = new Button(this)
                {
                    Text = "Удобно"
                };
                applyOrder.SetWidth(150);
                applyOrder.Click += ApplyOrderListener;


                var cruisesLayout = new LinearLayout(this);
                cruisesLayout.Orientation = Orientation.Vertical;

                cruisesLayout.AddView(sourceCruise);

                cruisesLayout.AddView(availableCruise);
                cruisesLayout.AddView(applyOrder);


                tableLayout.AddView(cruisesLayout);
            }
        }
Exemplo n.º 20
0
        /// <summary>
        /// Evento lançado quando o texto do login alterar
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Edt_ac_login_login_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
        {
            if (lockchange)
            {
                return;
            }

            lockchange = true;

            if ((edt_ac_login_login.Text.ToString().Contains('.') && !(edt_ac_login_login.Text.ToString().Contains('@'))) || edt_ac_login_login.Text.ToString().Contains('-'))
            {
                edt_ac_login_login.Text = edt_ac_login_login.Text.ToString().Substring(0, edt_ac_login_login.Text.ToString().Length - 1);
            }

            lockchange = false;
        }
Exemplo n.º 21
0
        private void TxtsecuenciaRolloWidth_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
        {
            try
            {
                if (txtsecuenciaRolloWidth.Text.Trim() == string.Empty)
                {
                    idrolloWidth             = 0;
                    lblnombrerolloWidth.Text = string.Empty;
                    Limpiartext();
                    Enabled(false);

                    return;
                }
                var sec = int.Parse(txtsecuenciaRolloWidth.Text);

                String spinnerText = ((TextView)spinner1Width.FindViewById(Resource.Id.txtidcontenedor)).Text.ToString();

                if (spinnerText == "0")
                {
                    Alerta("Advertencia?", "Debe Seleccionar El Codigo De Tela ");

                    return;
                }

                var rollo = ListarollosWidth.Where(x => x.Sec == sec && x.Idtpc == int.Parse(spinnerText)).ToList();

                if (rollo.Any())
                {
                    lblnombrerolloWidth.Text = rollo[0].RolloName;
                    idrolloWidth             = int.Parse(rollo[0].Idrollo.ToString());
                    Enabled(true);
                }
                else
                {
                    idrolloWidth             = 0;
                    lblnombrerolloWidth.Text = string.Empty;
                    Enabled(false);

                    Toast.MakeText(this, "El rollo no existe o ya se ingresaron sus medidas", ToastLength.Short).Show();
                }
            }
            catch (Exception ex)
            {
                Alerta("Advertencia?", ex.Message);
            }
        }
        private void Search_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
        {
            List <customer_master> Result;

            try
            {
                var db = new SQLiteConnection(dbPath);

                var data = db.Query <customer_master>("Select * from customer_master where FullName = '" + Search.Text.Trim().ToString() + "'").ToList();

                Result            = data;
                mListView.Adapter = new KhatawaniListAdapter(this, Result);
            }
            catch
            {
                String E = e.ToString();
            }
        }
Exemplo n.º 23
0
 void MACTVFolderName_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
 {
     /*
      * string number = "";
      * if ( hhi_modules.HHI_Module.listPrefixes.Count == 0 ) {
      *  return;
      * }
      * if ( hhi_modules.HHI_Module.IndexExist( mACTVFolderName.Text, mHhiAndroid.GetCurrentHandInPrefix(mSpinnerWork.SelectedItem.ToString()), out number ) ) {
      *  mHhiAndroid.CurrentFolderName = mACTVFolderName.Text;
      *  string toast = string.Format( "你输入了文件名:{0} 学号为:{1}", mHhiAndroid.CurrentFolderName, number );
      *  Toast.MakeText( this, toast, ToastLength.Long ).Show();
      * } else {
      *  HHI_Android.ShowSimpleAlertView( this, "提示", "输入内容不合法,请重新输入" );
      *  mACTVFolderName.Text = "";
      *  mACTVFolderName.RequestFocus();
      * }
      */
 }
Exemplo n.º 24
0
        private void Foodname_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
        {
            var caloriecontent = FindViewById <TextView>(Resource.Id.CalorieContent);

            caloriecontent.Text = "None";

            var foodname = FindViewById <EditText>(Resource.Id.FoodName).Text;

            foreach (var obj in conn.Table <FoodCaloriesTable>())
            {
                if (obj.FoodName == foodname || obj.FoodName.ToLower().StartsWith(foodname.ToLower()))
                {
                    caloriecontent.Text = obj.Calories;
                    tempFood            = obj;
                    return;
                }
            }
        }
Exemplo n.º 25
0
 private void EdtUsername_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
 {
     try
     {
         if (edtUsername.Text == "")
         {
             tvValidaUsername.Visibility   = ViewStates.Visible;
             tvCampoObligatorio.Visibility = ViewStates.Visible;
         }
         else
         {
             tvValidaUsername.Visibility   = ViewStates.Invisible;
             tvCampoObligatorio.Visibility = ViewStates.Invisible;
         }
     }
     catch (Exception)
     {
     }
 }
Exemplo n.º 26
0
        private void MfldCurrentBalance_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
        {
            EditText editText = (EditText)sender;

            double CurrentBalance;

            if (editText.Text == "")
            {
                CurrentBalance = 0;
            }
            else
            {
                CurrentBalance = Convert.ToDouble(editText.Text);
            }

            TextView mtxtBalance = FindViewById <TextView>(Resource.Id.txtBalance);

            mtxtBalance.Text = CashPredictorInstance.CalculateBalance(CurrentBalance).ToString();
        }
        private void AutoComplete_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
        {
            var autoComplete      = FindViewById <AutoCompleteTextView>(Resource.Id.autoCompleteTextView1);
            var sharedPreferences = GetSharedPreferences(autoComplete.Text, FileCreationMode.Private);
            var specialChar       = sharedPreferences.GetString(specialCharKey, "");
            var maxLength         = sharedPreferences.GetInt(maxLengthKey, ignoreMaxLength);

            if (specialChar.Length > 0 || maxLength != ignoreMaxLength)
            {
                FindViewById <EditText>(Resource.Id.editTextSpecialChar).Text = specialChar;
                FindViewById <EditText>(Resource.Id.editTextMaxLength).Text   = maxLength == ignoreMaxLength ? "" : maxLength.ToString();
                FindViewById <Switch>(Resource.Id.switch1).Checked            = true;
            }
            else
            {
                FindViewById <EditText>(Resource.Id.editTextSpecialChar).Text = "!";
                FindViewById <EditText>(Resource.Id.editTextMaxLength).Text   = "";
                FindViewById <Switch>(Resource.Id.switch1).Checked            = false;
            }
        }
Exemplo n.º 28
0
 private void EdtEmail_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
 {
     try
     {
         if (edtEmail.Text == "" && validarEmail(edtEmail.Text))
         {
             tvValidaEmail.Visibility      = ViewStates.Visible;
             tvCampoObligatorio.Visibility = ViewStates.Visible;
             tvValidaEmail.Text            = "E-Mail incorrecto";
         }
         else
         {
             tvValidaEmail.Visibility      = ViewStates.Invisible;
             tvCampoObligatorio.Visibility = ViewStates.Invisible;
         }
     }
     catch (Exception)
     {
     }
 }
Exemplo n.º 29
0
        private void EditText_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
        {
            if (!BinderIsRunning || IsWritingToView)
            {
                return;
            }
            if (sender is EditText)
            {
                ProcessViewPropertyChanged(sender as EditText, (sender as EditText).Text);
            }

            return;

            {
                //ProcessViewPropertyChanged(sender as EditText, (sender as EditText).Text);
                //return;

                var    edit = (sender as EditText);
                string cVal = edit.Text;
                if (string.IsNullOrEmpty(cVal.Trim()))
                {
                    ProcessViewPropertyChanged(edit, cVal);
                }
                else
                {
                    lock (EditTextDelayer)
                    {
                        Delayer mDelayer = null;
                        if (EditTextDelayer.ContainsKey(edit))
                        {
                            EditTextDelayer[edit].SetDelay(1000, () => ProcessViewPropertyChanged(edit, cVal));
                        }
                        else
                        {
                            mDelayer = new Delayer(() => ProcessViewPropertyChanged(edit, cVal), 1000);
                            EditTextDelayer.Add(edit, mDelayer);
                        }
                    }
                }
            }
        }
Exemplo n.º 30
0
 private void MQty_AfterTextChanged(object sender, Android.Text.AfterTextChangedEventArgs e)
 {
     if (txtQty.Length() == 0 || txtQty.Text == "0")
     {
         seek1.Progress = 0;
         seek2.Progress = 0;
     }
     else
     {
         try
         {
             if (txtQty.Length() <= 2)
             {
                 seek2.Progress = Convert.ToInt32(txtQty.Text);
                 seek1.Progress = 0;
                 txtQty.SetSelection(txtQty.Length());
             }
             else if (txtQty.Length() == 3)
             {
                 string holder = txtQty.Text;
                 seek2.Progress = Convert.ToInt32(txtQty.Text.Substring(1, 2));
                 seek1.Progress = Convert.ToInt32(holder.Substring(0, 1));
                 txtQty.SetSelection(txtQty.Length());
             }
             else if (txtQty.Length() == 4)
             {
                 string holder  = txtQty.Text;
                 string holder2 = txtQty.Text;
                 seek2.Progress = Convert.ToInt32(holder2.Substring(2, 2));
                 seek1.Progress = Convert.ToInt32(holder.Substring(0, 2));
                 txtQty.SetSelection(txtQty.Length());
             }
         }
         catch
         {
             seek1.Progress = seek1.Max;
             seek2.Progress = seek2.Max;
         }
     }
 }