internal homework getTareas(int id) { //IEnumerable<filesHomework> result=contexto.filesHomework.Where(a => a.idHome == id); homework tarea = contexto.homework.Where(a => a.id == id).First(); return(tarea); }
public RedirectToRouteResult AgregarTarea(homework home, string filenames) { if (Session["id"] != null) home.idUs = (int)Session["id"]; if (db.insertHomeworks(home,filenames)) { return RedirectToAction("Lista"); } else { return RedirectToAction("AgregarTarea"); } }
internal bool deleteHomeWork(int idHome) { homework home = contexto.homework.Where(a => a.id == idHome).First(); contexto.homework.Remove(home); try { contexto.SaveChanges(); return(true); } catch { return(false); } }
internal void updateTarea(homework home, string filesnames) { homework tarea = getTareas(home.id); tarea.title = home.title; tarea.date_emision = home.date_emision; tarea.date_end = home.date_end; tarea.descriptions = home.descriptions; contexto.SaveChanges(); if (home.urldownload != "none") { //deleteFilesHomework(home.id); addWorksFiles(home.urldownload, home.id, filesnames); } }
internal bool insertHomeworks(homework home, string filenames) { /* * Insertamos la talbla correspondiente a los archivos de cada tarea emitida * sobre la tabla fileHomework */ string dataurl = home.urldownload; home.urldownload = "none"; contexto.homework.Add(home); contexto.SaveChanges(); addWorksFiles(dataurl, home.id, filenames); return(true); }
public RedirectToRouteResult actualizarTarea(homework home, string filenames) { db.updateTarea(home,filenames); return RedirectToAction("Lista"); }
internal void updateTarea(homework home,string filesnames) { homework tarea = getTareas(home.id); tarea.title = home.title; tarea.date_emision = home.date_emision; tarea.date_end = home.date_end; tarea.descriptions = home.descriptions; contexto.SaveChanges(); if (home.urldownload != "none") { //deleteFilesHomework(home.id); addWorksFiles(home.urldownload,home.id,filesnames); } }
internal bool insertHomeworks(homework home, string filenames) { /* Insertamos la talbla correspondiente a los archivos de cada tarea emitida * sobre la tabla fileHomework */ string dataurl = home.urldownload; home.urldownload = "none"; contexto.homework.Add(home); contexto.SaveChanges(); addWorksFiles(dataurl,home.id,filenames); return true; }