Правки и тесты
This commit is contained in:
parent
c8723a1f49
commit
76086d8d76
@ -20,6 +20,8 @@ namespace AccountingWarehouseProductsContracts.BindingModels
|
|||||||
|
|
||||||
public string SupplierName { get; set; } = string.Empty;
|
public string SupplierName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string WarehouseName { get; set; } = string.Empty;
|
||||||
|
|
||||||
public int Count { get; set; }
|
public int Count { get; set; }
|
||||||
|
|
||||||
public double Sum { get; set; }
|
public double Sum { get; set; }
|
||||||
|
@ -15,9 +15,9 @@ namespace AccountingWarehouseProductsContracts.BindingModels
|
|||||||
|
|
||||||
public double Cost { get; set; }
|
public double Cost { get; set; }
|
||||||
|
|
||||||
public string DateofFabrication { get; set; } = string.Empty;
|
public DateTime DateofFabrication { get; set; }
|
||||||
|
|
||||||
public string ValidUntil { get; set; } = string.Empty;
|
public DateTime? ValidUntil { get; set; }
|
||||||
|
|
||||||
public string Category { get; set; } = string.Empty;
|
public string Category { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ namespace AccountingWarehouseProductsContracts.BindingModels
|
|||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
public string ShipmentDate { get; set; } = string.Empty;
|
public DateTime? ShipmentDate { get; set; }
|
||||||
|
|
||||||
public int Count { get; set; }
|
public int Count { get; set; }
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ namespace AccountingWarehouseProductsContracts.BindingModels
|
|||||||
|
|
||||||
public string StandName { get; set; } = string.Empty;
|
public string StandName { get; set; } = string.Empty;
|
||||||
|
|
||||||
public string DeliveryDate { get; set; } = string.Empty;
|
public DateTime? DeliveryDate { get; set; }
|
||||||
|
|
||||||
public int Count { get; set; }
|
public int Count { get; set; }
|
||||||
|
|
||||||
|
@ -19,6 +19,9 @@ namespace AccountingWarehouseProductsContracts.ViewModels
|
|||||||
[DisplayName("Название продукта")]
|
[DisplayName("Название продукта")]
|
||||||
public string ProductName { get; set; }
|
public string ProductName { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("Название поставщика")]
|
||||||
|
public string SupplierName { get; set; }
|
||||||
|
|
||||||
[DisplayName("Количество")]
|
[DisplayName("Количество")]
|
||||||
public int Count { get; set; }
|
public int Count { get; set; }
|
||||||
|
|
||||||
|
@ -19,10 +19,10 @@ namespace AccountingWarehouseProductsContracts.ViewModels
|
|||||||
public double Cost { get; set; }
|
public double Cost { get; set; }
|
||||||
|
|
||||||
[DisplayName("Дата изготовления")]
|
[DisplayName("Дата изготовления")]
|
||||||
public string? DateofFabrication { get; set; } = string.Empty;
|
public DateTime DateofFabrication { get; set; }
|
||||||
|
|
||||||
[DisplayName("Годен до")]
|
[DisplayName("Годен до")]
|
||||||
public string ValidUntil { get; set; } = string.Empty;
|
public DateTime? ValidUntil { get; set; }
|
||||||
|
|
||||||
[DisplayName("Категория")]
|
[DisplayName("Категория")]
|
||||||
public string Category { get; set; } = string.Empty;
|
public string Category { get; set; } = string.Empty;
|
||||||
|
@ -14,7 +14,7 @@ namespace AccountingWarehouseProductsContracts.ViewModels
|
|||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
[DisplayName("Дата отгрузки")]
|
[DisplayName("Дата отгрузки")]
|
||||||
public string ShipmentDate { get; set; } = string.Empty;
|
public DateTime? ShipmentDate { get; set; }
|
||||||
|
|
||||||
[DisplayName("Количество")]
|
[DisplayName("Количество")]
|
||||||
public int Count { get; set; }
|
public int Count { get; set; }
|
||||||
|
@ -18,7 +18,7 @@ namespace AccountingWarehouseProductsContracts.ViewModels
|
|||||||
public string StandName { get; set; } = string.Empty;
|
public string StandName { get; set; } = string.Empty;
|
||||||
|
|
||||||
[DisplayName("Дата поставки")]
|
[DisplayName("Дата поставки")]
|
||||||
public string? DeliveryDate { get; set; } = string.Empty;
|
public DateTime? DeliveryDate { get; set; }
|
||||||
|
|
||||||
[DisplayName("Количество")]
|
[DisplayName("Количество")]
|
||||||
public int Count { get; set; }
|
public int Count { get; set; }
|
||||||
|
@ -13,6 +13,8 @@ namespace AccountingWarehouseProductsDataModels.Models
|
|||||||
|
|
||||||
string ProductName { get; }
|
string ProductName { get; }
|
||||||
|
|
||||||
|
string SupplierName { get; }
|
||||||
|
|
||||||
int Count { get; }
|
int Count { get; }
|
||||||
|
|
||||||
double Sum { get; }
|
double Sum { get; }
|
||||||
|
@ -12,9 +12,9 @@ namespace AccountingWarehouseProductsDataModels.Models
|
|||||||
|
|
||||||
double Cost { get; }
|
double Cost { get; }
|
||||||
|
|
||||||
string DateofFabrication { get; }
|
DateTime DateofFabrication { get; }
|
||||||
|
|
||||||
string ValidUntil { get; }
|
DateTime? ValidUntil { get; }
|
||||||
|
|
||||||
string Category { get; }
|
string Category { get; }
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ namespace AccountingWarehouseProductsDataModels.Models
|
|||||||
{
|
{
|
||||||
public interface IShipmentModel : IId
|
public interface IShipmentModel : IId
|
||||||
{
|
{
|
||||||
string ShipmentDate { get; }
|
DateTime? ShipmentDate { get; }
|
||||||
|
|
||||||
int Count { get; }
|
int Count { get; }
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ namespace AccountingWarehouseProductsDataModels.Models
|
|||||||
public interface IStandModel : IId
|
public interface IStandModel : IId
|
||||||
{
|
{
|
||||||
string StandName { get; }
|
string StandName { get; }
|
||||||
string? DeliveryDate { get; }
|
DateTime? DeliveryDate { get; }
|
||||||
|
|
||||||
int Count { get; }
|
int Count { get; }
|
||||||
|
|
||||||
|
@ -0,0 +1,333 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using AccountingWarehouseProductsDatabaseImplement;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace AccountingWarehouseProductsDatabaseImplement.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(AccountingWarehouseProductsDatabase))]
|
||||||
|
[Migration("20240507105735_SecondMigration")]
|
||||||
|
partial class SecondMigration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "7.0.17")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.Order", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Count")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DateImplement")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DateofOrder")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("ProductId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ProductName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Status")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("Sum")
|
||||||
|
.HasColumnType("float");
|
||||||
|
|
||||||
|
b.Property<int>("SupplierId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("SupplierName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("WarehouseName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ProductId");
|
||||||
|
|
||||||
|
b.ToTable("Orders");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.OrderProduct", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Count")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("OrderId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProductId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("OrderId");
|
||||||
|
|
||||||
|
b.HasIndex("ProductId");
|
||||||
|
|
||||||
|
b.ToTable("OrderProduct");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.Product", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Category")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<double>("Cost")
|
||||||
|
.HasColumnType("float");
|
||||||
|
|
||||||
|
b.Property<string>("DateofFabrication")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("ProductName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("ValidUntil")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Products");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.Shipment", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Count")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("OrderId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Recipient")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("ShipmentDate")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Shipments");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.Stand", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Count")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("DeliveryDate")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("ProductId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("StandName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("SupplierId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Stands");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.Supplier", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("ContactPerson")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Phone")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("SupplierName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Suppliers");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.Warehouse", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Address")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Capacity")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("WarehouseName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Warehouses");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.WarehouseProduct", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Count")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProductId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("WarehouseId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ProductId");
|
||||||
|
|
||||||
|
b.HasIndex("WarehouseId");
|
||||||
|
|
||||||
|
b.ToTable("WarehouseProduct");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.Order", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("AccountingWarehouseProductsDatabaseImplement.Models.Product", "Product")
|
||||||
|
.WithMany("Orders")
|
||||||
|
.HasForeignKey("ProductId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Product");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.OrderProduct", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("AccountingWarehouseProductsDatabaseImplement.Models.Order", "Order")
|
||||||
|
.WithMany("Products")
|
||||||
|
.HasForeignKey("OrderId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("AccountingWarehouseProductsDatabaseImplement.Models.Product", "Product")
|
||||||
|
.WithMany("OrderProduct")
|
||||||
|
.HasForeignKey("ProductId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Order");
|
||||||
|
|
||||||
|
b.Navigation("Product");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.WarehouseProduct", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("AccountingWarehouseProductsDatabaseImplement.Models.Product", "Product")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ProductId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("AccountingWarehouseProductsDatabaseImplement.Models.Warehouse", "Warehouse")
|
||||||
|
.WithMany("Products")
|
||||||
|
.HasForeignKey("WarehouseId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Product");
|
||||||
|
|
||||||
|
b.Navigation("Warehouse");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.Order", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Products");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.Product", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("OrderProduct");
|
||||||
|
|
||||||
|
b.Navigation("Orders");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.Warehouse", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Products");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace AccountingWarehouseProductsDatabaseImplement.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class SecondMigration : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "SupplierName",
|
||||||
|
table: "Orders",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "WarehouseName",
|
||||||
|
table: "Orders",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "SupplierName",
|
||||||
|
table: "Orders");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "WarehouseName",
|
||||||
|
table: "Orders");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,328 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using AccountingWarehouseProductsDatabaseImplement;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace AccountingWarehouseProductsDatabaseImplement.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(AccountingWarehouseProductsDatabase))]
|
||||||
|
[Migration("20240507120148_ThirdMigration")]
|
||||||
|
partial class ThirdMigration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "7.0.17")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.Order", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Count")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DateImplement")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DateofOrder")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("ProductId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ProductName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Status")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("Sum")
|
||||||
|
.HasColumnType("float");
|
||||||
|
|
||||||
|
b.Property<int>("SupplierId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("SupplierName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ProductId");
|
||||||
|
|
||||||
|
b.ToTable("Orders");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.OrderProduct", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Count")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("OrderId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProductId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("OrderId");
|
||||||
|
|
||||||
|
b.HasIndex("ProductId");
|
||||||
|
|
||||||
|
b.ToTable("OrderProduct");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.Product", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Category")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<double>("Cost")
|
||||||
|
.HasColumnType("float");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DateofFabrication")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("ProductName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("ValidUntil")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Products");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.Shipment", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Count")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("OrderId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Recipient")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("ShipmentDate")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Shipments");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.Stand", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Count")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DeliveryDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("ProductId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("StandName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("SupplierId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Stands");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.Supplier", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("ContactPerson")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Phone")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("SupplierName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Suppliers");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.Warehouse", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Address")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Capacity")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("WarehouseName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Warehouses");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.WarehouseProduct", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Count")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProductId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("WarehouseId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ProductId");
|
||||||
|
|
||||||
|
b.HasIndex("WarehouseId");
|
||||||
|
|
||||||
|
b.ToTable("WarehouseProduct");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.Order", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("AccountingWarehouseProductsDatabaseImplement.Models.Product", "Product")
|
||||||
|
.WithMany("Orders")
|
||||||
|
.HasForeignKey("ProductId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Product");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.OrderProduct", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("AccountingWarehouseProductsDatabaseImplement.Models.Order", "Order")
|
||||||
|
.WithMany("Products")
|
||||||
|
.HasForeignKey("OrderId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("AccountingWarehouseProductsDatabaseImplement.Models.Product", "Product")
|
||||||
|
.WithMany("OrderProduct")
|
||||||
|
.HasForeignKey("ProductId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Order");
|
||||||
|
|
||||||
|
b.Navigation("Product");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.WarehouseProduct", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("AccountingWarehouseProductsDatabaseImplement.Models.Product", "Product")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ProductId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("AccountingWarehouseProductsDatabaseImplement.Models.Warehouse", "Warehouse")
|
||||||
|
.WithMany("Products")
|
||||||
|
.HasForeignKey("WarehouseId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Product");
|
||||||
|
|
||||||
|
b.Navigation("Warehouse");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.Order", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Products");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.Product", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("OrderProduct");
|
||||||
|
|
||||||
|
b.Navigation("Orders");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AccountingWarehouseProductsDatabaseImplement.Models.Warehouse", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Products");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,96 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace AccountingWarehouseProductsDatabaseImplement.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class ThirdMigration : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "WarehouseName",
|
||||||
|
table: "Orders");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<DateTime>(
|
||||||
|
name: "DeliveryDate",
|
||||||
|
table: "Stands",
|
||||||
|
type: "datetime2",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "nvarchar(max)",
|
||||||
|
oldNullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<DateTime>(
|
||||||
|
name: "ShipmentDate",
|
||||||
|
table: "Shipments",
|
||||||
|
type: "datetime2",
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "nvarchar(max)");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<DateTime>(
|
||||||
|
name: "ValidUntil",
|
||||||
|
table: "Products",
|
||||||
|
type: "datetime2",
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "nvarchar(max)");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<DateTime>(
|
||||||
|
name: "DateofFabrication",
|
||||||
|
table: "Products",
|
||||||
|
type: "datetime2",
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "nvarchar(max)");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "DeliveryDate",
|
||||||
|
table: "Stands",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(DateTime),
|
||||||
|
oldType: "datetime2",
|
||||||
|
oldNullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "ShipmentDate",
|
||||||
|
table: "Shipments",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(DateTime),
|
||||||
|
oldType: "datetime2");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "ValidUntil",
|
||||||
|
table: "Products",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(DateTime),
|
||||||
|
oldType: "datetime2");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "DateofFabrication",
|
||||||
|
table: "Products",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(DateTime),
|
||||||
|
oldType: "datetime2");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "WarehouseName",
|
||||||
|
table: "Orders",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -55,6 +55,10 @@ namespace AccountingWarehouseProductsDatabaseImplement.Migrations
|
|||||||
b.Property<int>("SupplierId")
|
b.Property<int>("SupplierId")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("SupplierName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("ProductId");
|
b.HasIndex("ProductId");
|
||||||
@ -103,17 +107,16 @@ namespace AccountingWarehouseProductsDatabaseImplement.Migrations
|
|||||||
b.Property<double>("Cost")
|
b.Property<double>("Cost")
|
||||||
.HasColumnType("float");
|
.HasColumnType("float");
|
||||||
|
|
||||||
b.Property<string>("DateofFabrication")
|
b.Property<DateTime>("DateofFabrication")
|
||||||
.IsRequired()
|
.HasColumnType("datetime2");
|
||||||
.HasColumnType("nvarchar(max)");
|
|
||||||
|
|
||||||
b.Property<string>("ProductName")
|
b.Property<string>("ProductName")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
b.Property<string>("ValidUntil")
|
b.Property<DateTime?>("ValidUntil")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
@ -138,9 +141,9 @@ namespace AccountingWarehouseProductsDatabaseImplement.Migrations
|
|||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
b.Property<string>("ShipmentDate")
|
b.Property<DateTime?>("ShipmentDate")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
@ -158,8 +161,8 @@ namespace AccountingWarehouseProductsDatabaseImplement.Migrations
|
|||||||
b.Property<int>("Count")
|
b.Property<int>("Count")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.Property<string>("DeliveryDate")
|
b.Property<DateTime?>("DeliveryDate")
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
b.Property<int>("ProductId")
|
b.Property<int>("ProductId")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
@ -22,6 +22,8 @@ namespace AccountingWarehouseProductsDatabaseImplement.Models
|
|||||||
|
|
||||||
public string ProductName { get; set; }
|
public string ProductName { get; set; }
|
||||||
|
|
||||||
|
public string SupplierName { get; set; }
|
||||||
|
|
||||||
public int Count { get; set; }
|
public int Count { get; set; }
|
||||||
|
|
||||||
public double Sum { get; set; }
|
public double Sum { get; set; }
|
||||||
@ -59,6 +61,7 @@ namespace AccountingWarehouseProductsDatabaseImplement.Models
|
|||||||
ProductId = model.ProductId,
|
ProductId = model.ProductId,
|
||||||
SupplierId = model.SupplierId,
|
SupplierId = model.SupplierId,
|
||||||
ProductName = model.ProductName,
|
ProductName = model.ProductName,
|
||||||
|
SupplierName = model.SupplierName,
|
||||||
Count = model.Count,
|
Count = model.Count,
|
||||||
Sum = model.Sum,
|
Sum = model.Sum,
|
||||||
Status = model.Status,
|
Status = model.Status,
|
||||||
@ -92,6 +95,7 @@ namespace AccountingWarehouseProductsDatabaseImplement.Models
|
|||||||
ProductId = ProductId,
|
ProductId = ProductId,
|
||||||
SupplierId = SupplierId,
|
SupplierId = SupplierId,
|
||||||
ProductName = ProductName,
|
ProductName = ProductName,
|
||||||
|
SupplierName = SupplierName,
|
||||||
Count = Count,
|
Count = Count,
|
||||||
Sum = Sum,
|
Sum = Sum,
|
||||||
Status = Status,
|
Status = Status,
|
||||||
|
@ -22,30 +22,15 @@ namespace AccountingWarehouseProductsDatabaseImplement.Models
|
|||||||
[Required]
|
[Required]
|
||||||
public double Cost { get; set; }
|
public double Cost { get; set; }
|
||||||
|
|
||||||
//private Dictionary<int, (IOrderModel, int)>? _orderProducts = null;
|
[Required]
|
||||||
|
public DateTime DateofFabrication { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public string? DateofFabrication { get; set; } = string.Empty;
|
public DateTime? ValidUntil { get; set; }
|
||||||
|
|
||||||
[Required]
|
|
||||||
public string ValidUntil { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public string Category { get; set; } = string.Empty;
|
public string Category { get; set; } = string.Empty;
|
||||||
|
|
||||||
//[NotMapped]
|
|
||||||
//public Dictionary<int, (IOrderModel, int)> OrderProducts
|
|
||||||
//{
|
|
||||||
// get
|
|
||||||
// {
|
|
||||||
// if (_orderProducts == null)
|
|
||||||
// {
|
|
||||||
// _orderProducts = Products.ToDictionary(recPC => recPC.ProductId, recPC => (recPC.Product as IProductModel, recPC.Count));
|
|
||||||
// }
|
|
||||||
// return _orderProducts;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
[ForeignKey("ProductId")]
|
[ForeignKey("ProductId")]
|
||||||
public virtual List<OrderProduct> OrderProduct { get; set; } = new();
|
public virtual List<OrderProduct> OrderProduct { get; set; } = new();
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ namespace AccountingWarehouseProductsDatabaseImplement.Models
|
|||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public string ShipmentDate { get; set; } = string.Empty;
|
public DateTime? ShipmentDate { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public int Count { get; set; }
|
public int Count { get; set; }
|
||||||
|
@ -14,7 +14,7 @@ namespace AccountingWarehouseProductsDatabaseImplement.Models
|
|||||||
|
|
||||||
public string StandName { get; set; } = string.Empty;
|
public string StandName { get; set; } = string.Empty;
|
||||||
|
|
||||||
public string? DeliveryDate { get; set; } = string.Empty;
|
public DateTime? DeliveryDate { get; set; }
|
||||||
|
|
||||||
public int Count { get; set; }
|
public int Count { get; set; }
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
buttonArrangeOrder = new Button();
|
buttonArrangeOrder = new Button();
|
||||||
buttonChekOrder = new Button();
|
buttonChekOrder = new Button();
|
||||||
buttonDeliverOrder = new Button();
|
buttonDeliverOrder = new Button();
|
||||||
|
buttonTest = new Button();
|
||||||
menuStrip1.SuspendLayout();
|
menuStrip1.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
@ -173,11 +174,22 @@
|
|||||||
buttonDeliverOrder.UseVisualStyleBackColor = true;
|
buttonDeliverOrder.UseVisualStyleBackColor = true;
|
||||||
buttonDeliverOrder.Click += buttonDeliverOrder_Click;
|
buttonDeliverOrder.Click += buttonDeliverOrder_Click;
|
||||||
//
|
//
|
||||||
|
// buttonTest
|
||||||
|
//
|
||||||
|
buttonTest.Location = new Point(1106, 366);
|
||||||
|
buttonTest.Name = "buttonTest";
|
||||||
|
buttonTest.Size = new Size(129, 43);
|
||||||
|
buttonTest.TabIndex = 8;
|
||||||
|
buttonTest.Text = "Тест времени";
|
||||||
|
buttonTest.UseVisualStyleBackColor = true;
|
||||||
|
buttonTest.Click += buttonTest_Click;
|
||||||
|
//
|
||||||
// FormMain
|
// FormMain
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(1260, 450);
|
ClientSize = new Size(1260, 450);
|
||||||
|
Controls.Add(buttonTest);
|
||||||
Controls.Add(buttonDeliverOrder);
|
Controls.Add(buttonDeliverOrder);
|
||||||
Controls.Add(buttonChekOrder);
|
Controls.Add(buttonChekOrder);
|
||||||
Controls.Add(buttonArrangeOrder);
|
Controls.Add(buttonArrangeOrder);
|
||||||
@ -213,5 +225,6 @@
|
|||||||
private Button buttonArrangeOrder;
|
private Button buttonArrangeOrder;
|
||||||
private Button buttonChekOrder;
|
private Button buttonChekOrder;
|
||||||
private Button buttonDeliverOrder;
|
private Button buttonDeliverOrder;
|
||||||
|
private Button buttonTest;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -16,10 +16,12 @@ namespace AccountingWarehouseProductsView
|
|||||||
public partial class FormMain : Form
|
public partial class FormMain : Form
|
||||||
{
|
{
|
||||||
private readonly IOrderLogic _logic;
|
private readonly IOrderLogic _logic;
|
||||||
public FormMain(IOrderLogic logic)
|
private readonly IProductLogic _productLogic;
|
||||||
|
public FormMain(IOrderLogic logic, IProductLogic productLogic)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_logic = logic;
|
_logic = logic;
|
||||||
|
_productLogic = productLogic;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void продуктToolStripMenuItem_Click(object sender, EventArgs e)
|
private void продуктToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
@ -225,5 +227,23 @@ namespace AccountingWarehouseProductsView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void buttonTest_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
ProductBindingModel model = new ProductBindingModel()
|
||||||
|
{
|
||||||
|
ProductName = "Вкуснятина",
|
||||||
|
Cost = 1000000,
|
||||||
|
DateofFabrication = DateTime.Now,
|
||||||
|
ValidUntil = null,
|
||||||
|
Category = "Вкусное"
|
||||||
|
};
|
||||||
|
|
||||||
|
DateTime start = DateTime.Now;
|
||||||
|
_productLogic.Create(model);
|
||||||
|
DateTime stop = DateTime.Now;
|
||||||
|
MessageBox.Show((stop - start).ToString(), "Test", MessageBoxButtons.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,10 +36,10 @@
|
|||||||
textBoxName = new TextBox();
|
textBoxName = new TextBox();
|
||||||
textBoxPrice = new TextBox();
|
textBoxPrice = new TextBox();
|
||||||
textBoxCategory = new TextBox();
|
textBoxCategory = new TextBox();
|
||||||
textBoxDateofFabrication = new TextBox();
|
|
||||||
textBoxValidUntil = new TextBox();
|
|
||||||
buttonSave = new Button();
|
buttonSave = new Button();
|
||||||
buttonCancel = new Button();
|
buttonCancel = new Button();
|
||||||
|
dateTimePickerDateofFabrication = new DateTimePicker();
|
||||||
|
dateTimePickerValidUntil = new DateTimePicker();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// labelName
|
// labelName
|
||||||
@ -113,20 +113,6 @@
|
|||||||
textBoxCategory.Size = new Size(221, 23);
|
textBoxCategory.Size = new Size(221, 23);
|
||||||
textBoxCategory.TabIndex = 7;
|
textBoxCategory.TabIndex = 7;
|
||||||
//
|
//
|
||||||
// textBoxDateofFabrication
|
|
||||||
//
|
|
||||||
textBoxDateofFabrication.Location = new Point(166, 152);
|
|
||||||
textBoxDateofFabrication.Name = "textBoxDateofFabrication";
|
|
||||||
textBoxDateofFabrication.Size = new Size(164, 23);
|
|
||||||
textBoxDateofFabrication.TabIndex = 8;
|
|
||||||
//
|
|
||||||
// textBoxValidUntil
|
|
||||||
//
|
|
||||||
textBoxValidUntil.Location = new Point(109, 194);
|
|
||||||
textBoxValidUntil.Name = "textBoxValidUntil";
|
|
||||||
textBoxValidUntil.Size = new Size(221, 23);
|
|
||||||
textBoxValidUntil.TabIndex = 9;
|
|
||||||
//
|
|
||||||
// buttonSave
|
// buttonSave
|
||||||
//
|
//
|
||||||
buttonSave.Location = new Point(383, 23);
|
buttonSave.Location = new Point(383, 23);
|
||||||
@ -147,15 +133,29 @@
|
|||||||
buttonCancel.UseVisualStyleBackColor = true;
|
buttonCancel.UseVisualStyleBackColor = true;
|
||||||
buttonCancel.Click += buttonCancel_Click;
|
buttonCancel.Click += buttonCancel_Click;
|
||||||
//
|
//
|
||||||
|
// dateTimePickerDateofFabrication
|
||||||
|
//
|
||||||
|
dateTimePickerDateofFabrication.Location = new Point(166, 150);
|
||||||
|
dateTimePickerDateofFabrication.Name = "dateTimePickerDateofFabrication";
|
||||||
|
dateTimePickerDateofFabrication.Size = new Size(164, 23);
|
||||||
|
dateTimePickerDateofFabrication.TabIndex = 12;
|
||||||
|
//
|
||||||
|
// dateTimePickerValidUntil
|
||||||
|
//
|
||||||
|
dateTimePickerValidUntil.Location = new Point(109, 194);
|
||||||
|
dateTimePickerValidUntil.Name = "dateTimePickerValidUntil";
|
||||||
|
dateTimePickerValidUntil.Size = new Size(221, 23);
|
||||||
|
dateTimePickerValidUntil.TabIndex = 13;
|
||||||
|
//
|
||||||
// FormProduct
|
// FormProduct
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(538, 313);
|
ClientSize = new Size(538, 313);
|
||||||
|
Controls.Add(dateTimePickerValidUntil);
|
||||||
|
Controls.Add(dateTimePickerDateofFabrication);
|
||||||
Controls.Add(buttonCancel);
|
Controls.Add(buttonCancel);
|
||||||
Controls.Add(buttonSave);
|
Controls.Add(buttonSave);
|
||||||
Controls.Add(textBoxValidUntil);
|
|
||||||
Controls.Add(textBoxDateofFabrication);
|
|
||||||
Controls.Add(textBoxCategory);
|
Controls.Add(textBoxCategory);
|
||||||
Controls.Add(textBoxPrice);
|
Controls.Add(textBoxPrice);
|
||||||
Controls.Add(textBoxName);
|
Controls.Add(textBoxName);
|
||||||
@ -181,9 +181,9 @@
|
|||||||
private TextBox textBoxName;
|
private TextBox textBoxName;
|
||||||
private TextBox textBoxPrice;
|
private TextBox textBoxPrice;
|
||||||
private TextBox textBoxCategory;
|
private TextBox textBoxCategory;
|
||||||
private TextBox textBoxDateofFabrication;
|
|
||||||
private TextBox textBoxValidUntil;
|
|
||||||
private Button buttonSave;
|
private Button buttonSave;
|
||||||
private Button buttonCancel;
|
private Button buttonCancel;
|
||||||
|
private DateTimePicker dateTimePickerDateofFabrication;
|
||||||
|
private DateTimePicker dateTimePickerValidUntil;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -36,8 +36,8 @@ namespace AccountingWarehouseProductsView
|
|||||||
textBoxName.Text = view.ProductName;
|
textBoxName.Text = view.ProductName;
|
||||||
textBoxPrice.Text = view.Cost.ToString();
|
textBoxPrice.Text = view.Cost.ToString();
|
||||||
textBoxCategory.Text = view.Category;
|
textBoxCategory.Text = view.Category;
|
||||||
textBoxDateofFabrication.Text = view.DateofFabrication;
|
dateTimePickerDateofFabrication.Value = view.DateofFabrication;
|
||||||
textBoxValidUntil.Text = view.ValidUntil;
|
dateTimePickerValidUntil.Value = (DateTime)view.ValidUntil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -63,8 +63,8 @@ namespace AccountingWarehouseProductsView
|
|||||||
ProductName = textBoxName.Text,
|
ProductName = textBoxName.Text,
|
||||||
Cost = Convert.ToDouble(textBoxPrice.Text),
|
Cost = Convert.ToDouble(textBoxPrice.Text),
|
||||||
Category = textBoxCategory.Text,
|
Category = textBoxCategory.Text,
|
||||||
DateofFabrication = textBoxDateofFabrication.Text,
|
DateofFabrication = dateTimePickerDateofFabrication.Value,
|
||||||
ValidUntil = textBoxValidUntil.Text
|
ValidUntil = dateTimePickerValidUntil.Value
|
||||||
};
|
};
|
||||||
var operationResult = _id.HasValue ? _logic.Update(model) : _logic.Create(model);
|
var operationResult = _id.HasValue ? _logic.Update(model) : _logic.Create(model);
|
||||||
if (!operationResult)
|
if (!operationResult)
|
||||||
|
@ -31,11 +31,11 @@
|
|||||||
labelShipmentDate = new Label();
|
labelShipmentDate = new Label();
|
||||||
labelCount = new Label();
|
labelCount = new Label();
|
||||||
labelRecipient = new Label();
|
labelRecipient = new Label();
|
||||||
textBoxShipmentDate = new TextBox();
|
|
||||||
textBoxCount = new TextBox();
|
textBoxCount = new TextBox();
|
||||||
textBoxRecipient = new TextBox();
|
textBoxRecipient = new TextBox();
|
||||||
ButtonSave = new Button();
|
ButtonSave = new Button();
|
||||||
ButtonCancel = new Button();
|
ButtonCancel = new Button();
|
||||||
|
dateTimePickerShipmentDate = new DateTimePicker();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// labelShipmentDate
|
// labelShipmentDate
|
||||||
@ -68,13 +68,6 @@
|
|||||||
labelRecipient.TabIndex = 2;
|
labelRecipient.TabIndex = 2;
|
||||||
labelRecipient.Text = "Получатель:";
|
labelRecipient.Text = "Получатель:";
|
||||||
//
|
//
|
||||||
// textBoxShipmentDate
|
|
||||||
//
|
|
||||||
textBoxShipmentDate.Location = new Point(145, 33);
|
|
||||||
textBoxShipmentDate.Name = "textBoxShipmentDate";
|
|
||||||
textBoxShipmentDate.Size = new Size(182, 23);
|
|
||||||
textBoxShipmentDate.TabIndex = 3;
|
|
||||||
//
|
|
||||||
// textBoxCount
|
// textBoxCount
|
||||||
//
|
//
|
||||||
textBoxCount.Location = new Point(145, 77);
|
textBoxCount.Location = new Point(145, 77);
|
||||||
@ -109,16 +102,23 @@
|
|||||||
ButtonCancel.UseVisualStyleBackColor = true;
|
ButtonCancel.UseVisualStyleBackColor = true;
|
||||||
ButtonCancel.Click += buttonCancel_Click;
|
ButtonCancel.Click += buttonCancel_Click;
|
||||||
//
|
//
|
||||||
|
// dateTimePickerShipmentDate
|
||||||
|
//
|
||||||
|
dateTimePickerShipmentDate.Location = new Point(145, 31);
|
||||||
|
dateTimePickerShipmentDate.Name = "dateTimePickerShipmentDate";
|
||||||
|
dateTimePickerShipmentDate.Size = new Size(182, 23);
|
||||||
|
dateTimePickerShipmentDate.TabIndex = 8;
|
||||||
|
//
|
||||||
// FormShipment
|
// FormShipment
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(385, 283);
|
ClientSize = new Size(385, 283);
|
||||||
|
Controls.Add(dateTimePickerShipmentDate);
|
||||||
Controls.Add(ButtonCancel);
|
Controls.Add(ButtonCancel);
|
||||||
Controls.Add(ButtonSave);
|
Controls.Add(ButtonSave);
|
||||||
Controls.Add(textBoxRecipient);
|
Controls.Add(textBoxRecipient);
|
||||||
Controls.Add(textBoxCount);
|
Controls.Add(textBoxCount);
|
||||||
Controls.Add(textBoxShipmentDate);
|
|
||||||
Controls.Add(labelRecipient);
|
Controls.Add(labelRecipient);
|
||||||
Controls.Add(labelCount);
|
Controls.Add(labelCount);
|
||||||
Controls.Add(labelShipmentDate);
|
Controls.Add(labelShipmentDate);
|
||||||
@ -134,10 +134,10 @@
|
|||||||
private Label labelShipmentDate;
|
private Label labelShipmentDate;
|
||||||
private Label labelCount;
|
private Label labelCount;
|
||||||
private Label labelRecipient;
|
private Label labelRecipient;
|
||||||
private TextBox textBoxShipmentDate;
|
|
||||||
private TextBox textBoxCount;
|
private TextBox textBoxCount;
|
||||||
private TextBox textBoxRecipient;
|
private TextBox textBoxRecipient;
|
||||||
private Button ButtonSave;
|
private Button ButtonSave;
|
||||||
private Button ButtonCancel;
|
private Button ButtonCancel;
|
||||||
|
private DateTimePicker dateTimePickerShipmentDate;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -33,7 +33,7 @@ namespace AccountingWarehouseProductsView
|
|||||||
var view = _logic.ReadElement(new ShipmentSearchModel { Id = _id.Value });
|
var view = _logic.ReadElement(new ShipmentSearchModel { Id = _id.Value });
|
||||||
if (view != null)
|
if (view != null)
|
||||||
{
|
{
|
||||||
textBoxShipmentDate.Text = view.ShipmentDate;
|
dateTimePickerShipmentDate.Value = (DateTime)view.ShipmentDate;
|
||||||
textBoxCount.Text = view.Count.ToString();
|
textBoxCount.Text = view.Count.ToString();
|
||||||
textBoxRecipient.Text = view.Recipient;
|
textBoxRecipient.Text = view.Recipient;
|
||||||
}
|
}
|
||||||
@ -58,7 +58,7 @@ namespace AccountingWarehouseProductsView
|
|||||||
var model = new ShipmentBindingModel
|
var model = new ShipmentBindingModel
|
||||||
{
|
{
|
||||||
Id = _id ?? 0,
|
Id = _id ?? 0,
|
||||||
ShipmentDate = textBoxShipmentDate.Text,
|
ShipmentDate = dateTimePickerShipmentDate.Value,
|
||||||
Count = Convert.ToInt32(textBoxCount.Text),
|
Count = Convert.ToInt32(textBoxCount.Text),
|
||||||
Recipient = textBoxRecipient.Text,
|
Recipient = textBoxRecipient.Text,
|
||||||
};
|
};
|
||||||
|
@ -30,12 +30,12 @@
|
|||||||
{
|
{
|
||||||
labelDeliveryDate = new Label();
|
labelDeliveryDate = new Label();
|
||||||
labelCount = new Label();
|
labelCount = new Label();
|
||||||
textBoxDeliveryDate = new TextBox();
|
|
||||||
textBoxCount = new TextBox();
|
textBoxCount = new TextBox();
|
||||||
buttonSave = new Button();
|
buttonSave = new Button();
|
||||||
buttonCancel = new Button();
|
buttonCancel = new Button();
|
||||||
labelNameStand = new Label();
|
labelNameStand = new Label();
|
||||||
textBoxNameStand = new TextBox();
|
textBoxNameStand = new TextBox();
|
||||||
|
dateTimePickerDeliveryDate = new DateTimePicker();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// labelDeliveryDate
|
// labelDeliveryDate
|
||||||
@ -58,13 +58,6 @@
|
|||||||
labelCount.TabIndex = 1;
|
labelCount.TabIndex = 1;
|
||||||
labelCount.Text = "Количество:";
|
labelCount.Text = "Количество:";
|
||||||
//
|
//
|
||||||
// textBoxDeliveryDate
|
|
||||||
//
|
|
||||||
textBoxDeliveryDate.Location = new Point(151, 65);
|
|
||||||
textBoxDeliveryDate.Name = "textBoxDeliveryDate";
|
|
||||||
textBoxDeliveryDate.Size = new Size(218, 23);
|
|
||||||
textBoxDeliveryDate.TabIndex = 2;
|
|
||||||
//
|
|
||||||
// textBoxCount
|
// textBoxCount
|
||||||
//
|
//
|
||||||
textBoxCount.Location = new Point(151, 116);
|
textBoxCount.Location = new Point(151, 116);
|
||||||
@ -109,17 +102,24 @@
|
|||||||
textBoxNameStand.Size = new Size(191, 23);
|
textBoxNameStand.Size = new Size(191, 23);
|
||||||
textBoxNameStand.TabIndex = 7;
|
textBoxNameStand.TabIndex = 7;
|
||||||
//
|
//
|
||||||
|
// dateTimePickerDeliveryDate
|
||||||
|
//
|
||||||
|
dateTimePickerDeliveryDate.Location = new Point(151, 65);
|
||||||
|
dateTimePickerDeliveryDate.Name = "dateTimePickerDeliveryDate";
|
||||||
|
dateTimePickerDeliveryDate.Size = new Size(218, 23);
|
||||||
|
dateTimePickerDeliveryDate.TabIndex = 8;
|
||||||
|
//
|
||||||
// FormStand
|
// FormStand
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(451, 274);
|
ClientSize = new Size(451, 274);
|
||||||
|
Controls.Add(dateTimePickerDeliveryDate);
|
||||||
Controls.Add(textBoxNameStand);
|
Controls.Add(textBoxNameStand);
|
||||||
Controls.Add(labelNameStand);
|
Controls.Add(labelNameStand);
|
||||||
Controls.Add(buttonCancel);
|
Controls.Add(buttonCancel);
|
||||||
Controls.Add(buttonSave);
|
Controls.Add(buttonSave);
|
||||||
Controls.Add(textBoxCount);
|
Controls.Add(textBoxCount);
|
||||||
Controls.Add(textBoxDeliveryDate);
|
|
||||||
Controls.Add(labelCount);
|
Controls.Add(labelCount);
|
||||||
Controls.Add(labelDeliveryDate);
|
Controls.Add(labelDeliveryDate);
|
||||||
Name = "FormStand";
|
Name = "FormStand";
|
||||||
@ -133,11 +133,11 @@
|
|||||||
|
|
||||||
private Label labelDeliveryDate;
|
private Label labelDeliveryDate;
|
||||||
private Label labelCount;
|
private Label labelCount;
|
||||||
private TextBox textBoxDeliveryDate;
|
|
||||||
private TextBox textBoxCount;
|
private TextBox textBoxCount;
|
||||||
private Button buttonSave;
|
private Button buttonSave;
|
||||||
private Button buttonCancel;
|
private Button buttonCancel;
|
||||||
private Label labelNameStand;
|
private Label labelNameStand;
|
||||||
private TextBox textBoxNameStand;
|
private TextBox textBoxNameStand;
|
||||||
|
private DateTimePicker dateTimePickerDeliveryDate;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,6 +1,7 @@
|
|||||||
using AccountingWarehouseProductsContracts.BindingModels;
|
using AccountingWarehouseProductsContracts.BindingModels;
|
||||||
using AccountingWarehouseProductsContracts.BusinessLogicsContracts;
|
using AccountingWarehouseProductsContracts.BusinessLogicsContracts;
|
||||||
using AccountingWarehouseProductsContracts.SearchModels;
|
using AccountingWarehouseProductsContracts.SearchModels;
|
||||||
|
using Microsoft.IdentityModel.Tokens;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
@ -34,7 +35,7 @@ namespace AccountingWarehouseProductsView
|
|||||||
if (view != null)
|
if (view != null)
|
||||||
{
|
{
|
||||||
textBoxNameStand.Text = view.StandName;
|
textBoxNameStand.Text = view.StandName;
|
||||||
textBoxDeliveryDate.Text = view.DeliveryDate;
|
dateTimePickerDeliveryDate.Value = (DateTime)view.DeliveryDate;
|
||||||
textBoxCount.Text = view.Count.ToString();
|
textBoxCount.Text = view.Count.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -47,19 +48,13 @@ namespace AccountingWarehouseProductsView
|
|||||||
|
|
||||||
private void buttonSave_Click(object sender, EventArgs e)
|
private void buttonSave_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(textBoxDeliveryDate.Text))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Заполните Дату поставки", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var model = new StandBindingModel
|
var model = new StandBindingModel
|
||||||
{
|
{
|
||||||
Id = _id ?? 0,
|
Id = _id ?? 0,
|
||||||
StandName = textBoxNameStand.Text,
|
StandName = textBoxNameStand.Text,
|
||||||
DeliveryDate = textBoxDeliveryDate.Text,
|
DeliveryDate = dateTimePickerDeliveryDate.Value,
|
||||||
Count = Convert.ToInt32(textBoxCount.Text),
|
Count = Convert.ToInt32(textBoxCount.Text),
|
||||||
};
|
};
|
||||||
var operationResult = _id.HasValue ? _logic.Update(model) : _logic.Create(model);
|
var operationResult = _id.HasValue ? _logic.Update(model) : _logic.Create(model);
|
||||||
|
@ -104,7 +104,7 @@
|
|||||||
Controls.Add(ButtonAdd);
|
Controls.Add(ButtonAdd);
|
||||||
Controls.Add(dataGridView);
|
Controls.Add(dataGridView);
|
||||||
Name = "FormStands";
|
Name = "FormStands";
|
||||||
Text = "Отгрузки";
|
Text = "Поставки";
|
||||||
Load += FormStands_Load;
|
Load += FormStands_Load;
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user