Aggiunta conferma prelievo UDC in liste
git-svn-id: https://keyhammer.ath.cx/svn/GMW/trunk@114 365432ac-a1b5-4ffd-bb28-6d3099d32164
This commit is contained in:
@@ -13,8 +13,7 @@
|
||||
<div style="float: left; margin-right: 5px;">
|
||||
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
|
||||
OnSelectedIndexChanged="grView_SelectedIndexChanged" OnDataBound="grView_DataBound"
|
||||
DataKeyNames="CodLista" DataSourceID="ods"
|
||||
onrowupdating="grView_RowUpdating">
|
||||
DataKeyNames="CodLista" DataSourceID="ods" OnRowUpdating="grView_RowUpdating">
|
||||
<RowStyle CssClass="ctrRowStyle" />
|
||||
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
|
||||
<EditRowStyle CssClass="ctrEditRowStyle" />
|
||||
@@ -36,8 +35,7 @@
|
||||
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
|
||||
ToolTip='<%# traduci("Select") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.seleziona, SteamWare.dimImg.small) %>' />
|
||||
</ItemTemplate>
|
||||
|
||||
<ItemStyle HorizontalAlign="Center"></ItemStyle>
|
||||
<ItemStyle HorizontalAlign="Center"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="CodLista" SortExpression="CodLista">
|
||||
<ItemTemplate>
|
||||
@@ -54,8 +52,7 @@
|
||||
<asp:Label ID="lblPrelevati" runat="server" Text='<%# Eval("prelevato","{0:0}") %>' />
|
||||
<asp:Label ID="lblTotale" runat="server" Text='<%# Eval("QtaTot","/ {0:0}") %>' />
|
||||
</ItemTemplate>
|
||||
|
||||
<ItemStyle HorizontalAlign="Center"></ItemStyle>
|
||||
<ItemStyle HorizontalAlign="Center"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Iniz" SortExpression="Iniziata">
|
||||
<ItemTemplate>
|
||||
@@ -75,9 +72,10 @@
|
||||
Visible="false" />
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgIniziaListaPrelievo" runat="server" CausesValidation="False"
|
||||
<asp:ImageButton ID="imgIniziaListaPrelievo" runat="server" CausesValidation="False"
|
||||
CommandName="Update" CommandArgument="creaIniziaListaPrelievo" ToolTip='<%# traduci("IniziaListaPrelievo") %>'
|
||||
Visible='<%# iniziaEnabled(Eval("Iniziata")) %>' ImageUrl="~/images/Start_16.png" OnClick="imgIniziaLista_Click" />
|
||||
Visible='<%# iniziaEnabled(Eval("Iniziata")) %>' ImageUrl="~/images/Start_16.png"
|
||||
OnClick="imgIniziaLista_Click" />
|
||||
<cc1:ConfirmButtonExtender ID="cbeInizia" runat="server" ConfirmText='<%# traduci("confermaIniziaLista")%>'
|
||||
TargetControlID="imgIniziaListaPrelievo" />
|
||||
</ItemTemplate>
|
||||
@@ -87,20 +85,19 @@
|
||||
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />
|
||||
<asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}"
|
||||
SelectMethod="getByFilt" TypeName="GMW_data.DS_magazzinoTableAdapters.ElencoListePrelievoTableAdapter"
|
||||
OnInserting="recuperaFooter" FilterExpression="CodLista LIKE '%{0}%' OR Particolare LIKE '%{0}%' OR DescParticolare LIKE '%{0}%'"
|
||||
OnInserted="ods_Updated" OnUpdated="ods_Updated">
|
||||
<FilterParameters>
|
||||
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
|
||||
</FilterParameters>
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="chkIniziata" DefaultValue="0" Name="Iniziata" PropertyName="Checked"
|
||||
Type="Boolean" />
|
||||
<asp:ControlParameter ControlID="chkCompletata" DefaultValue="0" Name="Completata"
|
||||
PropertyName="Checked" Type="Boolean" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
|
||||
SelectMethod="getByFilt" TypeName="GMW_data.DS_magazzinoTableAdapters.ElencoListePrelievoTableAdapter"
|
||||
OnInserting="recuperaFooter" FilterExpression="CodLista LIKE '%{0}%' OR Particolare LIKE '%{0}%' OR DescParticolare LIKE '%{0}%'"
|
||||
OnInserted="ods_Updated" OnUpdated="ods_Updated">
|
||||
<FilterParameters>
|
||||
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
|
||||
</FilterParameters>
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="chkIniziata" DefaultValue="0" Name="Iniziata" PropertyName="Checked"
|
||||
Type="Boolean" />
|
||||
<asp:ControlParameter ControlID="chkCompletata" DefaultValue="0" Name="Completata"
|
||||
PropertyName="Checked" Type="Boolean" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</div>
|
||||
<div style="float: left;">
|
||||
<uc1:mod_viewRigheListaPrelievo ID="mod_viewRigheListaPrelievo1" runat="server" />
|
||||
|
||||
@@ -307,6 +307,14 @@ namespace GMW.WebUserControls
|
||||
chkIniziata.Text = traduci("MostraIniziate");
|
||||
chkCompletata.Text = traduci("MostraCompletate");
|
||||
}
|
||||
// registro evento update
|
||||
mod_viewRigheListaPrelievo1.eh_nuovoValore += new EventHandler(mod_viewRigheListaPrelievo1_eh_nuovoValore);
|
||||
}
|
||||
|
||||
void mod_viewRigheListaPrelievo1_eh_nuovoValore(object sender, EventArgs e)
|
||||
{
|
||||
// aggiorno!
|
||||
updateOds();
|
||||
}
|
||||
/// <summary>
|
||||
/// svuoto da cache post update
|
||||
@@ -348,7 +356,7 @@ namespace GMW.WebUserControls
|
||||
|
||||
public bool iniziaEnabled(object statoIniziata)
|
||||
{
|
||||
bool answ = false;// isWritable();
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
answ = !Convert.ToBoolean(statoIniziata);
|
||||
@@ -369,6 +377,14 @@ namespace GMW.WebUserControls
|
||||
SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, true);
|
||||
// mostra con dettagli
|
||||
mod_viewRigheListaPrelievo1.Visible = true;
|
||||
bool prelievoOk = false;
|
||||
try
|
||||
{
|
||||
prelievoOk = GMW_data.MagClass.magazzino.taElencoListePrelievo.getByCodLista(grView.SelectedValue.ToString())[0].Iniziata;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
mod_viewRigheListaPrelievo1.prelievoEnabled = prelievoOk; // abilito il prelievo SOLO se la lista è già iniziata...
|
||||
}
|
||||
/// <summary>
|
||||
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
||||
@@ -408,7 +424,7 @@ namespace GMW.WebUserControls
|
||||
/// <summary>
|
||||
/// aggiorno visualizzazione
|
||||
/// </summary>
|
||||
private void updateOdsDaFiltro()
|
||||
private void updateOds()
|
||||
{
|
||||
grView.DataBind();
|
||||
}
|
||||
@@ -441,9 +457,9 @@ namespace GMW.WebUserControls
|
||||
switch (_comando)
|
||||
{
|
||||
case "iniziaListaPrelievo":
|
||||
string CodSoggetto = "O0000000000000069"; // operatore a caso, POI sarà da cercare da operatore correntemente loggato...
|
||||
string CodSoggetto = "O0000000000000069"; // operatore a caso, POI sarà da cercare da operatore correntemente loggato... !!!FARE!!!
|
||||
GMW_data.MagClass.magazzino.iniziaListaPrelievo(memLayer.ML.StringSessionObj("CodCS"), codLista, CodSoggetto);
|
||||
updateOdsDaFiltro();
|
||||
updateOds();
|
||||
grView.EditIndex = -1;
|
||||
grView.DataBind();
|
||||
// sollevo evento nuovo valore...
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
|
||||
OnSelectedIndexChanged="grView_SelectedIndexChanged" OnDataBound="grView_DataBound"
|
||||
DataKeyNames="CodLista,UDC" DataSourceID="ods" OnPageIndexChanged="grView_PageIndexChanged"
|
||||
OnSorted="grView_Sorted">
|
||||
OnSorted="grView_Sorted" onrowupdating="grView_RowUpdating">
|
||||
<RowStyle CssClass="ctrRowStyle" />
|
||||
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
|
||||
<EditRowStyle CssClass="ctrEditRowStyle" />
|
||||
@@ -28,41 +28,30 @@
|
||||
SortExpression="CodLista" Visible="False" />
|
||||
<asp:BoundField DataField="UDC" HeaderText="UDC" ReadOnly="True" SortExpression="UDC" />
|
||||
<asp:BoundField DataField="Qta" HeaderText="Qta" SortExpression="Qta" />
|
||||
<asp:BoundField DataField="Proposto" HeaderText="Prop" SortExpression="Proposto" />
|
||||
<asp:BoundField DataField="Prelevato" HeaderText="Prel" SortExpression="Prelevato" />
|
||||
<asp:CheckBoxField DataField="Proposto" HeaderText="Prop" SortExpression="Proposto" />
|
||||
<asp:CheckBoxField DataField="Prelevato" HeaderText="Prel" SortExpression="Prelevato" />
|
||||
<asp:TemplateField ShowHeader="False">
|
||||
<HeaderTemplate>
|
||||
<asp:Button ID="btnNew" runat="server" OnClick="btnNew_Click" Text='<%# traduci("New") %>'
|
||||
Visible="false" />
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgPrelevato" runat="server" CausesValidation="False"
|
||||
CommandName="Update" CommandArgument="ConfermaPrelevato" ToolTip='<%# traduci("EffettuaPrelievo") %>'
|
||||
Visible='<%# prelevaEnabled(Eval("Prelevato")) %>' ImageUrl="~/images/apply_m.png" OnClick="imgPrelevato_Click" />
|
||||
<cc1:ConfirmButtonExtender ID="cbePreleva" runat="server" ConfirmText='<%# traduci("confermaPrelievo")%>'
|
||||
TargetControlID="imgPrelevato" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}"
|
||||
SelectMethod="getByCodLista" TypeName="GMW_data.DS_magazzinoTableAdapters.RigheListePrelievoTableAdapter"
|
||||
DeleteMethod="Delete" InsertMethod="Insert" UpdateMethod="Update">
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_CodLista" Type="String" />
|
||||
<asp:Parameter Name="Original_UDC" Type="String" />
|
||||
<asp:Parameter Name="Original_Qta" Type="Decimal" />
|
||||
<asp:Parameter Name="Original_Proposto" Type="Boolean" />
|
||||
<asp:Parameter Name="Original_Prelevato" Type="Boolean" />
|
||||
</DeleteParameters>
|
||||
<UpdateParameters>
|
||||
<asp:Parameter Name="Qta" Type="Decimal" />
|
||||
<asp:Parameter Name="Proposto" Type="Boolean" />
|
||||
<asp:Parameter Name="Prelevato" Type="Boolean" />
|
||||
<asp:Parameter Name="Original_CodLista" Type="String" />
|
||||
<asp:Parameter Name="Original_UDC" Type="String" />
|
||||
<asp:Parameter Name="Original_Qta" Type="Decimal" />
|
||||
<asp:Parameter Name="Original_Proposto" Type="Boolean" />
|
||||
<asp:Parameter Name="Original_Prelevato" Type="Boolean" />
|
||||
</UpdateParameters>
|
||||
SelectMethod="getByCodLista"
|
||||
TypeName="GMW_data.DS_magazzinoTableAdapters.RigheListePrelievoTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter DefaultValue="*" Name="CodLista" SessionField="CodLista_sel"
|
||||
Type="String" />
|
||||
</SelectParameters>
|
||||
<InsertParameters>
|
||||
<asp:Parameter Name="CodLista" Type="String" />
|
||||
<asp:Parameter Name="UDC" Type="String" />
|
||||
<asp:Parameter Name="Qta" Type="Decimal" />
|
||||
<asp:Parameter Name="Proposto" Type="Boolean" />
|
||||
<asp:Parameter Name="Prelevato" Type="Boolean" />
|
||||
</InsertParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />
|
||||
<asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />
|
||||
@@ -197,11 +197,97 @@ namespace GMW.WebUserControls
|
||||
eh_resetSelezione(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
/// <summary>
|
||||
/// verifica se sia prelevabile
|
||||
/// </summary>
|
||||
/// <param name="statoIniziata"></param>
|
||||
/// <returns></returns>
|
||||
public bool prelevaEnabled(object statoPrelevata)
|
||||
{
|
||||
bool answ = prelievoEnabled;
|
||||
if (prelievoEnabled)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = !Convert.ToBoolean(statoPrelevata);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// salvo in session che il prox comando è iniziare lista prelievo...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void imgPrelevato_Click(object sender, ImageClickEventArgs e)
|
||||
{
|
||||
SteamWare.memLayer.ML.setSessionVal("nextObjCommand", "confermaPrelievo");
|
||||
}
|
||||
/// <summary>
|
||||
/// in caso di aggiornamento verifico se sia salvato un comando inizia o completa lista prelievo...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_RowUpdating(object sender, GridViewUpdateEventArgs e)
|
||||
{
|
||||
// carico l'idx dell'oggetto
|
||||
string codLista = e.Keys["CodLista"].ToString();
|
||||
string UDC = e.Keys["UDC"].ToString();
|
||||
// quale comando?
|
||||
string _comando = "";
|
||||
if (SteamWare.memLayer.ML.isInSessionObject("nextObjCommand"))
|
||||
{
|
||||
_comando = SteamWare.memLayer.ML.StringSessionObj("nextObjCommand");
|
||||
SteamWare.memLayer.ML.emptySessionVal("nextObjCommand");
|
||||
}
|
||||
// verifico il tipo di richiesta (up/down level, clona o update normale
|
||||
switch (_comando)
|
||||
{
|
||||
case "confermaPrelievo":
|
||||
GMW_data.MagClass.magazzino.confermaUdcPrelevatoPerLista(memLayer.ML.StringSessionObj("CodCS"), codLista, UDC);
|
||||
updateOdsDaFiltro();
|
||||
grView.EditIndex = -1;
|
||||
grView.DataBind();
|
||||
// sollevo evento nuovo valore...
|
||||
if (eh_nuovoValore != null)
|
||||
{
|
||||
eh_nuovoValore(this, new EventArgs());
|
||||
}
|
||||
// blocco update!
|
||||
e.Cancel = true;
|
||||
break;
|
||||
default:
|
||||
// faccio update!
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// gestione evento richeista nuovo valore (mostra footer, ...)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
// reset selezione...
|
||||
resetSelezione();
|
||||
// mostro il footer oppure la riga dei dettagli x nuovo...
|
||||
if (grView.FooterRow != null)
|
||||
{
|
||||
grView.FooterRow.Visible = true;
|
||||
}
|
||||
// sollevo evento nuovo valore...
|
||||
if (eh_nuovoValore != null)
|
||||
{
|
||||
eh_nuovoValore(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
public bool prelievoEnabled { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user