Ejemplo n.º 1
0
        public ActionResult SubirImg(HttpPostedFileBase uploadFile)
        {
            DataClasses1DataContext db = new DataClasses1DataContext();
            if (uploadFile.ContentLength > 0) {
                string filePath = Path.Combine(HttpContext.Server.MapPath("../Imagenes"), Path.GetFileName(uploadFile.FileName));
                uploadFile.SaveAs(filePath);
                perfil idper = db.perfils.Where(a => a.UserId == (Guid)Session["ids"]).ToArray()[0];
                avatar img = new avatar() { rutafisica = filePath, rutavirtual = "/Imagenes/" + uploadFile.FileName, idPerfil = idper.idPerfil, fecha = DateTime.Now };
                db.avatars.InsertOnSubmit(img);
                db.SubmitChanges();

            }
            return RedirectToAction("Perfil", "EditPerfil");
        }
Ejemplo n.º 2
0
 partial void Deleteavatar(avatar instance);
Ejemplo n.º 3
0
 partial void Updateavatar(avatar instance);
Ejemplo n.º 4
0
 partial void Insertavatar(avatar instance);
Ejemplo n.º 5
0
		private void detach_avatars(avatar entity)
		{
			this.SendPropertyChanging();
			entity.perfil = null;
		}
Ejemplo n.º 6
0
		private void attach_avatars(avatar entity)
		{
			this.SendPropertyChanging();
			entity.perfil = this;
		}