示例#1
0
        private void BtnBuscar_Click(object sender, EventArgs e)
        {
            var cliente = Service.GetCustomerData(edtCodigoC.Text);

            if (cliente != null)
            {
                edtNombresA.Text = cliente.Nombres + " " + cliente.Apellidos;

                //BUSCA ALQUILERES DEL CLIENTE
                alquiler = Service.PendingByCustomer(cliente.Id);


                if (alquiler != null)
                {
                    //LLENAR EL ENCABEZADO
                    edtCodigoC.Text  = cliente.Codigo;
                    edtNombresA.Text = cliente.Nombres + " " + cliente.Apellidos;

                    //LLENAR EL ADAPTADOR
                    lista.Adapter = new AdapterPendingList((Activity)rootView.Context, alquiler);
                }
                else
                {
                    Toast.MakeText(rootView.Context, "El cliente no tiene alquileres pendientes", ToastLength.Long).Show();
                }
            }
            else
            {
                Toast.MakeText(rootView.Context, "Ingrese el número de cédula", ToastLength.Long).Show();
            }
        }
示例#2
0
        void HandleScanResult(ZXing.Result result)
        {
            if (result != null && !string.IsNullOrEmpty(result.Text))
            {
                //BUSCAR EL CLIENTE
                var cliente = Service.GetCustomerData(result.Text);

                //SI SE ENCUENTRA EL CLIENTE
                if (cliente != null)
                {
                    //BUSCA ALQUILERES DEL CLIENTE
                    alquiler = Service.PendingByCustomer(cliente.Id);

                    if (alquiler != null)
                    {
                        //LLENAR EL ENCABEZADO
                        edtCodigoC.Text  = cliente.Codigo;
                        edtNombresA.Text = cliente.Nombres + " " + cliente.Apellidos;

                        //LLENAR EL ADAPTADOR
                        lista.Adapter = new AdapterPendingList((Activity)rootView.Context, alquiler);
                    }
                    else
                    {
                        Toast.MakeText(rootView.Context, "El cliente no tiene alquileres pendientes", ToastLength.Long).Show();
                    }
                }
                else
                {
                    Toast.MakeText(rootView.Context, "No existe el cliente con ese codigo", ToastLength.Long).Show();
                }
            }
            else
            {
                Toast.MakeText(rootView.Context, "Vuelva a escanear", ToastLength.Long).Show();
            }
        }
 public override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     list = Service.PendingByCustomer(Service.CustomerId);
     // Create your fragment here
 }