diff --git a/ButcherTraceBack/Controllers/BeiHaiViewController.cs b/ButcherTraceBack/Controllers/BeiHaiViewController.cs index d6365d9..d6e5d70 100644 --- a/ButcherTraceBack/Controllers/BeiHaiViewController.cs +++ b/ButcherTraceBack/Controllers/BeiHaiViewController.cs @@ -13,22 +13,22 @@ namespace ButcherTraceBack.Controllers { var allModel = new BeiHaiAllModel(); - FreshTraceBack info1 = SqlHelper.Query(code); + //FreshTraceBack info1 = SqlHelper.Query(code); BeiHaiTraceBack info2 = SqlHelper.Query(code); - if (info1 == null) + if (info2 == null) { - info1 = new FreshTraceBack(); + info2 = new BeiHaiTraceBack(); } - else if (info1.Code != null && info1.Code.Length >= 10) + else if (info2.Code != null && info2.Code.Length >= 10) { - info1.Code = info1.Code.Substring(info1.Code.Length - 5, 5); + info2.Code = info2.Code.Substring(info2.Code.Length - 5, 5); } if (info2 == null) { info2 = new BeiHaiTraceBack(); } - allModel.Info1 = info1; + allModel.Info1 = new FreshTraceBack(); allModel.Info2 = info2; diff --git a/ButcherTraceBack/Controllers/TraceBackInfoController.cs b/ButcherTraceBack/Controllers/TraceBackInfoController.cs index 75fd101..c05f072 100644 --- a/ButcherTraceBack/Controllers/TraceBackInfoController.cs +++ b/ButcherTraceBack/Controllers/TraceBackInfoController.cs @@ -53,7 +53,7 @@ namespace ButcherTraceBack.Controllers public string InsertProductTrace([System.Web.Http.FromBody]string json) { - return InsertProductTrace(json, "Code", "GoodsImage", "UseMedicineImage", "ImmunityImage", "QuarantinePassImage", "GoodsPassImage", "ExpirationTime"); + return InsertProductTrace(json, "Code", "GoodsImage", "UseMedicineImage", "ImmunityImage", "QuarantinePassImage", "GoodsPassImage", "ExpirationTime", "CutUpDate", "Goods_Name", "ProductDate", "ButcherDate"); } string InsertProductTrace(string json, params string[] fields) @@ -78,6 +78,10 @@ namespace ButcherTraceBack.Controllers info.QuarantinePassImage = dto.QuarantinePassImage; info.GoodsPassImage = dto.GoodsPassImage; info.ExpirationTime = dto.ExpirationTime; + info.CutUpDate = dto.CutUpDate; + info.Goods_Name = dto.Goods_Name; + info.ProductDate = dto.ProductDate; + info.ButcherDate = dto.ButcherDate; infos.Add(info); } return SqlHelper.BatchInsert(infos, fields); diff --git a/ButcherTraceBack/Models/BeiHaiTraceBack.cs b/ButcherTraceBack/Models/BeiHaiTraceBack.cs index 957a860..154f973 100644 --- a/ButcherTraceBack/Models/BeiHaiTraceBack.cs +++ b/ButcherTraceBack/Models/BeiHaiTraceBack.cs @@ -34,6 +34,10 @@ namespace ButcherTraceBack.Models public string GoodsPassImage { get; set; } public string ExpirationTime { get; set; } + public string CutUpDate { get; set; } + public string Goods_Name { get; set; } + public string ButcherDate { get; set; } + public string ProductDate { get; set; } diff --git a/ButcherTraceBack/Views/BeiHaiView/Index.cshtml b/ButcherTraceBack/Views/BeiHaiView/Index.cshtml index 45c9fac..bd329b8 100644 --- a/ButcherTraceBack/Views/BeiHaiView/Index.cshtml +++ b/ButcherTraceBack/Views/BeiHaiView/Index.cshtml @@ -9,7 +9,7 @@ - 追溯信息 @Model.Info1.Code + 追溯信息 @Model.Info2.Code @@ -69,10 +69,10 @@ } - - - - + + + + diff --git a/CreateTable.sql b/CreateTable.sql index 5abe5b6..8e13b88 100644 --- a/CreateTable.sql +++ b/CreateTable.sql @@ -62,7 +62,8 @@ CREATE TABLE [dbo].[BeiHaiTraceBack]( [ImmunityImage] [ntext] NULL, [QuarantinePassImage] [ntext] NULL, [GoodsPassImage] [ntext] NULL, - [ExpirationTime] [nvarchar](50) NULL + [ExpirationTime] [nvarchar](50) NULL, + [CutUpDate] [nvarchar](50) NULL, CONSTRAINT [PK_BeiHaiTraceBack] PRIMARY KEY CLUSTERED (
产品名称:@Model.Info1.Goods_Name
宰杀时间:@Model.Info1.ButcherDate
分割时间:@Model.Info1.ProductDate
生产日期:@Model.Info1.ProductDate
产品名称:@Model.Info2.Goods_Name
宰杀时间:@Model.Info2.ButcherDate
分割时间:@Model.Info2.CutUpDate
生产日期:@Model.Info2.ProductDate
保质期:@Model.Info2.ExpirationTime
生 产 商:青岛新万福食品有限公司
住     所:莱西市珠海路5号