예제 #1
0
 public ActionResult Cursos()
 {
     DataClasses1DataContext db = new DataClasses1DataContext();
     var lista = db.listcur.ToList().Take(10).OrderByDescending(a => a.fecha_publicacion);
     if (lista != null)
     {
         ViewBag.lib = lista;
     }
     else { ViewBag.lib = "No se encontro ningun registro"; }
     publicacion p = new publicacion();
     ViewBag.p = db.publicacion.ToList().Take(10).OrderByDescending(a => a.idPublicacion);
     ViewBag.tipo = (from t in db.categoria select t).ToList();
     return View();
 }
 partial void Deletepublicacion(publicacion instance);
 partial void Updatepublicacion(publicacion instance);
 partial void Insertpublicacion(publicacion instance);
		private void detach_publicacion(publicacion entity)
		{
			this.SendPropertyChanging();
			entity.aspnet_Users = null;
		}
예제 #6
0
 public void regpubli(articulomodelo model)
 {
     publicacion publicacion = new publicacion()
     {
         titulo = model.Titulo,
         portada = model.Portada,
         contenido = model.Contenido,
         correcciones = "false",
         puntaje = 0,
         fecha_publicacion = DateTime.Today,
         descripcion = model.Descripcion,
         UserId = model.idusers
     };
     db.publicacion.InsertOnSubmit(publicacion);
     db.SubmitChanges();
 }
예제 #7
0
 public ActionResult detallecurso(int id)
 {
     DataClasses1DataContext db = new DataClasses1DataContext();
     var lista = db.listcur.ToList().Where(a => a.idpublicacion == id);
     if (lista != null)
     {
         ViewBag.lib = lista;
         ViewBag.l = id;
     }
     else { ViewBag.lib = "No se encontro ningun registro"; }
     //ViewBag.tipol = (from tip in db.categoriacurso where tip.idpublicacion == id select tip).ToArray()[0];
     publicacion p = new publicacion();
     ViewBag.p = db.publicacion.ToList().Take(10).OrderByDescending(a => a.idPublicacion);
     ViewBag.tipo = (from t in db.categoriacurso select t).ToList();
     ViewBag.comentario = from m in db.comentario where m.idpublicacion == id select m;
     return View();
 }
예제 #8
0
 public ActionResult login()
 {
     DataClasses1DataContext av = new DataClasses1DataContext();
     //perfilusers p = new perfilusers();
     var p = (from a in av.perfilusers where a.nombre == User.Identity.Name select a).ToList();
     ViewBag.list = p;
     ViewBag.li = av.listalibro.ToList().Take(10).OrderByDescending(a => a.fecha_publicacion);
     if (ViewBag.li != null)
     {
         ViewBag.lib = av.listalibro.ToList().Take(10).OrderByDescending(a => a.fecha_publicacion);
     }
     else { ViewBag.lib = "No se encontro ningun registro"; }
     publicacion p1 = new publicacion();
     ViewBag.p1 = av.publicacion.ToList().Take(10).OrderByDescending(a => a.fecha_publicacion);
     ViewBag.tipo = (from t in av.categoria select t).ToList();
     return View();
 }
예제 #9
0
 public ActionResult libro()
 {
     DataClasses1DataContext db = new DataClasses1DataContext();
         publicacion pe = new publicacion();
         perfilusers u = new perfilusers();
         categoria c = new categoria();
         categorizacion cat = new categorizacion();
         pe = (from b in db.publicacion select b).ToArray()[0];
         //ViewBag.p = from b in db.publicacion select b;
         //ViewBag.u = from s in db.perfilusers select s;
         ViewBag.p = null;
     return View();
 }