Exemplo n.º 1
0
        public ActionResult MasInfo(AddFoto af)
        {

            bool foto = (from ph in adb.Fotos
                         where ph.Nombre == (string)Session["foto"]
                         select true).SingleOrDefault();
            var nombre = (from usu in adb.Usuarios
                          where usu.Alias == (string)Session["usuario"]
                          select usu.Nombre).Single();
            if (foto == false)
            {
                if (ModelState.IsValid)
                {
                    Foto nuevo = new Foto();
                    af.name = (string)nombre;
                    af.photo = (string)Session["foto"];
                    nuevo.Aerolinea = af.airline;
                    nuevo.Avion = af.airplane;
                    nuevo.Fecha = af.date;
                    nuevo.Fotografo = af.name;
                    nuevo.Lugar = af.place;
                    nuevo.Notas = af.notes;
                    nuevo.Nombre = af.photo;
                    adb.Fotos.InsertOnSubmit(nuevo);
                    adb.SubmitChanges();
                    return RedirectToAction("Index", "Home");
                }
                else {
                    var err = ModelState.SelectMany(x => x.Value.Errors.Select(y => y.Exception));
                    return View("MasInfo");
                }
            }
            else {
                return RedirectToAction("AñadirFoto");
            }
            }
Exemplo n.º 2
0
		private void detach_Fotos(Foto entity)
		{
			this.SendPropertyChanging();
			entity.Usuario = null;
		}
Exemplo n.º 3
0
		private void attach_Fotos(Foto entity)
		{
			this.SendPropertyChanging();
			entity.Usuario = this;
		}
Exemplo n.º 4
0
 partial void DeleteFoto(Foto instance);
Exemplo n.º 5
0
 partial void UpdateFoto(Foto instance);
Exemplo n.º 6
0
 partial void InsertFoto(Foto instance);