示例#1
0
        static void DeleteDetalle(int id)
        {
            var ctx     = new TareasDbcontext();
            var detalle = ctx.Detalles.Where(i => i.id == id).Single();

            ctx.Detalles.Remove(detalle);
            ctx.SaveChanges();
        }
示例#2
0
        static void DeleteUser(int id)
        {
            var ctx  = new TareasDbcontext();
            var user = ctx.Usuario.Where(i => i.id == id).Single();

            ctx.Usuario.Remove(user);
            ctx.SaveChanges();
        }
示例#3
0
        static void DeleteUser(string name)
        {
            var ctx  = new TareasDbcontext();
            var user = ctx.Usuario.Where(i => i.Usuario == name).Single();

            ctx.Usuario.Remove(user);
            ctx.SaveChanges();
        }
示例#4
0
        static void DeleteTask(int id)
        {
            var ctx  = new TareasDbcontext();
            var task = ctx.Tareas.Where(i => i.id == id).Single();

            ctx.Tareas.Remove(task);
            ctx.SaveChanges();
        }
示例#5
0
        static void DeleteRecurso(int id)
        {
            var ctx     = new TareasDbcontext();
            var recurso = ctx.Recursos.Where(i => i.id == id).Single();

            ctx.Recursos.Remove(recurso);
            ctx.SaveChanges();
        }
示例#6
0
        // CRUD USUARIOS
        static void CreateUser(string name, string pass)
        {
            var ctx = new TareasDbcontext();

            ctx.Usuario.Add(new Usuarios
            {
                Usuario = name,
                Clave   = pass,
            });

            ctx.SaveChanges();
        }
示例#7
0
        static void UpdateDetalle(int id, DateTime newFecha)
        {
            var ctx     = new TareasDbcontext();
            var detalle = ctx.Detalles.Where(i => i.id == id).FirstOrDefault();

            if (detalle != null)
            {
                detalle.fecha = newFecha;
            }
            ;

            ctx.SaveChanges();
        }
示例#8
0
        static void UpdateTask(int id, DateTime newVto)
        {
            var ctx   = new TareasDbcontext();
            var tarea = ctx.Tareas.Where(i => i.id == id).FirstOrDefault();

            if (tarea != null)
            {
                tarea.vencimiento = newVto;
            }
            ;

            ctx.SaveChanges();
        }
示例#9
0
        static void UpdateRecurso(int id, string newName)
        {
            var ctx     = new TareasDbcontext();
            var recurso = ctx.Recursos.Where(i => i.id == id).FirstOrDefault();

            if (recurso != null)
            {
                recurso.Nombre = newName;
            }
            ;

            ctx.SaveChanges();
        }
示例#10
0
        // CRUD RECURSOS

        static void CreateRecurso(string nombre, int usuariosid)
        {
            var ctx = new TareasDbcontext();

            ctx.Recursos.Add(new Recursos
            {
                Nombre     = nombre,
                UsuariosId = usuariosid,
            });

            ctx.SaveChanges();
            ;
        }
示例#11
0
        static void UpdateTaskETA(int id, int newEstimacion)
        {
            var ctx   = new TareasDbcontext();
            var tarea = ctx.Tareas.Where(i => i.id == id).FirstOrDefault();

            if (tarea != null)
            {
                tarea.estimacion = newEstimacion;
            }
            ;

            ctx.SaveChanges();
        }
示例#12
0
        static void UpdateTaskStatus(int id, string newEstado)
        {
            var ctx   = new TareasDbcontext();
            var tarea = ctx.Tareas.Where(i => i.id == id).FirstOrDefault();

            if (tarea != null)
            {
                tarea.estado = newEstado;
            }
            ;

            ctx.SaveChanges();
        }
示例#13
0
        static void UpdateTask(int id, int newRecurso)
        {
            var ctx   = new TareasDbcontext();
            var tarea = ctx.Tareas.Where(i => i.id == id).FirstOrDefault();

            if (tarea != null)
            {
                tarea.recursosId = newRecurso;
            }
            ;

            ctx.SaveChanges();
        }
示例#14
0
        static void UpdateDetalle(int id, int newTiempo)
        {
            var ctx     = new TareasDbcontext();
            var detalle = ctx.Detalles.Where(i => i.id == id).FirstOrDefault();

            if (detalle != null)
            {
                detalle.tiempo = newTiempo;
            }
            ;

            ctx.SaveChanges();
        }
示例#15
0
        static void UpdateUserName(int id, string newname)
        {
            var ctx  = new TareasDbcontext();
            var user = ctx.Usuario.Where(i => i.id == id).FirstOrDefault();

            if (user != null)
            {
                user.Usuario = newname;
            }
            ;

            ctx.SaveChanges();
        }
示例#16
0
        static void UpdateRecurso(int id, int newUsuarioId)
        {
            var ctx     = new TareasDbcontext();
            var recurso = ctx.Recursos.Where(i => i.id == id).FirstOrDefault();

            if (recurso != null)
            {
                recurso.UsuariosId = newUsuarioId;
            }
            ;

            ctx.SaveChanges();
        }
示例#17
0
        static string SelectTask(int id)
        {
            var ctx   = new TareasDbcontext();
            var tarea = ctx.Tareas.Where(i => i.id == id).FirstOrDefault();

            if (tarea != null)
            {
                return(tarea.ToString());
            }
            else
            {
                return("no existe");
            }
        }
示例#18
0
        static string SelectRecurso(int id)
        {
            var ctx = new TareasDbcontext();
            var rec = ctx.Tareas.Where(i => i.id == id).FirstOrDefault();

            if (rec != null)
            {
                return(rec.ToString());
            }
            else
            {
                return("no existe");
            }
        }
示例#19
0
        static string SelectUser(int id)
        {
            var ctx  = new TareasDbcontext();
            var user = ctx.Usuario.Where(i => i.id == id).FirstOrDefault();

            if (user != null)
            {
                return(user.ToString());
            }
            else
            {
                return("no existe");
            }
        }
示例#20
0
        // CRUD TAREAS
        static void CreateTask(string titulo, DateTime vencimiento, int estimacion, int recursosid, string estado)
        {
            var ctx = new TareasDbcontext();

            ctx.Tareas.Add(new Tareas
            {
                titulo      = titulo,
                vencimiento = vencimiento,
                estimacion  = estimacion,
                recursosId  = recursosid,
                estado      = estado,
            });
            ctx.SaveChanges();
        }
示例#21
0
        // CRUD DETALLES

        static void CreateDetalle(DateTime fecha, int tiempo, int recursoid, int tareaid)
        {
            var ctx = new TareasDbcontext();

            ctx.Detalles.Add(new Detalles
            {
                fecha      = fecha,
                tiempo     = tiempo,
                recursosId = recursoid,
                tareasId   = tareaid,
            });;

            ctx.SaveChanges();
            ;
        }