Exemple #1
0
        private void Btnguardar_Click(object sender, EventArgs e)
        {
            List <RentalDetailsWS> rentalDetailsWs = new List <RentalDetailsWS>();

            if (edtCodAlq.Text != "" && edtCedula.Text != "" && edtFechaalq.Text != "" && edtFechaDevo.Text != "" && listacopias.Count != 0)
            {
                foreach (var item in Detalleranta)
                {
                    var x = new RentalDetailsWS();
                    x.CopiaId     = item.CopyId;
                    x.AlquilerId  = 0;
                    x.Id          = 0;
                    x.Portada     = item.Portada;
                    x.NumeroCopia = 0;
                    x.TituloLibro = "";

                    rentalDetailsWs.Add(x);
                }

                var m = Service.AddRental(idCliente, edtCodAlq.Text, DateTime.Now.Date, Convert.ToDateTime(edtFechaDevo.Text), DateTime.Now.Date, rentalDetailsWs.ToList());
                if (m.band)
                {
                    Toast.MakeText(rootView.Context, m.message, ToastLength.Long).Show();
                }
                else
                {
                    Toast.MakeText(rootView.Context, m.message, ToastLength.Long).Show();
                }
            }
            else
            {
                Toast.MakeText(rootView.Context, "Llene los campos importantes", ToastLength.Long).Show();
            }
        }