sistemata relazione tra flussi e locations...

This commit is contained in:
Samuele E. Locatelli
2016-09-22 12:05:32 +02:00
parent 4a259d939f
commit 77e1372df8
11 changed files with 74 additions and 31 deletions
@@ -17,7 +17,7 @@ namespace StockManMVC.Controllers
// GET: ItemFluxes
public ActionResult Index()
{
var itemFlux = db.ItemFlux.Include(i => i.Location).Include(i => i.MovType).Include(i => i.Item).Include(i => i.Operator);
var itemFlux = db.ItemFlux.Include(i => i.Location).Include(i => i.MovType).Include(i => i.Item).Include(i => i.Operator).Include(i => i.Location1);
return View(itemFlux.ToList());
}
@@ -43,6 +43,7 @@ namespace StockManMVC.Controllers
ViewBag.MovTypeID = new SelectList(db.MovType, "ID", "Descr");
ViewBag.ItemID = new SelectList(db.Item, "ID", "Descr");
ViewBag.OperatorID = new SelectList(db.Operator, "ID", "CodExt");
ViewBag.ExtLocationID = new SelectList(db.Location, "ID", "Descr");
return View();
}
@@ -64,6 +65,7 @@ namespace StockManMVC.Controllers
ViewBag.MovTypeID = new SelectList(db.MovType, "ID", "Descr", itemFlux.MovTypeID);
ViewBag.ItemID = new SelectList(db.Item, "ID", "Descr", itemFlux.ItemID);
ViewBag.OperatorID = new SelectList(db.Operator, "ID", "CodExt", itemFlux.OperatorID);
ViewBag.ExtLocationID = new SelectList(db.Location, "ID", "Descr", itemFlux.ExtLocationID);
return View(itemFlux);
}
@@ -83,6 +85,7 @@ namespace StockManMVC.Controllers
ViewBag.MovTypeID = new SelectList(db.MovType, "ID", "Descr", itemFlux.MovTypeID);
ViewBag.ItemID = new SelectList(db.Item, "ID", "Descr", itemFlux.ItemID);
ViewBag.OperatorID = new SelectList(db.Operator, "ID", "CodExt", itemFlux.OperatorID);
ViewBag.ExtLocationID = new SelectList(db.Location, "ID", "Descr", itemFlux.ExtLocationID);
return View(itemFlux);
}
@@ -103,6 +106,7 @@ namespace StockManMVC.Controllers
ViewBag.MovTypeID = new SelectList(db.MovType, "ID", "Descr", itemFlux.MovTypeID);
ViewBag.ItemID = new SelectList(db.Item, "ID", "Descr", itemFlux.ItemID);
ViewBag.OperatorID = new SelectList(db.Operator, "ID", "CodExt", itemFlux.OperatorID);
ViewBag.ExtLocationID = new SelectList(db.Location, "ID", "Descr", itemFlux.ExtLocationID);
return View(itemFlux);
}
+1
View File
@@ -31,5 +31,6 @@ namespace StockManMVC.Models
public virtual MovType MovType { get; set; }
public virtual Item Item { get; set; }
public virtual Operator Operator { get; set; }
public virtual Location Location1 { get; set; }
}
}
+3
View File
@@ -19,6 +19,7 @@ namespace StockManMVC.Models
{
this.ItemFlux = new HashSet<ItemFlux>();
this.ItemStock = new HashSet<ItemStock>();
this.ItemFlux1 = new HashSet<ItemFlux>();
}
public string ID { get; set; }
@@ -30,5 +31,7 @@ namespace StockManMVC.Models
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<ItemStock> ItemStock { get; set; }
public virtual LocType LocType { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<ItemFlux> ItemFlux1 { get; set; }
}
}
+34
View File
@@ -161,6 +161,18 @@ warning 6002: The table/view 'StockMan.dbo.vItemStockStatus' does not have a pri
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_ItemFlux_Location1">
<End Role="Location" Type="Self.Location" Multiplicity="1" />
<End Role="ItemFlux" Type="Self.ItemFlux" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Location">
<PropertyRef Name="ID" />
</Principal>
<Dependent Role="ItemFlux">
<PropertyRef Name="ExtLocationID" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_ItemFlux_Operator">
<End Role="Operator" Type="Self.Operator" Multiplicity="1" />
<End Role="ItemFlux" Type="Self.ItemFlux" Multiplicity="*" />
@@ -266,6 +278,10 @@ warning 6002: The table/view 'StockMan.dbo.vItemStockStatus' does not have a pri
<End Role="Location" EntitySet="Location" />
<End Role="ItemFlux" EntitySet="ItemFlux" />
</AssociationSet>
<AssociationSet Name="FK_ItemFlux_Location1" Association="Self.FK_ItemFlux_Location1">
<End Role="Location" EntitySet="Location" />
<End Role="ItemFlux" EntitySet="ItemFlux" />
</AssociationSet>
<AssociationSet Name="FK_ItemFlux_Operator" Association="Self.FK_ItemFlux_Operator">
<End Role="Operator" EntitySet="Operator" />
<End Role="ItemFlux" EntitySet="ItemFlux" />
@@ -311,6 +327,7 @@ warning 6002: The table/view 'StockMan.dbo.vItemStockStatus' does not have a pri
<NavigationProperty Name="Item" Relationship="StockManModel.FK_ItemFlux_Item" FromRole="ItemFlux" ToRole="Item" />
<Property Name="OperatorID" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
<NavigationProperty Name="Operator" Relationship="StockManModel.FK_ItemFlux_Operator" FromRole="ItemFlux" ToRole="Operator" />
<NavigationProperty Name="Location1" Relationship="StockManModel.FK_ItemFlux_Location1" FromRole="ItemFlux" ToRole="Location" />
</EntityType>
<EntityType Name="ItemStock">
<Key>
@@ -335,6 +352,7 @@ warning 6002: The table/view 'StockMan.dbo.vItemStockStatus' does not have a pri
<NavigationProperty Name="ItemFlux" Relationship="Self.FK_ItemFlux_Location" FromRole="Location" ToRole="ItemFlux" />
<NavigationProperty Name="ItemStock" Relationship="Self.FK_Stock_Location1" FromRole="Location" ToRole="ItemStock" />
<NavigationProperty Name="LocType" Relationship="Self.FK_Location_LocType1" FromRole="Location" ToRole="LocType" />
<NavigationProperty Name="ItemFlux1" Relationship="StockManModel.FK_ItemFlux_Location1" FromRole="Location" ToRole="ItemFlux" />
</EntityType>
<EntityType Name="LocType">
<Key>
@@ -448,6 +466,10 @@ warning 6002: The table/view 'StockMan.dbo.vItemStockStatus' does not have a pri
<End Role="Operator" EntitySet="Operator" />
<End Role="ItemFlux" EntitySet="ItemFlux" />
</AssociationSet>
<AssociationSet Name="FK_ItemFlux_Location1" Association="StockManModel.FK_ItemFlux_Location1">
<End Role="Location" EntitySet="Location" />
<End Role="ItemFlux" EntitySet="ItemFlux" />
</AssociationSet>
</EntityContainer>
<EntityType Name="ItemFamily">
<Key>
@@ -554,6 +576,18 @@ warning 6002: The table/view 'StockMan.dbo.vItemStockStatus' does not have a pri
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_ItemFlux_Location1">
<End Type="StockManModel.Location" Role="Location" Multiplicity="1" />
<End Type="StockManModel.ItemFlux" Role="ItemFlux" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Location">
<PropertyRef Name="ID" />
</Principal>
<Dependent Role="ItemFlux">
<PropertyRef Name="ExtLocationID" />
</Dependent>
</ReferentialConstraint>
</Association>
</Schema>
</edmx:ConceptualModels>
<!-- C-S mapping content -->
+5 -4
View File
@@ -6,10 +6,10 @@
<edmx:Diagrams>
<Diagram DiagramId="bd03a54c9086429188c2070c15c45b53" Name="Diagram1">
<EntityTypeShape EntityType="StockManModel.ItemFlux" Width="1.5" PointX="5.25" PointY="4.625" IsExpanded="true" />
<EntityTypeShape EntityType="StockManModel.ItemStock" Width="1.5" PointX="7.75" PointY="5.25" IsExpanded="true" />
<EntityTypeShape EntityType="StockManModel.Location" Width="1.5" PointX="3" PointY="5.375" IsExpanded="true" />
<EntityTypeShape EntityType="StockManModel.LocType" Width="1.5" PointX="0.75" PointY="5.375" IsExpanded="true" />
<EntityTypeShape EntityType="StockManModel.MovType" Width="1.5" PointX="3" PointY="8.625" IsExpanded="true" />
<EntityTypeShape EntityType="StockManModel.ItemStock" Width="1.5" PointX="0.625" PointY="3.625" IsExpanded="true" />
<EntityTypeShape EntityType="StockManModel.Location" Width="1.5" PointX="3" PointY="5.125" IsExpanded="true" />
<EntityTypeShape EntityType="StockManModel.LocType" Width="1.5" PointX="0.5" PointY="7.125" IsExpanded="true" />
<EntityTypeShape EntityType="StockManModel.MovType" Width="1.5" PointX="7.375" PointY="7.375" IsExpanded="true" />
<AssociationConnector Association="StockManModel.FK_ItemFlux_Location" ManuallyRouted="false" />
<AssociationConnector Association="StockManModel.FK_StockMov_MovType" ManuallyRouted="false" />
<AssociationConnector Association="StockManModel.FK_Stock_Location1" ManuallyRouted="false" />
@@ -22,6 +22,7 @@
<EntityTypeShape EntityType="StockManModel.ItemStockStatus" Width="1.5" PointX="10.5" PointY="4.625" />
<EntityTypeShape EntityType="StockManModel.Operator" Width="1.5" PointX="5.375" PointY="0.875" />
<AssociationConnector Association="StockManModel.FK_ItemFlux_Operator" />
<AssociationConnector Association="StockManModel.FK_ItemFlux_Location1" />
</Diagram>
</edmx:Diagrams>
</edmx:Designer>
+2 -2
View File
@@ -40,9 +40,9 @@
</div>
<div class="form-group">
@Html.LabelFor(model => model.ExtLocationID, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.LabelFor(model => model.ExtLocationID, "ExtLocationID", htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.ExtLocationID, new { htmlAttributes = new { @class = "form-control" } })
@Html.DropDownList("ExtLocationID", null, htmlAttributes: new { @class = "form-control" })
@Html.ValidationMessageFor(model => model.ExtLocationID, "", new { @class = "text-danger" })
</div>
</div>
+8 -8
View File
@@ -11,14 +11,6 @@
<h4>ItemFlux</h4>
<hr />
<dl class="dl-horizontal">
<dt>
@Html.DisplayNameFor(model => model.ExtLocationID)
</dt>
<dd>
@Html.DisplayFor(model => model.ExtLocationID)
</dd>
<dt>
@Html.DisplayNameFor(model => model.dtMov)
</dt>
@@ -99,6 +91,14 @@
@Html.DisplayFor(model => model.Operator.CodExt)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Location1.Descr)
</dt>
<dd>
@Html.DisplayFor(model => model.Location1.Descr)
</dd>
</dl>
@using (Html.BeginForm()) {
+8 -8
View File
@@ -10,14 +10,6 @@
<h4>ItemFlux</h4>
<hr />
<dl class="dl-horizontal">
<dt>
@Html.DisplayNameFor(model => model.ExtLocationID)
</dt>
<dd>
@Html.DisplayFor(model => model.ExtLocationID)
</dd>
<dt>
@Html.DisplayNameFor(model => model.dtMov)
</dt>
@@ -98,6 +90,14 @@
@Html.DisplayFor(model => model.Operator.CodExt)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Location1.Descr)
</dt>
<dd>
@Html.DisplayFor(model => model.Location1.Descr)
</dd>
</dl>
</div>
<p>
+2 -2
View File
@@ -42,9 +42,9 @@
</div>
<div class="form-group">
@Html.LabelFor(model => model.ExtLocationID, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.LabelFor(model => model.ExtLocationID, "ExtLocationID", htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.ExtLocationID, new { htmlAttributes = new { @class = "form-control" } })
@Html.DropDownList("ExtLocationID", null, htmlAttributes: new { @class = "form-control" })
@Html.ValidationMessageFor(model => model.ExtLocationID, "", new { @class = "text-danger" })
</div>
</div>
+6 -6
View File
@@ -11,9 +11,6 @@
</p>
<table class="table">
<tr>
<th>
@Html.DisplayNameFor(model => model.ExtLocationID)
</th>
<th>
@Html.DisplayNameFor(model => model.dtMov)
</th>
@@ -44,14 +41,14 @@
<th>
@Html.DisplayNameFor(model => model.Operator.CodExt)
</th>
<th>
@Html.DisplayNameFor(model => model.Location1.Descr)
</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.ExtLocationID)
</td>
<td>
@Html.DisplayFor(modelItem => item.dtMov)
</td>
@@ -82,6 +79,9 @@
<td>
@Html.DisplayFor(modelItem => item.Operator.CodExt)
</td>
<td>
@Html.DisplayFor(modelItem => item.Location1.Descr)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
@Html.ActionLink("Details", "Details", new { id=item.ID }) |
Binary file not shown.