mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Re-do company descriptions.
This commit is contained in:
1891
Cicm.Database/Migrations/20190518145625_RemoveCompanyDescriptions.Designer.cs
generated
Normal file
1891
Cicm.Database/Migrations/20190518145625_RemoveCompanyDescriptions.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,35 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace Cicm.Database.Migrations
|
||||||
|
{
|
||||||
|
public partial class RemoveCompanyDescriptions : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable("company_descriptions");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable("company_descriptions",
|
||||||
|
table => new
|
||||||
|
{
|
||||||
|
id = table.Column<int>("int(11)")
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy",
|
||||||
|
MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
|
company_id = table.Column<int>("int(11)"),
|
||||||
|
text = table.Column<string>("text", nullable: true)
|
||||||
|
}, constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_company_descriptions", x => x.id);
|
||||||
|
table.ForeignKey("fk_company_id", x => x.id, "companies", "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex("idx_company_id", "company_descriptions", "company_id", unique: true);
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex("idx_text", "company_descriptions", "text");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
1915
Cicm.Database/Migrations/20190518150032_AddCompanyDescriptions.Designer.cs
generated
Normal file
1915
Cicm.Database/Migrations/20190518150032_AddCompanyDescriptions.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace Cicm.Database.Migrations
|
||||||
|
{
|
||||||
|
public partial class AddCompanyDescriptions : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable("CompanyDescriptions",
|
||||||
|
table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>()
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy",
|
||||||
|
MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
|
CompanyId = table.Column<int>(),
|
||||||
|
Text = table.Column<string>(nullable: true)
|
||||||
|
}, constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_CompanyDescriptions", x => x.Id);
|
||||||
|
table.ForeignKey("FK_CompanyDescriptions_companies_CompanyId",
|
||||||
|
x => x.CompanyId, "companies", "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex("IX_CompanyDescriptions_CompanyId", "CompanyDescriptions", "CompanyId");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable("CompanyDescriptions");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
1918
Cicm.Database/Migrations/20190518154700_AddCompanyDescriptionIndex.Designer.cs
generated
Normal file
1918
Cicm.Database/Migrations/20190518154700_AddCompanyDescriptionIndex.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,24 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace Cicm.Database.Migrations
|
||||||
|
{
|
||||||
|
public partial class AddCompanyDescriptionIndex : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<string>("Text", "CompanyDescriptions", nullable: true,
|
||||||
|
oldClrType: typeof(string), oldNullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex("IX_CompanyDescriptions_Text", "CompanyDescriptions", "Text")
|
||||||
|
.Annotation("MySql:FullTextIndex", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropIndex("IX_CompanyDescriptions_Text", "CompanyDescriptions");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<string>("Text", "CompanyDescriptions", nullable: true,
|
||||||
|
oldClrType: typeof(string), oldNullable: true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,7 +13,7 @@ namespace Cicm.Database.Migrations
|
|||||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
#pragma warning disable 612, 618
|
#pragma warning disable 612, 618
|
||||||
modelBuilder.HasAnnotation("ProductVersion", "2.1.1-rtm-30846")
|
modelBuilder.HasAnnotation("ProductVersion", "2.2.4-servicing-10062")
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
modelBuilder.Entity("Cicm.Database.Models.Admin", b =>
|
modelBuilder.Entity("Cicm.Database.Models.Admin", b =>
|
||||||
@@ -178,19 +178,19 @@ namespace Cicm.Database.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("Cicm.Database.Models.CompanyDescription", b =>
|
modelBuilder.Entity("Cicm.Database.Models.CompanyDescription", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id").ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("int(11)");
|
b.Property<int>("Id").ValueGeneratedOnAdd();
|
||||||
|
|
||||||
b.Property<int>("CompanyId").HasColumnName("company_id").HasColumnType("int(11)");
|
b.Property<int>("CompanyId");
|
||||||
|
|
||||||
b.Property<string>("Text").HasColumnName("text").HasColumnType("text");
|
b.Property<string>("Text");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("CompanyId").IsUnique().HasName("idx_company_id");
|
b.HasIndex("CompanyId");
|
||||||
|
|
||||||
b.HasIndex("Text").HasName("idx_text");
|
b.HasIndex("Text").HasAnnotation("MySql:FullTextIndex", true);
|
||||||
|
|
||||||
b.ToTable("company_descriptions");
|
b.ToTable("CompanyDescriptions");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Cicm.Database.Models.CompanyLogo", b =>
|
modelBuilder.Entity("Cicm.Database.Models.CompanyLogo", b =>
|
||||||
@@ -1074,9 +1074,8 @@ namespace Cicm.Database.Migrations
|
|||||||
modelBuilder.Entity("Cicm.Database.Models.CompanyDescription",
|
modelBuilder.Entity("Cicm.Database.Models.CompanyDescription",
|
||||||
b =>
|
b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Cicm.Database.Models.Company", "Company").WithOne("Description")
|
b.HasOne("Cicm.Database.Models.Company", "Company").WithMany("Descriptions")
|
||||||
.HasForeignKey("Cicm.Database.Models.CompanyDescription", "Id")
|
.HasForeignKey("CompanyId").OnDelete(DeleteBehavior.Cascade);
|
||||||
.HasConstraintName("fk_company_id").OnDelete(DeleteBehavior.Cascade);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Cicm.Database.Models.CompanyLogo",
|
modelBuilder.Entity("Cicm.Database.Models.CompanyLogo",
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ namespace Cicm.Database.Models
|
|||||||
public virtual Iso31661Numeric Country { get; set; }
|
public virtual Iso31661Numeric Country { get; set; }
|
||||||
[DisplayName("Sold to")]
|
[DisplayName("Sold to")]
|
||||||
public virtual Company SoldTo { get; set; }
|
public virtual Company SoldTo { get; set; }
|
||||||
public virtual CompanyDescription Description { get; set; }
|
public virtual ICollection<CompanyDescription> Descriptions { get; set; }
|
||||||
public virtual ICollection<CompanyLogo> Logos { get; set; }
|
public virtual ICollection<CompanyLogo> Logos { get; set; }
|
||||||
public virtual ICollection<Gpu> Gpus { get; set; }
|
public virtual ICollection<Gpu> Gpus { get; set; }
|
||||||
public virtual ICollection<Company> InverseSoldToNavigation { get; set; }
|
public virtual ICollection<Company> InverseSoldToNavigation { get; set; }
|
||||||
@@ -92,5 +92,8 @@ namespace Cicm.Database.Models
|
|||||||
? ""
|
? ""
|
||||||
: "Unknown"
|
: "Unknown"
|
||||||
: Sold.Value.ToShortDateString();
|
: Sold.Value.ToShortDateString();
|
||||||
|
|
||||||
|
[NotMapped]
|
||||||
|
public CompanyDescription Description => Descriptions.FirstOrDefault();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -70,13 +70,12 @@ namespace Cicm.Database.Models
|
|||||||
|
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||||
{
|
{
|
||||||
if(!optionsBuilder.IsConfigured)
|
if(optionsBuilder.IsConfigured) return;
|
||||||
{
|
|
||||||
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings.
|
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings.
|
||||||
optionsBuilder.UseMySql("server=localhost;port=3306;user=cicm;password=cicmpass;database=cicm");
|
optionsBuilder.UseMySql("server=localhost;port=3306;user=cicm;password=cicmpass;database=cicm");
|
||||||
optionsBuilder.UseLazyLoadingProxies();
|
optionsBuilder.UseLazyLoadingProxies();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
@@ -238,23 +237,7 @@ namespace Cicm.Database.Models
|
|||||||
.HasConstraintName("fk_companies_sold_to");
|
.HasConstraintName("fk_companies_sold_to");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity<CompanyDescription>(entity =>
|
modelBuilder.Entity<CompanyDescription>().HasIndex(e => e.Text).ForMySqlIsFullText();
|
||||||
{
|
|
||||||
entity.ToTable("company_descriptions");
|
|
||||||
|
|
||||||
entity.HasIndex(e => e.CompanyId).HasName("idx_company_id");
|
|
||||||
|
|
||||||
entity.HasIndex(e => e.Text).HasName("idx_text");
|
|
||||||
|
|
||||||
entity.Property(e => e.Id).HasColumnName("id").HasColumnType("int(11)").ValueGeneratedOnAdd();
|
|
||||||
|
|
||||||
entity.Property(e => e.CompanyId).HasColumnName("company_id").HasColumnType("int(11)");
|
|
||||||
|
|
||||||
entity.Property(e => e.Text).HasColumnName("text").HasColumnType("text");
|
|
||||||
|
|
||||||
entity.HasOne(d => d.Company).WithOne(p => p.Description).HasForeignKey<CompanyDescription>(d => d.Id)
|
|
||||||
.HasConstraintName("fk_company_id");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity<CompanyLogo>(entity =>
|
modelBuilder.Entity<CompanyLogo>(entity =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
// Canary Islands Computer Museum Website
|
// Canary Islands Computer Museum Website
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
@@ -50,7 +50,7 @@ namespace cicm_web.Areas.Admin.Controllers
|
|||||||
_context = context;
|
_context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET: Admin/CompanyDescriptions
|
// GET: CompanyDescription
|
||||||
public async Task<IActionResult> Index()
|
public async Task<IActionResult> Index()
|
||||||
{
|
{
|
||||||
IIncludableQueryable<CompanyDescription, Company> cicmContext =
|
IIncludableQueryable<CompanyDescription, Company> cicmContext =
|
||||||
@@ -58,26 +58,27 @@ namespace cicm_web.Areas.Admin.Controllers
|
|||||||
return View(await cicmContext.ToListAsync());
|
return View(await cicmContext.ToListAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET: Admin/CompanyDescriptions/Details/5
|
// GET: CompanyDescription/Details/5
|
||||||
public async Task<IActionResult> Details(int? id)
|
public async Task<IActionResult> Details(int? id)
|
||||||
{
|
{
|
||||||
if(id == null) return NotFound();
|
if(id == null) return NotFound();
|
||||||
|
|
||||||
CompanyDescription companyDescription =
|
CompanyDescription companyDescription = await _context.CompanyDescriptions
|
||||||
await _context.CompanyDescriptions.Include(c => c.Company).FirstOrDefaultAsync(m => m.Id == id);
|
.Include(c => c.Company)
|
||||||
|
.FirstOrDefaultAsync(m => m.Id == id);
|
||||||
if(companyDescription == null) return NotFound();
|
if(companyDescription == null) return NotFound();
|
||||||
|
|
||||||
return View(companyDescription);
|
return View(companyDescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET: Admin/CompanyDescriptions/Create
|
// GET: CompanyDescription/Create
|
||||||
public IActionResult Create()
|
public IActionResult Create()
|
||||||
{
|
{
|
||||||
ViewData["Id"] = new SelectList(_context.Companies, "Id", "Name");
|
ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name");
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
// POST: Admin/CompanyDescriptions/Create
|
// POST: CompanyDescription/Create
|
||||||
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
|
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
|
||||||
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
|
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
@@ -91,11 +92,11 @@ namespace cicm_web.Areas.Admin.Controllers
|
|||||||
return RedirectToAction(nameof(Index));
|
return RedirectToAction(nameof(Index));
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewData["Id"] = new SelectList(_context.Companies, "Id", "Name", companyDescription.Id);
|
ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", companyDescription.CompanyId);
|
||||||
return View(companyDescription);
|
return View(companyDescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET: Admin/CompanyDescriptions/Edit/5
|
// GET: CompanyDescription/Edit/5
|
||||||
public async Task<IActionResult> Edit(int? id)
|
public async Task<IActionResult> Edit(int? id)
|
||||||
{
|
{
|
||||||
if(id == null) return NotFound();
|
if(id == null) return NotFound();
|
||||||
@@ -103,11 +104,11 @@ namespace cicm_web.Areas.Admin.Controllers
|
|||||||
CompanyDescription companyDescription = await _context.CompanyDescriptions.FindAsync(id);
|
CompanyDescription companyDescription = await _context.CompanyDescriptions.FindAsync(id);
|
||||||
if(companyDescription == null) return NotFound();
|
if(companyDescription == null) return NotFound();
|
||||||
|
|
||||||
ViewData["Id"] = new SelectList(_context.Companies, "Id", "Name", companyDescription.Id);
|
ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", companyDescription.CompanyId);
|
||||||
return View(companyDescription);
|
return View(companyDescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
// POST: Admin/CompanyDescriptions/Edit/5
|
// POST: CompanyDescription/Edit/5
|
||||||
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
|
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
|
||||||
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
|
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
@@ -133,23 +134,24 @@ namespace cicm_web.Areas.Admin.Controllers
|
|||||||
return RedirectToAction(nameof(Index));
|
return RedirectToAction(nameof(Index));
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewData["Id"] = new SelectList(_context.Companies, "Id", "Name", companyDescription.Id);
|
ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", companyDescription.CompanyId);
|
||||||
return View(companyDescription);
|
return View(companyDescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET: Admin/CompanyDescriptions/Delete/5
|
// GET: CompanyDescription/Delete/5
|
||||||
public async Task<IActionResult> Delete(int? id)
|
public async Task<IActionResult> Delete(int? id)
|
||||||
{
|
{
|
||||||
if(id == null) return NotFound();
|
if(id == null) return NotFound();
|
||||||
|
|
||||||
CompanyDescription companyDescription =
|
CompanyDescription companyDescription = await _context.CompanyDescriptions
|
||||||
await _context.CompanyDescriptions.Include(c => c.Company).FirstOrDefaultAsync(m => m.Id == id);
|
.Include(c => c.Company)
|
||||||
|
.FirstOrDefaultAsync(m => m.Id == id);
|
||||||
if(companyDescription == null) return NotFound();
|
if(companyDescription == null) return NotFound();
|
||||||
|
|
||||||
return View(companyDescription);
|
return View(companyDescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
// POST: Admin/CompanyDescriptions/Delete/5
|
// POST: CompanyDescription/Delete/5
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[ActionName("Delete")]
|
[ActionName("Delete")]
|
||||||
[ValidateAntiForgeryToken]
|
[ValidateAntiForgeryToken]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@{
|
@{
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
// Canary Islands Computer Museum Website
|
// Canary Islands Computer Museum Website
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
ViewData["Title"] = "Create";
|
ViewData["Title"] = "Create";
|
||||||
}
|
}
|
||||||
|
|
||||||
<h2>Create</h2>
|
<h1>Create</h1>
|
||||||
|
|
||||||
<h4>Company description</h4>
|
<h4>Company description</h4>
|
||||||
<hr />
|
<hr />
|
||||||
@@ -49,11 +49,10 @@
|
|||||||
<label asp-for="CompanyId"
|
<label asp-for="CompanyId"
|
||||||
class="control-label">
|
class="control-label">
|
||||||
</label>
|
</label>
|
||||||
<input asp-for="CompanyId"
|
<select asp-for="CompanyId"
|
||||||
class="form-control" />
|
class="form-control"
|
||||||
<span asp-validation-for="CompanyId"
|
asp-items="ViewBag.CompanyId">
|
||||||
class="text-danger">
|
</select>
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label asp-for="Text"
|
<label asp-for="Text"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@{
|
@{
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
// Canary Islands Computer Museum Website
|
// Canary Islands Computer Museum Website
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
//
|
//
|
||||||
// --[ Description ] ----------------------------------------------------------
|
// --[ Description ] ----------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Admin view delete
|
// Admin view create
|
||||||
//
|
//
|
||||||
// --[ License ] --------------------------------------------------------------
|
// --[ License ] --------------------------------------------------------------
|
||||||
//
|
//
|
||||||
@@ -35,36 +35,36 @@
|
|||||||
ViewData["Title"] = "Delete";
|
ViewData["Title"] = "Delete";
|
||||||
}
|
}
|
||||||
|
|
||||||
<h2>Delete</h2>
|
<h1>Delete</h1>
|
||||||
|
|
||||||
<h3>Are you sure you want to delete this?</h3>
|
<h3>Are you sure you want to delete this?</h3>
|
||||||
<div>
|
<div>
|
||||||
<h4>Company description</h4>
|
<h4>Company description</h4>
|
||||||
<hr />
|
<hr />
|
||||||
<dl class="dl-horizontal">
|
<dl class="row">
|
||||||
<dt>
|
<dt class="col-sm-2">
|
||||||
@Html.DisplayNameFor(model => model.CompanyId)
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
@Html.DisplayFor(model => model.CompanyId)
|
|
||||||
</dd>
|
|
||||||
<dt>
|
|
||||||
@Html.DisplayNameFor(model => model.Text)
|
@Html.DisplayNameFor(model => model.Text)
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd class="col-sm-10">
|
||||||
@Html.DisplayFor(model => model.Text)
|
@Html.DisplayFor(model => model.Text)
|
||||||
</dd>
|
</dd>
|
||||||
<dt>
|
<dt class="col-sm-2">
|
||||||
@Html.DisplayNameFor(model => model.Company)
|
@Html.DisplayNameFor(model => model.Company)
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd class="col-sm-10">
|
||||||
@Html.DisplayFor(model => model.Company.Name)
|
@Html.DisplayFor(model => model.Company.Name)
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<form asp-action="Delete">
|
<form asp-action="Delete">
|
||||||
<input type="hidden" asp-for="Id" />
|
<input type="hidden"
|
||||||
<input type="submit" value="Delete" class="btn btn-default" /> |
|
asp-for="Id" />
|
||||||
<a asp-action="Index">Back to List</a>
|
<input class="btn btn-danger"
|
||||||
|
type="submit"
|
||||||
|
value="Delete" />
|
||||||
|
<a asp-action="Index"
|
||||||
|
class="btn btn-secondary">
|
||||||
|
Back to List
|
||||||
|
</a>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@{
|
@{
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
// Canary Islands Computer Museum Website
|
// Canary Islands Computer Museum Website
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
//
|
//
|
||||||
// --[ Description ] ----------------------------------------------------------
|
// --[ Description ] ----------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Admin view details
|
// Admin view create
|
||||||
//
|
//
|
||||||
// --[ License ] --------------------------------------------------------------
|
// --[ License ] --------------------------------------------------------------
|
||||||
//
|
//
|
||||||
@@ -35,33 +35,34 @@
|
|||||||
ViewData["Title"] = "Details";
|
ViewData["Title"] = "Details";
|
||||||
}
|
}
|
||||||
|
|
||||||
<h2>Details</h2>
|
<h1>Details</h1>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<h4>Company description</h4>
|
<h4>Company description</h4>
|
||||||
<hr />
|
<hr />
|
||||||
<dl class="dl-horizontal">
|
<dl class="row">
|
||||||
<dt>
|
<dt class="col-sm-2">
|
||||||
@Html.DisplayNameFor(model => model.CompanyId)
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
@Html.DisplayFor(model => model.CompanyId)
|
|
||||||
</dd>
|
|
||||||
<dt>
|
|
||||||
@Html.DisplayNameFor(model => model.Text)
|
@Html.DisplayNameFor(model => model.Text)
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd class="col-sm-10">
|
||||||
@Html.DisplayFor(model => model.Text)
|
@Html.DisplayFor(model => model.Text)
|
||||||
</dd>
|
</dd>
|
||||||
<dt>
|
<dt class="col-sm-2">
|
||||||
@Html.DisplayNameFor(model => model.Company)
|
@Html.DisplayNameFor(model => model.Company)
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd class="col-sm-10">
|
||||||
@Html.DisplayFor(model => model.Company.Name)
|
@Html.DisplayFor(model => model.Company.Name)
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a asp-action="Edit" asp-route-id="@Model.Id">Edit</a> |
|
<a asp-action="Edit"
|
||||||
<a asp-action="Index">Back to List</a>
|
asp-route-id="@Model.Id"
|
||||||
|
class="btn btn-primary">
|
||||||
|
Edit
|
||||||
|
</a>
|
||||||
|
<a asp-action="Index"
|
||||||
|
class="btn btn-secondary">
|
||||||
|
Back to List
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@{
|
@{
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
// Canary Islands Computer Museum Website
|
// Canary Islands Computer Museum Website
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
//
|
//
|
||||||
// --[ Description ] ----------------------------------------------------------
|
// --[ Description ] ----------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Admin view edit
|
// Admin view create
|
||||||
//
|
//
|
||||||
// --[ License ] --------------------------------------------------------------
|
// --[ License ] --------------------------------------------------------------
|
||||||
//
|
//
|
||||||
@@ -35,9 +35,9 @@
|
|||||||
ViewData["Title"] = "Edit";
|
ViewData["Title"] = "Edit";
|
||||||
}
|
}
|
||||||
|
|
||||||
<h2>Edit</h2>
|
<h1>Edit</h1>
|
||||||
|
|
||||||
<h4>Company description</h4>
|
<h4>CompanyDescription</h4>
|
||||||
<hr />
|
<hr />
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
@@ -51,8 +51,10 @@
|
|||||||
<label asp-for="CompanyId"
|
<label asp-for="CompanyId"
|
||||||
class="control-label">
|
class="control-label">
|
||||||
</label>
|
</label>
|
||||||
<input asp-for="CompanyId"
|
<select asp-for="CompanyId"
|
||||||
class="form-control" />
|
class="form-control"
|
||||||
|
asp-items="ViewBag.CompanyId">
|
||||||
|
</select>
|
||||||
<span asp-validation-for="CompanyId"
|
<span asp-validation-for="CompanyId"
|
||||||
class="text-danger">
|
class="text-danger">
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@{
|
@{
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
// Canary Islands Computer Museum Website
|
// Canary Islands Computer Museum Website
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
//
|
//
|
||||||
// --[ Description ] ----------------------------------------------------------
|
// --[ Description ] ----------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Admin view index
|
// Admin view create
|
||||||
//
|
//
|
||||||
// --[ License ] --------------------------------------------------------------
|
// --[ License ] --------------------------------------------------------------
|
||||||
//
|
//
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
ViewData["Title"] = "Company descriptions (Admin)";
|
ViewData["Title"] = "Company descriptions (Admin)";
|
||||||
}
|
}
|
||||||
|
|
||||||
<h2>Company descriptions</h2>
|
<h1>Company description</h1>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a asp-action="Create"
|
<a asp-action="Create"
|
||||||
@@ -47,9 +47,6 @@
|
|||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
|
||||||
@Html.DisplayNameFor(model => model.CompanyId)
|
|
||||||
</th>
|
|
||||||
<th>
|
<th>
|
||||||
@Html.DisplayNameFor(model => model.Text)
|
@Html.DisplayNameFor(model => model.Text)
|
||||||
</th>
|
</th>
|
||||||
@@ -63,9 +60,6 @@
|
|||||||
@foreach(CompanyDescription item in Model)
|
@foreach(CompanyDescription item in Model)
|
||||||
{
|
{
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
|
||||||
@Html.DisplayFor(modelItem => item.CompanyId)
|
|
||||||
</td>
|
|
||||||
<td>
|
<td>
|
||||||
@Html.DisplayFor(modelItem => item.Text)
|
@Html.DisplayFor(modelItem => item.Text)
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||||
<Version>3.0.99.398</Version>
|
<Version>3.0.99.414</Version>
|
||||||
<Company>Canary Islands Computer Museum</Company>
|
<Company>Canary Islands Computer Museum</Company>
|
||||||
<Copyright>Copyright © 2003-2018 Natalia Portillo</Copyright>
|
<Copyright>Copyright © 2003-2018 Natalia Portillo</Copyright>
|
||||||
<Product>Canary Islands Computer Museum Website</Product>
|
<Product>Canary Islands Computer Museum Website</Product>
|
||||||
|
|||||||
Reference in New Issue
Block a user