Skip to content

Commit bae418d

Browse files
committed
Agregar archivos de proyecto.
1 parent 149fb41 commit bae418d

File tree

89 files changed

+75151
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+75151
-0
lines changed

TareasMVC.sln

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.4.33213.308
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TareasMVC", "TareasMVC\TareasMVC.csproj", "{F903FFF6-6E0E-48EB-9E9F-8DEB643A3F01}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{F903FFF6-6E0E-48EB-9E9F-8DEB643A3F01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{F903FFF6-6E0E-48EB-9E9F-8DEB643A3F01}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{F903FFF6-6E0E-48EB-9E9F-8DEB643A3F01}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{F903FFF6-6E0E-48EB-9E9F-8DEB643A3F01}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {8AB2AF5C-3806-4498-80B0-20850EFD214B}
24+
EndGlobalSection
25+
EndGlobal

TareasMVC/ApplicationDbContext.cs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using Microsoft.EntityFrameworkCore;
2+
using TareasMVC.Entidades;
3+
4+
namespace TareasMVC
5+
{
6+
public class ApplicationDbContext: DbContext
7+
{
8+
public ApplicationDbContext(DbContextOptions options): base(options)
9+
{
10+
11+
}
12+
13+
// CONFIGURACION DE LA CLASE TAREAS PARA CONVERTIRLA EN UNA ENTIDAD
14+
public DbSet<Tarea> Tareas { get; set; }
15+
public DbSet<Paso> Pasos { get; set; }
16+
public DbSet<ArchivoAdjunto> ArchivosAdjuntos { get; set; }
17+
}
18+
}
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using System.Diagnostics;
3+
using TareasMVC.Models;
4+
5+
namespace TareasMVC.Controllers
6+
{
7+
public class HomeController : Controller
8+
{
9+
private readonly ILogger<HomeController> _logger;
10+
11+
public HomeController(ILogger<HomeController> logger)
12+
{
13+
_logger = logger;
14+
}
15+
16+
public IActionResult Index()
17+
{
18+
return View();
19+
}
20+
21+
public IActionResult Privacy()
22+
{
23+
return View();
24+
}
25+
26+
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
27+
public IActionResult Error()
28+
{
29+
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
30+
}
31+
}
32+
}

TareasMVC/Entidades/ArchivoAdjunto.cs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using Microsoft.EntityFrameworkCore;
2+
3+
namespace TareasMVC.Entidades
4+
{
5+
public class ArchivoAdjunto
6+
{
7+
public Guid Id { get; set; }
8+
9+
public int TareaId { get; set; }
10+
11+
public Tarea Tarea { get; set; }
12+
13+
[Unicode]
14+
public string Url { get; set; }
15+
16+
public string Titulo { get; set; }
17+
18+
public int Orden { get; set; }
19+
20+
public DateTime FechaCreacion { get; set; }
21+
}
22+
}

TareasMVC/Entidades/Paso.cs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
namespace TareasMVC.Entidades
2+
{
3+
public class Paso
4+
{
5+
public Guid Id { get; set; }
6+
7+
public int TareaId { get; set; }
8+
9+
// PROPIEDAD DE NAVEGACIÓN (se configura automaticamente como llave foranea)
10+
// Relación 1 a muchos
11+
public Tarea Tarea { get; set; }
12+
13+
public string Descripcion { get; set; }
14+
15+
public bool Realizado { get; set; }
16+
17+
public int Orden { get; set; }
18+
}
19+
}

TareasMVC/Entidades/Tarea.cs

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System.ComponentModel.DataAnnotations;
2+
3+
namespace TareasMVC.Entidades
4+
{
5+
public class Tarea
6+
{
7+
public int Id { get; set; }
8+
9+
[StringLength(250)]
10+
public string Titulo { get; set; }
11+
12+
public string Descripcion { get; set; }
13+
14+
public int Orden { get; set; }
15+
16+
public DateTime FechaCreacion { get; set; }
17+
18+
// PROPIEDAD DE NAVEGACIÓN (se configura automaticamente como llave foranea)
19+
// Relación 1 a muchos
20+
public List<Paso> Pasos { get; set; }
21+
22+
public List<ArchivoAdjunto> ArchivosAdjuntos { get; set; }
23+
}
24+
}

TareasMVC/Migrations/20230117201956_Tareas.Designer.cs

+57
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using System;
2+
using Microsoft.EntityFrameworkCore.Migrations;
3+
4+
#nullable disable
5+
6+
namespace TareasMVC.Migrations
7+
{
8+
/// <inheritdoc />
9+
public partial class Tareas : Migration
10+
{
11+
/// <inheritdoc />
12+
protected override void Up(MigrationBuilder migrationBuilder)
13+
{
14+
migrationBuilder.CreateTable(
15+
name: "Tareas",
16+
columns: table => new
17+
{
18+
Id = table.Column<int>(type: "int", nullable: false)
19+
.Annotation("SqlServer:Identity", "1, 1"),
20+
Titulo = table.Column<string>(type: "nvarchar(max)", nullable: false),
21+
Descripcion = table.Column<string>(type: "nvarchar(max)", nullable: false),
22+
Orden = table.Column<int>(type: "int", nullable: false),
23+
FechaCreacion = table.Column<DateTime>(type: "datetime2", nullable: false)
24+
},
25+
constraints: table =>
26+
{
27+
table.PrimaryKey("PK_Tareas", x => x.Id);
28+
});
29+
}
30+
31+
/// <inheritdoc />
32+
protected override void Down(MigrationBuilder migrationBuilder)
33+
{
34+
migrationBuilder.DropTable(
35+
name: "Tareas");
36+
}
37+
}
38+
}

TareasMVC/Migrations/20230117203521_TituloConfigurado.Designer.cs

+58
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using Microsoft.EntityFrameworkCore.Migrations;
2+
3+
#nullable disable
4+
5+
namespace TareasMVC.Migrations
6+
{
7+
/// <inheritdoc />
8+
public partial class TituloConfigurado : Migration
9+
{
10+
/// <inheritdoc />
11+
protected override void Up(MigrationBuilder migrationBuilder)
12+
{
13+
migrationBuilder.AlterColumn<string>(
14+
name: "Titulo",
15+
table: "Tareas",
16+
type: "nvarchar(250)",
17+
maxLength: 250,
18+
nullable: false,
19+
oldClrType: typeof(string),
20+
oldType: "nvarchar(max)");
21+
}
22+
23+
/// <inheritdoc />
24+
protected override void Down(MigrationBuilder migrationBuilder)
25+
{
26+
migrationBuilder.AlterColumn<string>(
27+
name: "Titulo",
28+
table: "Tareas",
29+
type: "nvarchar(max)",
30+
nullable: false,
31+
oldClrType: typeof(string),
32+
oldType: "nvarchar(250)",
33+
oldMaxLength: 250);
34+
}
35+
}
36+
}

0 commit comments

Comments
 (0)