Ejemplo n.º 1
0
        public async Task <ActionResult> Ingreso([Bind(Include = "Expediente, Mascota")] ExpedienteMascotaModel expedienteMascota)
        {
            if (ModelStateValidation(expedienteMascota))
            {
                if (await CreateExpedientesync(expedienteMascota.Expediente))
                {
                    if (await CreateMascotasync(expedienteMascota.Mascota))
                    {
                        return(RedirectToAction("Index"));
                    }
                    else
                    {
                        await DeleteAsync("api/Expediente/DelPermanent/" + expedienteMascota.Expediente.Id);
                    }
                }
            }
            ViewData["Error"] = await ErrorAsync("Home", "Ingreso", "Error insertar expediente o Macota compruebe los campos", 400);

            return(View(expedienteMascota));
        }
Ejemplo n.º 2
0
 private bool ModelStateValidation(ExpedienteMascotaModel expedienteMascota)
 {
     return(true);
 }