update con gestione corretta (e coerente) della visualizzazione magazzino con celle "multiple"

git-svn-id: https://keyhammer.ath.cx/svn/GMW/trunk@144 365432ac-a1b5-4ffd-bb28-6d3099d32164
This commit is contained in:
samuele
2010-07-19 16:07:42 +00:00
parent b287ddec40
commit 2ce4281882
18 changed files with 683 additions and 590 deletions
BIN
View File
Binary file not shown.
+2
View File
@@ -817,6 +817,8 @@
<Content Include="images\approva_l.png" />
<Content Include="images\approva_m.png" />
<Content Include="images\approva_s.png" />
<Content Include="images\arancio_20.png" />
<Content Include="images\arancio_80.png" />
<Content Include="images\circle_l_0.png" />
<Content Include="images\circle_l_1.png" />
<Content Include="images\circle_l_2.png" />
+9
View File
@@ -132,6 +132,15 @@
border: solid 1px #777777;
}
.cellaOccupata
{
text-align: center;
font-size: 8pt;
height: 40px;
background-image: url(images/arancio_80.png);
color: White;
border: solid 1px #777777;
}
.cellaPiena
{
text-align: center;
font-size: 8pt;
@@ -17,7 +17,11 @@ namespace GMW.WebUserControls
protected GMW_data.Type.BlockMap[,] BloccoCelle;
public event EventHandler eh_selValore;
/// <summary>
/// evento caricamento pagina...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
doUpdate();
@@ -41,26 +45,37 @@ namespace GMW.WebUserControls
DS_magazzino.BlocchiRow rigaBlocco = MagClass.magazzino.taBlocchi.getByIdx(IdxBlocco)[0];
numX = rigaBlocco.NumX;
numY = rigaBlocco.NumY;
// carico TUTTE le celle del blocco...
DS_magazzino.CelleDataTable tabCelleAll = MagClass.magazzino.taCelle.getByIdxBlocco(IdxBlocco);
DS_magazzino.CelleRow rigaCelle;
// carico i tipi cella...
DS_magazzino.TipoCellaDataTable tabTipoCelle = MagClass.magazzino.taTipoCella.GetData();
// inizializzo il mio array...
BloccoCelle = new GMW_data.Type.BlockMap[numX, numY];
// per calcolo capacità di OGNI cella
int capa = 0;
// carico i dati nell'array: di default tutto VUOTO, con posizione attiva...
for (int pos_y = 0; pos_y < numY; pos_y++)
{
for (int pos_x = 0; pos_x < numX; pos_x++)
{
BloccoCelle[pos_x, pos_y] = new GMW_data.Type.BlockMap("-", "libera", "cellaLibera", "", "");
// calcolo la capacità della cella...
rigaCelle = (DS_magazzino.CelleRow)tabCelleAll.Select(string.Format("X={0} AND Y={1}", pos_x + 1, pos_y + 1))[0];
capa = tabTipoCelle.FindByIdxTipoCella(rigaCelle.IdxTipoCella).Capienza;
BloccoCelle[pos_x, pos_y] = new GMW_data.Type.BlockMap("-", "", "cellaLibera", rigaCelle.IdxCella, rigaCelle.CodCella, capa, 0, rigaCelle.Piena, rigaCelle.Attiva);
}
}
// cerco elenco delle celle NON Attive
DS_magazzino.CelleDataTable tabCelle = MagClass.magazzino.taCelle.getNonAttiveByIdxBlocco(IdxBlocco);
DS_magazzino.CelleDataTable tabCelleInattive = MagClass.magazzino.taCelle.getNonAttiveByIdxBlocco(IdxBlocco);
// se ce ne sono ...
if (tabCelle.Rows.Count > 0)
if (tabCelleInattive.Rows.Count > 0)
{
// ...sovrascrivo valori di default
foreach (DS_magazzino.CelleRow riga in tabCelle)
foreach (DS_magazzino.CelleRow riga in tabCelleInattive)
{
// sistemo layout
BloccoCelle[riga.X - 1, riga.Y - 1].Css = "cellaInattiva";
BloccoCelle[riga.X - 1, riga.Y - 1].Label = "X";
BloccoCelle[riga.X - 1, riga.Y - 1].Label = string.Format("X / {0}", BloccoCelle[riga.X - 1, riga.Y - 1].Capacita);
BloccoCelle[riga.X - 1, riga.Y - 1].ToolTip = "non attiva";
}
}
@@ -81,6 +96,8 @@ namespace GMW.WebUserControls
// ...sovrascrivo valori di default
foreach (DS_magazzino.v_UdcDetailRow riga in tabUdc)
{
// salvo che ho 1 UDC in + nella cella...
BloccoCelle[riga.X - 1, riga.Y - 1].NumUdc++;
// controllo se nella cella ci sia il particolare selezionato...
if (ParticolareSel == riga.Particolare)
{
@@ -96,13 +113,18 @@ namespace GMW.WebUserControls
}
else
{
// se NON C'E' alcun particolare selezionato ...
BloccoCelle[riga.X - 1, riga.Y - 1].Css = "cellaOccupata";
// se NON C'E' alcun particolare selezionato ... controllo il blocco!
if (BloccoCelle[riga.X - 1, riga.Y - 1].Piena)
{
BloccoCelle[riga.X - 1, riga.Y - 1].Css = "cellaPiena";
}
else
{
BloccoCelle[riga.X - 1, riga.Y - 1].Css = "cellaOccupata";
}
}
BloccoCelle[riga.X - 1, riga.Y - 1].Label = string.Format("{0:#}", riga.Qta);
BloccoCelle[riga.X - 1, riga.Y - 1].ToolTip = string.Format("{2} - {0} {1:#}pz", riga.UDC, riga.Qta, riga.Particolare);
BloccoCelle[riga.X - 1, riga.Y - 1].KeyVal = riga.UDC;
BloccoCelle[riga.X - 1, riga.Y - 1].CellCode = riga.CodCella;
BloccoCelle[riga.X - 1, riga.Y - 1].Label = string.Format("{0} / {1}", BloccoCelle[riga.X - 1, riga.Y - 1].NumUdc, BloccoCelle[riga.X - 1, riga.Y - 1].Capacita);
BloccoCelle[riga.X - 1, riga.Y - 1].ToolTip += string.Format("{2} - {0} {1:#}pz{3}", riga.UDC, riga.Qta, riga.Particolare, Environment.NewLine);
}
}
}
@@ -163,7 +185,12 @@ namespace GMW.WebUserControls
eh_selValore(this, new EventArgs());
}
}
/// <summary>
/// crea una cella per il numero dei livelli
/// </summary>
/// <param name="pos_y"></param>
/// <param name="riga"></param>
/// <returns></returns>
private static TableCell setupCellaConteggioY(int pos_y, TableRow riga)
{
TableCell cell;
@@ -174,7 +201,9 @@ namespace GMW.WebUserControls
riga.Cells.Add(cell);
return cell;
}
/// <summary>
/// crea la riga del numero delle colonne
/// </summary>
private void setupRigaConteggioX()
{
TableRow riga = new TableRow();
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 1010 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.
Binary file not shown.
+44 -5
View File
@@ -3376,6 +3376,8 @@ namespace GMW_data {
private global::System.Data.DataColumn columnZ;
private global::System.Data.DataColumn columnIdxCella;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public v_UdcDetailDataTable() {
this.TableName = "v_UdcDetail";
@@ -3539,6 +3541,13 @@ namespace GMW_data {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public global::System.Data.DataColumn IdxCellaColumn {
get {
return this.columnIdxCella;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.ComponentModel.Browsable(false)]
public int Count {
@@ -3587,7 +3596,8 @@ namespace GMW_data {
string CodCella,
int X,
int Y,
int Z) {
int Z,
int IdxCella) {
v_UdcDetailRow rowv_UdcDetailRow = ((v_UdcDetailRow)(this.NewRow()));
object[] columnValuesArray = new object[] {
UDC,
@@ -3608,7 +3618,8 @@ namespace GMW_data {
CodCella,
X,
Y,
Z};
Z,
IdxCella};
rowv_UdcDetailRow.ItemArray = columnValuesArray;
this.Rows.Add(rowv_UdcDetailRow);
return rowv_UdcDetailRow;
@@ -3653,6 +3664,7 @@ namespace GMW_data {
this.columnX = base.Columns["X"];
this.columnY = base.Columns["Y"];
this.columnZ = base.Columns["Z"];
this.columnIdxCella = base.Columns["IdxCella"];
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
@@ -3695,6 +3707,8 @@ namespace GMW_data {
base.Columns.Add(this.columnY);
this.columnZ = new global::System.Data.DataColumn("Z", typeof(int), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnZ);
this.columnIdxCella = new global::System.Data.DataColumn("IdxCella", typeof(int), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnIdxCella);
this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] {
this.columnUDC}, true));
this.columnUDC.AllowDBNull = false;
@@ -3717,6 +3731,7 @@ namespace GMW_data {
this.columnX.ReadOnly = true;
this.columnY.ReadOnly = true;
this.columnZ.ReadOnly = true;
this.columnIdxCella.ReadOnly = true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
@@ -8708,6 +8723,21 @@ namespace GMW_data {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public int IdxCella {
get {
try {
return ((int)(this[this.tablev_UdcDetail.IdxCellaColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'IdxCella\' in table \'v_UdcDetail\' is DBNull.", e);
}
}
set {
this[this.tablev_UdcDetail.IdxCellaColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public bool IsRagSocialeNull() {
return this.IsNull(this.tablev_UdcDetail.RagSocialeColumn);
@@ -8887,6 +8917,16 @@ namespace GMW_data {
public void SetZNull() {
this[this.tablev_UdcDetail.ZColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public bool IsIdxCellaNull() {
return this.IsNull(this.tablev_UdcDetail.IdxCellaColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public void SetIdxCellaNull() {
this[this.tablev_UdcDetail.IdxCellaColumn] = global::System.Convert.DBNull;
}
}
/// <summary>
@@ -16205,6 +16245,7 @@ SELECT IdxTipoCella, CodMag, CodCS, Quantita, Capienza, Max_X, Max_Y, Max_Z, Max
tableMapping.ColumnMappings.Add("X", "X");
tableMapping.ColumnMappings.Add("Y", "Y");
tableMapping.ColumnMappings.Add("Z", "Z");
tableMapping.ColumnMappings.Add("IdxCella", "IdxCella");
this._adapter.TableMappings.Add(tableMapping);
}
@@ -16219,9 +16260,7 @@ SELECT IdxTipoCella, CodMag, CodCS, Quantita, Capienza, Max_X, Max_Y, Max_Z, Max
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[4];
this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[0].Connection = this.Connection;
this._commandCollection[0].CommandText = "SELECT UDC, RagSociale, Particolare, DescParticolare, DisegnoGrezzo, Esponente, D" +
"escImpianto, DataFus, TurnoFus, CodImballo, Qta, DescStato, ModDate, CodMag, Cod" +
"Blocco, CodCella, X, Y, Z FROM dbo.v_UdcDetail";
this._commandCollection[0].CommandText = "SELECT * FROM dbo.v_UdcDetail";
this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[1].Connection = this.Connection;
File diff suppressed because it is too large Load Diff
+18 -18
View File
@@ -6,23 +6,23 @@
</autogenerated>-->
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="58" ViewPortY="-30" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
<Shapes>
<Shape ID="DesignTable:ElencoCartellini" ZOrder="12" X="68" Y="333" Height="381" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
<Shape ID="DesignTable:ElencoCartellini" ZOrder="13" X="68" Y="333" Height="381" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
<Shape ID="DesignTable:AnagMag" ZOrder="26" X="1014" Y="372" Height="190" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="75" />
<Shape ID="DesignTable:PosizioneUdcCorrente" ZOrder="1" X="409" Y="544" Height="265" Width="252" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
<Shape ID="DesignTable:PosizioneUdcCorrente" ZOrder="2" X="409" Y="544" Height="265" Width="252" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
<Shape ID="DesignTable:PosizioneUdcStorico" ZOrder="24" X="387" Y="322" Height="156" Width="257" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="109" />
<Shape ID="DesignTable:Blocchi" ZOrder="19" X="1014" Y="652" Height="275" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="160" />
<Shape ID="DesignTable:Celle" ZOrder="6" X="694" Y="421" Height="438" Width="272" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="235" />
<Shape ID="DesignTable:TipoCella" ZOrder="4" X="1008" Y="-2" Height="343" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="216" />
<Shape ID="DesignTable:v_UdcDetail" ZOrder="18" X="693" Y="9" Height="326" Width="223" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="228" />
<Shape ID="DesignTable:AnagImballi" ZOrder="17" X="93" Y="43" Height="156" Width="211" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="75" />
<Shape ID="DesignTable:V_ParticolariOverview" ZOrder="16" X="95" Y="1131" Height="265" Width="272" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="138" />
<Shape ID="DesignTable:V_MagazziniOverview" ZOrder="7" X="733" Y="1102" Height="286" Width="232" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="178" />
<Shape ID="DesignTable:V_DettMagPart" ZOrder="15" X="993" Y="985" Height="326" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="228" />
<Shape ID="DesignTable:TipoListaPrelievo" ZOrder="2" X="724" Y="906" Height="191" Width="244" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="121" />
<Shape ID="DesignTable:RigheListePrelievo" ZOrder="14" X="83" Y="846" Height="257" Width="242" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="130" />
<Shape ID="DesignTable:ElencoListePrelievo" ZOrder="3" X="393" Y="879" Height="381" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
<Shape ID="DesignTable:v_righeListePrelievoPosizione" ZOrder="9" X="406" Y="1283" Height="324" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="235" />
<Shape ID="DesignTable:v_particolariEsponenteFigura" ZOrder="8" X="829" Y="1437" Height="229" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="121" />
<Shape ID="DesignTable:Celle" ZOrder="7" X="694" Y="421" Height="438" Width="272" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="235" />
<Shape ID="DesignTable:TipoCella" ZOrder="5" X="1008" Y="-2" Height="343" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="216" />
<Shape ID="DesignTable:v_UdcDetail" ZOrder="1" X="693" Y="9" Height="362" Width="239" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
<Shape ID="DesignTable:AnagImballi" ZOrder="18" X="93" Y="43" Height="156" Width="211" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="75" />
<Shape ID="DesignTable:V_ParticolariOverview" ZOrder="17" X="95" Y="1131" Height="265" Width="272" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="138" />
<Shape ID="DesignTable:V_MagazziniOverview" ZOrder="8" X="733" Y="1102" Height="286" Width="232" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="178" />
<Shape ID="DesignTable:V_DettMagPart" ZOrder="16" X="993" Y="985" Height="326" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="228" />
<Shape ID="DesignTable:TipoListaPrelievo" ZOrder="3" X="724" Y="906" Height="191" Width="244" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="121" />
<Shape ID="DesignTable:RigheListePrelievo" ZOrder="15" X="83" Y="846" Height="257" Width="242" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="130" />
<Shape ID="DesignTable:ElencoListePrelievo" ZOrder="4" X="393" Y="879" Height="381" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
<Shape ID="DesignTable:v_righeListePrelievoPosizione" ZOrder="10" X="406" Y="1283" Height="324" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="235" />
<Shape ID="DesignTable:v_particolariEsponenteFigura" ZOrder="9" X="829" Y="1437" Height="229" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="121" />
</Shapes>
<Connectors>
<Connector ID="DesignRelation:FK_PosizioneUdcCorrente_ElencoCartellini" ZOrder="25" LineWidth="11">
@@ -61,7 +61,7 @@
</Point>
</RoutePoints>
</Connector>
<Connector ID="DesignRelation:FK_PosizioneUdcCorrente_Celle" ZOrder="5" LineWidth="11">
<Connector ID="DesignRelation:FK_PosizioneUdcCorrente_Celle" ZOrder="6" LineWidth="11">
<RoutePoints>
<Point>
<X>694</X>
@@ -97,7 +97,7 @@
</Point>
</RoutePoints>
</Connector>
<Connector ID="DesignRelation:FK_RigheListePrelievo_ElencoCartellini" ZOrder="13" LineWidth="11">
<Connector ID="DesignRelation:FK_RigheListePrelievo_ElencoCartellini" ZOrder="14" LineWidth="11">
<RoutePoints>
<Point>
<X>133</X>
@@ -109,7 +109,7 @@
</Point>
</RoutePoints>
</Connector>
<Connector ID="DesignRelation:FK_RigheListePrelievo_ElencoListePrelievo11" ZOrder="11" LineWidth="11">
<Connector ID="DesignRelation:FK_RigheListePrelievo_ElencoListePrelievo11" ZOrder="12" LineWidth="11">
<RoutePoints>
<Point>
<X>393</X>
@@ -121,7 +121,7 @@
</Point>
</RoutePoints>
</Connector>
<Connector ID="DesignRelation:FK_ElencoListePrelievo_TipoListaPrelievo11" ZOrder="10" LineWidth="11">
<Connector ID="DesignRelation:FK_ElencoListePrelievo_TipoListaPrelievo11" ZOrder="11" LineWidth="11">
<RoutePoints>
<Point>
<X>724</X>
+15 -3
View File
@@ -13,21 +13,33 @@ namespace GMW_data.Type
/// <param name="label">label da mostrare</param>
/// <param name="tooltip">tooltip da mostrare</param>
/// <param name="css">css da applicare</param>
/// <param name="key">chiave associata al blocco</param>
/// <param name="key">chiave associata al blocco (idx INT)</param>
/// <param name="cell">cella associata al blocco</param>
public BlockMap(string label, string tooltip, string css, string key, string cell)
/// <param name="capa">capacità blocco</param>
/// <param name="numUdc">num UDC del blocco</param>
/// <param name="piena">determina se sia indicata come piena</param>
/// <param name="attiva">determina se sia attivo</param>
public BlockMap(string label, string tooltip, string css, int key, string cell, int capa, int numUdc, bool piena, bool attiva)
{
Label = label;
ToolTip = tooltip;
Css = css;
KeyVal = key;
CellCode = cell;
Capacita = capa;
NumUdc = numUdc;
Piena = piena;
Attiva = attiva;
}
public string Label { get; set; }
public string ToolTip { get; set; }
public string Css { get; set; }
public string KeyVal { get; set; }
public int KeyVal { get; set; }
public string CellCode { get; set; }
public int Capacita { get; set; }
public int NumUdc { get; set; }
public bool Piena { get; set; }
public bool Attiva { get; set; }
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.