aggiunta catena procedure creazione nuova cella e nuova linea
This commit is contained in:
Binary file not shown.
Binary file not shown.
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -183,6 +183,8 @@
|
||||
<!--conf blocchi-->
|
||||
<add key="CodBloccoFusi" value="W10" />
|
||||
<add key="CodBloccoTrattati" value="W21" />
|
||||
<!--conf gestione linee-->
|
||||
<add key="codMagPost" value="WIP" />
|
||||
<!--Gestione multiselezione automatica UDC x linee multiple-->
|
||||
<add key="num4Cell" value="2" />
|
||||
<add key="minTimeW25" value="120" />
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
<Columns>
|
||||
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="6em">
|
||||
<HeaderTemplate>
|
||||
<asp:Button ID="btnReset" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click" Visible="true" />
|
||||
<%--<asp:Button ID="btnReset" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click" Visible="true" />--%>
|
||||
<asp:Button ID="Button1" runat="server" OnClick="btnNew_Click" Visible="true" Text='<%# traduci("New") %>' />
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<div style="white-space: nowrap;">
|
||||
@@ -44,7 +45,7 @@
|
||||
<%--<asp:CheckBoxField DataField="IsParent" HeaderText="IsParent" SortExpression="IsParent" />
|
||||
<asp:CheckBoxField DataField="AddChildEnabled" HeaderText="AddChildEnabled" SortExpression="AddChildEnabled" />--%>
|
||||
<asp:CheckBoxField DataField="Attivo" HeaderText="Attivo" SortExpression="Attivo" />
|
||||
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="6em">
|
||||
<%--<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="6em">
|
||||
<HeaderTemplate>
|
||||
<asp:LinkButton ID="btnNew" runat="server" OnClick="btnNew_Click" CssClass="btn btn-default btn-xs" Visible="true"><i class="glyphicon glyphicon-plus"></i> <%: traduci("New") %></asp:LinkButton>
|
||||
</HeaderTemplate>
|
||||
@@ -60,12 +61,12 @@
|
||||
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandArgument='<%# Eval("CodLinea") %>' CommandName="Delete" ImageUrl="~/images/elimina_m.png" ToolTip='<%# traduci("Delete") %>' OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaDel") %>' Visible='<%# delEnabled(Eval("CodLinea")) %>' />
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Center" Width="6em"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
</asp:TemplateField>--%>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="GMW_data.DS_magazzinoTableAdapters.AnagLineeTableAdapter" OnInserting="recuperaFooter" FilterExpression=" CodBlocco = '{0}' ">
|
||||
<FilterParameters>
|
||||
<asp:ControlParameter ControlID="hfCodBlocco" DefaultValue="" Name="FormatoDtmx" PropertyName="Value" Type="String" />
|
||||
<asp:ControlParameter ControlID="hfCodBlocco" DefaultValue="" Name="CodBlocco" PropertyName="Value" Type="String" />
|
||||
</FilterParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:HiddenField runat="server" ID="hfCodBlocco" />
|
||||
|
||||
@@ -45,14 +45,65 @@ namespace GMW.WebUserControls
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
// creo nuova riga NON ATTIVA!!!
|
||||
creaNuovaLinea();
|
||||
// reset selezione...
|
||||
resetSelezione();
|
||||
// mostro il footer oppure la riga dei dettagli x nuovo...
|
||||
if (grView.FooterRow != null)
|
||||
}
|
||||
/// <summary>
|
||||
/// Creo una nuova linea andando a creare prima tutte el dipendenze...
|
||||
/// </summary>
|
||||
private void creaNuovaLinea()
|
||||
{
|
||||
// magazzino linee: da web config ("WIP") cerco il suo CodMag
|
||||
string codMagPost = memLayer.ML.CRS("codMagPost");
|
||||
string CodCS = memLayer.ML.CRS("CodCS");
|
||||
DS_magazzino.TipoCellaRow rigaTipoCella = null;
|
||||
DS_magazzino.BlocchiRow rigaBlocco = null;
|
||||
DS_magazzino.CelleDataTable tabCelle = null;
|
||||
DS_magazzino.CelleRow rigaCella = null;
|
||||
// recupero TipoCella
|
||||
try
|
||||
{
|
||||
grView.FooterRow.Visible = true;
|
||||
rigaTipoCella = MagClass.magazzino.taTipoCella.getByCodMag(CodCS, codMagPost)[0];
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// recupero blocco selezionato
|
||||
try
|
||||
{
|
||||
rigaBlocco = MagClass.magazzino.taBlocchi.getByCodBlocco(CodBlocco)[0];
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
if (rigaTipoCella != null && rigaBlocco != null)
|
||||
{
|
||||
// --> +1 qta cella
|
||||
MagClass.magazzino.taTipoCella.UpdateQuery(rigaTipoCella.IdxTipoCella, codMagPost, CodCS, rigaTipoCella.Quantita + 1, rigaTipoCella.Capienza, rigaTipoCella.Max_X, rigaTipoCella.Max_Y, rigaTipoCella.Max_Z, rigaTipoCella.Max_Kg, rigaTipoCella.CheckPiena, rigaTipoCella.SetMag);
|
||||
// --> +1 qta blocco
|
||||
MagClass.magazzino.taBlocchi.UpdateQuery(codMagPost, CodCS, rigaBlocco.CodBlocco, rigaBlocco.DescBlocco, rigaBlocco.NumX + 1, rigaBlocco.NumY, rigaBlocco.NumZ, rigaBlocco.IdxBlocco);
|
||||
// creo NUOVA CELLA
|
||||
utils.obj.taSTP.stp_celleCreaMancantiBlocco(CodCS, codMagPost, rigaBlocco.IdxBlocco, rigaTipoCella.IdxTipoCella);
|
||||
// recupero ultima cella creata...
|
||||
tabCelle = MagClass.magazzino.taCelle.getByIdxBlocco(rigaBlocco.IdxBlocco);
|
||||
if (tabCelle.Rows.Count > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
rigaCella = (DS_magazzino.CelleRow)tabCelle.Select(string.Format("X = {0}", rigaBlocco.NumX + 1))[0];
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
if (rigaCella != null)
|
||||
{
|
||||
// creo nuova linea
|
||||
MagClass.magazzino.taAL.Insert(rigaCella.CodCella.Substring(0, 5), "NUOVA LINEA", "", DateTime.Now, "", "", false, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// determina se sia eliminabile il record (=non usato)
|
||||
/// </summary>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<asp:CheckBoxField DataField="Attivo" HeaderText="Attivo" SortExpression="Attivo" />--%>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="GMW_data.DS_magazzinoTableAdapters.AnagLineeTableAdapter" OnInserting="recuperaFooter" FilterExpression=" Attivo = 1 AND IsPArent = 1 AND ( CodLinea LIKE '%{0}%' OR Descrizione LIKE '%{0}%' OR CodBlocco LIKE '%{0}%' OR FormatoDtmx LIKE '%{0}%') ">
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="GMW_data.DS_magazzinoTableAdapters.AnagLineeTableAdapter" OnInserting="recuperaFooter" FilterExpression=" Attivo = 1 AND IsParent = 1 AND ( CodLinea LIKE '%{0}%' OR Descrizione LIKE '%{0}%' OR CodBlocco LIKE '%{0}%' OR FormatoDtmx LIKE '%{0}%') ">
|
||||
<FilterParameters>
|
||||
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
|
||||
</FilterParameters>
|
||||
|
||||
Binary file not shown.
@@ -183,6 +183,8 @@
|
||||
<!--conf blocchi-->
|
||||
<add key="CodBloccoFusi" value="W10" />
|
||||
<add key="CodBloccoTrattati" value="W21" />
|
||||
<!--conf gestione linee-->
|
||||
<add key="codMagPost" value="WIP" />
|
||||
<!--Gestione multiselezione automatica UDC x linee multiple-->
|
||||
<add key="num4Cell" value="2" />
|
||||
<add key="minTimeW25" value="120" />
|
||||
|
||||
Reference in New Issue
Block a user