Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
0fad61dfbc |
@ -247,7 +247,7 @@ namespace ZooClientApp.Controllers
|
||||
ClientId = APIClient.Client.Id,
|
||||
RoutePreserves = a,
|
||||
|
||||
RoutePrice = 100,
|
||||
RoutePrice = 1000,
|
||||
RouteName = name
|
||||
});
|
||||
Response.Redirect("IndexRoute");
|
||||
@ -262,6 +262,10 @@ namespace ZooClientApp.Controllers
|
||||
{
|
||||
return View();
|
||||
}
|
||||
public IActionResult Payment()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
[HttpGet]
|
||||
public IActionResult AnimalServices()
|
||||
{
|
||||
|
@ -8,7 +8,7 @@
|
||||
<div class="list-group">
|
||||
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="IndexRoute">Создание маршрута</a>
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Payment">Оплата</a>
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Payment">Оплата</a>
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Reports">Отчеты</a>
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Enter">Вход</a>
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Register">Регистрация</a>
|
||||
|
@ -17,27 +17,6 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-8"></div>
|
||||
<div class="col-4"><input type="submit" value="Создать" class="btn btn-primary" /></div>
|
||||
<div class="col-4"><input type="submit" value="оплатить" class="btn btn-primary" /></div>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
$('#canned').on('change', function () {
|
||||
check();
|
||||
});
|
||||
$('#count').on('change', function () {
|
||||
check();
|
||||
});
|
||||
|
||||
function check() {
|
||||
var count = $('#count').val();
|
||||
var canned = $('#canned').val();
|
||||
if (count && canned) {
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "/Home/Calc",
|
||||
data: { count: count, canned: canned },
|
||||
success: function (result) {
|
||||
$("#sum").val(result);
|
||||
}
|
||||
});
|
||||
};
|
@ -1,13 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ZooContracts.SearchModels
|
||||
{
|
||||
public class ListPreservesSearchModel
|
||||
{
|
||||
public List<int>? PreservesIds { get; set; }
|
||||
}
|
||||
}
|
@ -1,260 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
using ZooDataBaseImplement;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ZooDataBaseImplement.Migrations
|
||||
{
|
||||
[DbContext(typeof(ZooDatabase))]
|
||||
[Migration("20240531221729_initialCreate")]
|
||||
partial class initialCreate
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "7.0.3")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("ZooDataBaseImplement.Models.Client", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ClientFIO")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("EMail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Clients");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ZooDataBaseImplement.Models.Cost", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("CostName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<double>("CostPrice")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<int>("EmployeeId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Costs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ZooDataBaseImplement.Models.Employee", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("EmployeeFIO")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Login")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Employees");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ZooDataBaseImplement.Models.Preserve", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("EmployeeId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("PreserveName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<double>("PreservePrice")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeId");
|
||||
|
||||
b.ToTable("Preserves");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ZooDataBaseImplement.Models.Route", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("CostId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("DateFinish")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime>("DateStart")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("RouteName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<double>("RoutePrice")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.HasIndex("CostId");
|
||||
|
||||
b.ToTable("Routes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ZooDataBaseImplement.Models.RoutePreserve", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("PreserveID")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("RouteID")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("PreserveID");
|
||||
|
||||
b.HasIndex("RouteID");
|
||||
|
||||
b.ToTable("RoutePreserves");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ZooDataBaseImplement.Models.Preserve", b =>
|
||||
{
|
||||
b.HasOne("ZooDataBaseImplement.Models.Employee", null)
|
||||
.WithMany("Preserves")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ZooDataBaseImplement.Models.Route", b =>
|
||||
{
|
||||
b.HasOne("ZooDataBaseImplement.Models.Client", "Client")
|
||||
.WithMany("Routes")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ZooDataBaseImplement.Models.Cost", null)
|
||||
.WithMany("Routes")
|
||||
.HasForeignKey("CostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Client");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ZooDataBaseImplement.Models.RoutePreserve", b =>
|
||||
{
|
||||
b.HasOne("ZooDataBaseImplement.Models.Preserve", "Preserve")
|
||||
.WithMany("RoutePreserves")
|
||||
.HasForeignKey("PreserveID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ZooDataBaseImplement.Models.Route", "Route")
|
||||
.WithMany("Preserves")
|
||||
.HasForeignKey("RouteID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Preserve");
|
||||
|
||||
b.Navigation("Route");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ZooDataBaseImplement.Models.Client", b =>
|
||||
{
|
||||
b.Navigation("Routes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ZooDataBaseImplement.Models.Cost", b =>
|
||||
{
|
||||
b.Navigation("Routes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ZooDataBaseImplement.Models.Employee", b =>
|
||||
{
|
||||
b.Navigation("Preserves");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ZooDataBaseImplement.Models.Preserve", b =>
|
||||
{
|
||||
b.Navigation("RoutePreserves");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ZooDataBaseImplement.Models.Route", b =>
|
||||
{
|
||||
b.Navigation("Preserves");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -1,186 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ZooDataBaseImplement.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class initialCreate : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Clients",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
ClientFIO = table.Column<string>(type: "text", nullable: false),
|
||||
EMail = table.Column<string>(type: "text", nullable: false),
|
||||
Password = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Clients", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Costs",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
EmployeeId = table.Column<int>(type: "integer", nullable: false),
|
||||
CostName = table.Column<string>(type: "text", nullable: false),
|
||||
CostPrice = table.Column<double>(type: "double precision", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Costs", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Employees",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
EmployeeFIO = table.Column<string>(type: "text", nullable: false),
|
||||
Login = table.Column<string>(type: "text", nullable: false),
|
||||
Password = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Employees", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Routes",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
ClientId = table.Column<int>(type: "integer", nullable: false),
|
||||
CostId = table.Column<int>(type: "integer", nullable: false),
|
||||
RouteName = table.Column<string>(type: "text", nullable: false),
|
||||
RoutePrice = table.Column<double>(type: "double precision", nullable: false),
|
||||
Status = table.Column<int>(type: "integer", nullable: false),
|
||||
DateStart = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
DateFinish = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Routes", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Routes_Clients_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "Clients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_Routes_Costs_CostId",
|
||||
column: x => x.CostId,
|
||||
principalTable: "Costs",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Preserves",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
EmployeeId = table.Column<int>(type: "integer", nullable: false),
|
||||
PreserveName = table.Column<string>(type: "text", nullable: false),
|
||||
PreservePrice = table.Column<double>(type: "double precision", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Preserves", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Preserves_Employees_EmployeeId",
|
||||
column: x => x.EmployeeId,
|
||||
principalTable: "Employees",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "RoutePreserves",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
RouteID = table.Column<int>(type: "integer", nullable: false),
|
||||
PreserveID = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_RoutePreserves", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_RoutePreserves_Preserves_PreserveID",
|
||||
column: x => x.PreserveID,
|
||||
principalTable: "Preserves",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_RoutePreserves_Routes_RouteID",
|
||||
column: x => x.RouteID,
|
||||
principalTable: "Routes",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Preserves_EmployeeId",
|
||||
table: "Preserves",
|
||||
column: "EmployeeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RoutePreserves_PreserveID",
|
||||
table: "RoutePreserves",
|
||||
column: "PreserveID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RoutePreserves_RouteID",
|
||||
table: "RoutePreserves",
|
||||
column: "RouteID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Routes_ClientId",
|
||||
table: "Routes",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Routes_CostId",
|
||||
table: "Routes",
|
||||
column: "CostId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "RoutePreserves");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Preserves");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Routes");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Employees");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Clients");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Costs");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user