Gestione non prelevabilità 2 volte stesso UDC iniziale (non mostra pulsante)

aggiunto controllo ANCHE in fase di commit sulla prelevabilità

git-svn-id: https://keyhammer.ath.cx/svn/GMW/trunk@119 365432ac-a1b5-4ffd-bb28-6d3099d32164
This commit is contained in:
samuele
2010-07-06 14:21:20 +00:00
parent 86e5b8d280
commit a82f5eb355
23 changed files with 672 additions and 562 deletions
+9
View File
@@ -820,6 +820,15 @@
<Content Include="images\circle_s_2.png" />
<Content Include="images\circle_s_3.png" />
<Content Include="images\circle_s_4.png" />
<Content Include="images\recycle_green_l.png" />
<Content Include="images\recycle_green_m.png" />
<Content Include="images\recycle_green_s.png" />
<Content Include="images\recycle_orange_l.png" />
<Content Include="images\recycle_orange_m.png" />
<Content Include="images\recycle_orange_s.png" />
<Content Include="images\recycle_red_l.png" />
<Content Include="images\recycle_red_m.png" />
<Content Include="images\recycle_red_s.png" />
<Content Include="images\Start_16.png" />
<Content Include="images\Start_22.png" />
<Content Include="images\Start_32.png" />
@@ -5,7 +5,7 @@
TagPrefix="uc1" %>
<%@ Register Src="mod_periodoAnalisi.ascx" TagName="mod_periodoAnalisi" TagPrefix="uc2" %>
<%@ Register Src="mod_filtro.ascx" TagName="mod_filtro" TagPrefix="uc3" %>
<table width="100%" cellpadding="0" cellspacing="0">
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2">
<div class="filtro_1" style="white-space: nowrap; height: 28px; padding: 2px;">
@@ -38,7 +38,7 @@
<ItemTemplate>
<asp:ImageButton ID="imgPrelevato" runat="server" CausesValidation="False" CommandName="Update"
CommandArgument="ConfermaPrelevato" ToolTip='<%# traduci("EffettuaPrelievo") %>'
Visible='<%# prelevaEnabled(Eval("Prelevato")) %>' ImageUrl="~/images/apply_s.png"
Visible='<%# prelevaEnabled(Eval("Prelevato"), Eval("UDC")) %>' ImageUrl="~/images/apply_s.png"
OnClick="imgPrelevato_Click" />
<cc1:ConfirmButtonExtender ID="cbePreleva" runat="server" ConfirmText='<%# traduci("confermaPrelievo")%>'
TargetControlID="imgPrelevato" />
@@ -48,6 +48,12 @@
OnClick="imgAnnullato_Click" />
<cc1:ConfirmButtonExtender ID="cbeAnnulla" runat="server" ConfirmText='<%# traduci("confermaAnnullaPrelievo")%>'
TargetControlID="imgAnnullaPrelevato" />
<asp:ImageButton ID="imgScambiaUDC" runat="server" CausesValidation="False" CommandName="Update"
CommandArgument="ScambiaUdc" ToolTip='<%# traduci("ScambiaUdc") %>'
Visible='<%# scambiaEnabled(Eval("Prelevato"), Eval("UDC")) %>' ImageUrl="~/images/recycle_orange_s.png"
OnClick="imgScambia_Click" />
<cc1:ConfirmButtonExtender ID="cbeScambiaUDC" runat="server" ConfirmText='<%# traduci("confermaScambiaUdc")%>'
TargetControlID="imgScambiaUDC" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
@@ -171,12 +171,6 @@ namespace GMW.WebUserControls
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
#if false
// salvo in session il lo stato scelto...
SteamWare.memLayer.ML.setSessionVal("DescStato_sel", grView.SelectedDataKey["DescStato"], false);
// salvo anche l'esponente scelto...
SteamWare.memLayer.ML.setSessionVal("Esponente_sel", grView.SelectedDataKey["Esponente"], false);
#endif
// sollevo evento nuovo valore...
if (eh_selValore != null)
{
@@ -189,10 +183,6 @@ namespace GMW.WebUserControls
/// </summary>
public void resetSelezione()
{
#if false
SteamWare.memLayer.ML.emptySessionVal("DescStato_sel");
SteamWare.memLayer.ML.emptySessionVal("Esponente_sel");
#endif
grView.SelectedIndex = -1;
grView.DataBind();
lblWarning.Visible = false;
@@ -202,28 +192,74 @@ namespace GMW.WebUserControls
}
}
/// <summary>
/// fornisce verifica se l'udc sia già stato prelevato altrove...
/// </summary>
/// <param name="udc"></param>
/// <returns></returns>
public bool udcPrelevato(object udc)
{
return GMW_data.MagClass.magazzino.taRigheListePrelievo.getPrelevateByUdc(udc.ToString()).Rows.Count > 0;
}
/// <summary>
/// verifica se sia prelevabile
/// </summary>
/// <param name="statoIniziata"></param>
/// <param name="statoPrelevata"></param>
/// <param name="udc"></param>
/// <returns></returns>
public bool prelevaEnabled(object statoPrelevata)
public bool prelevaEnabled(object statoPrelevata, object udc)
{
bool answ = prelievoEnabled;
if (prelievoEnabled)
{
try
// controllo se non risulti prelevato l'UDC in un altra lista...
if (udcPrelevato(udc))
{
answ = !Convert.ToBoolean(statoPrelevata);
answ = false;
}
else
{
try
{
answ = !Convert.ToBoolean(statoPrelevata);
}
catch
{ }
}
catch
{ }
}
return answ;
}
/// <summary>
/// verifica se sia scambiabile
/// </summary>
/// <param name="statoPrelevata"></param>
/// <param name="udc"></param>
/// <returns></returns>
public bool scambiaEnabled(object statoPrelevata, object udc)
{
bool answ = prelievoEnabled;
if (prelievoEnabled)
{
// controllo se non risulti prelevato l'UDC in un altra lista...
if (!udcPrelevato(udc))
{
answ = false;
}
else
{
try
{
answ = !Convert.ToBoolean(statoPrelevata);
}
catch
{ }
}
}
return answ;
}
/// <summary>
/// verifica se sia annullabile il prelievo
/// </summary>
/// <param name="statoIniziata"></param>
/// <param name="annullaPrelevata"></param>
/// <returns></returns>
public bool annullaEnabled(object annullaPrelevata)
{
@@ -258,6 +294,15 @@ namespace GMW.WebUserControls
SteamWare.memLayer.ML.setSessionVal("nextObjCommand", "annullaPrelievo");
}
/// <summary>
/// salvo in session che il prox comando è confermare prelievo...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void imgScambia_Click(object sender, ImageClickEventArgs e)
{
SteamWare.memLayer.ML.setSessionVal("nextObjCommand", "scambiaFifo");
}
/// <summary>
/// in caso di aggiornamento verifico se sia salvato un comando inizia o completa lista prelievo...
/// </summary>
/// <param name="sender"></param>
@@ -278,7 +323,11 @@ namespace GMW.WebUserControls
switch (_comando)
{
case "confermaPrelievo":
GMW_data.MagClass.magazzino.confermaUdcPrelevatoPerLista(memLayer.ML.StringSessionObj("CodCS"), codLista, UDC);
// controllo SE sia ancora prelevabile questo UDC...
if (!udcPrelevato(UDC))
{
GMW_data.MagClass.magazzino.confermaUdcPrelevatoPerLista(memLayer.ML.StringSessionObj("CodCS"), codLista, UDC);
}
updateOdsDaFiltro();
grView.EditIndex = -1;
grView.DataBind();
@@ -303,6 +352,19 @@ namespace GMW.WebUserControls
// blocco update!
e.Cancel = true;
break;
case "scambiaFifo":
//GMW_data.MagClass.magazzino.annullaUdcPrelevatoPerLista(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;
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 799 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 970 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1000 B

Binary file not shown.
Binary file not shown.
+29 -7
View File
@@ -16835,7 +16835,7 @@ SELECT CodLista, UDC, Qta, Proposto, Prelevato FROM RigheListePrelievo WHERE (Co
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
private void InitCommandCollection() {
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[4];
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[5];
this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[0].Connection = this.Connection;
this._commandCollection[0].CommandText = "SELECT CodLista, UDC, Qta, Proposto, Prelevato FROM dbo.RigheListePrelievo";
@@ -16848,18 +16848,24 @@ SELECT CodLista, UDC, Qta, Proposto, Prelevato FROM RigheListePrelievo WHERE (Co
this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodLista", global::System.Data.SqlDbType.NVarChar, 12, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[2].Connection = this.Connection;
this._commandCollection[2].CommandText = "dbo.stp_setAnnullaUdcPrelevato";
this._commandCollection[2].CommandText = "dbo.stp_righePrelevateByUdc";
this._commandCollection[2].CommandType = global::System.Data.CommandType.StoredProcedure;
this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodLista", global::System.Data.SqlDbType.NVarChar, 12, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.VarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[3].Connection = this.Connection;
this._commandCollection[3].CommandText = "dbo.stp_UDC_upsertPrelevato";
this._commandCollection[3].CommandText = "dbo.stp_setAnnullaUdcPrelevato";
this._commandCollection[3].CommandType = global::System.Data.CommandType.StoredProcedure;
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodLista", global::System.Data.SqlDbType.NVarChar, 12, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[4].Connection = this.Connection;
this._commandCollection[4].CommandText = "dbo.stp_UDC_upsertPrelevato";
this._commandCollection[4].CommandType = global::System.Data.CommandType.StoredProcedure;
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodLista", global::System.Data.SqlDbType.NVarChar, 12, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
@@ -16903,8 +16909,24 @@ SELECT CodLista, UDC, Qta, Proposto, Prelevato FROM RigheListePrelievo WHERE (Co
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
public virtual DS_magazzino.RigheListePrelievoDataTable setAnnullaUdcPrelevato(string CodLista, string UDC) {
public virtual DS_magazzino.RigheListePrelievoDataTable getPrelevateByUdc(string UDC) {
this.Adapter.SelectCommand = this.CommandCollection[2];
if ((UDC == null)) {
this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
}
else {
this.Adapter.SelectCommand.Parameters[1].Value = ((string)(UDC));
}
DS_magazzino.RigheListePrelievoDataTable dataTable = new DS_magazzino.RigheListePrelievoDataTable();
this.Adapter.Fill(dataTable);
return dataTable;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
public virtual DS_magazzino.RigheListePrelievoDataTable setAnnullaUdcPrelevato(string CodLista, string UDC) {
this.Adapter.SelectCommand = this.CommandCollection[3];
if ((CodLista == null)) {
this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
}
@@ -16926,7 +16948,7 @@ SELECT CodLista, UDC, Qta, Proposto, Prelevato FROM RigheListePrelievo WHERE (Co
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
public virtual DS_magazzino.RigheListePrelievoDataTable upsertPrelevato(string CodLista, string UDC) {
this.Adapter.SelectCommand = this.CommandCollection[3];
this.Adapter.SelectCommand = this.CommandCollection[4];
if ((CodLista == null)) {
this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
}
File diff suppressed because it is too large Load Diff
+8 -8
View File
@@ -4,7 +4,7 @@
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
</autogenerated>-->
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="49" ViewPortY="392" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="58" ViewPortY="411" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
<Shapes>
<Shape ID="DesignTable:ElencoCartellini" ZOrder="5" X="68" Y="333" Height="326" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="228" />
<Shape ID="DesignTable:AnagMag" ZOrder="24" X="1014" Y="372" Height="190" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="75" />
@@ -19,7 +19,7 @@
<Shape ID="DesignTable:V_MagazziniOverview" ZOrder="2" X="704" Y="1109" Height="276" Width="232" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="178" />
<Shape ID="DesignTable:V_DettMagPart" ZOrder="10" X="993" Y="985" Height="326" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="228" />
<Shape ID="DesignTable:TipoListaPrelievo" ZOrder="7" X="697" Y="906" Height="156" Width="239" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="92" />
<Shape ID="DesignTable:RigheListePrelievo" ZOrder="9" X="59" Y="901" Height="207" Width="247" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="109" />
<Shape ID="DesignTable:RigheListePrelievo" ZOrder="9" X="83" Y="846" Height="257" Width="280" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="130" />
<Shape ID="DesignTable:ElencoListePrelievo" ZOrder="1" X="393" Y="900" Height="343" Width="218" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="216" />
</Shapes>
<Connectors>
@@ -102,12 +102,12 @@
<Connector ID="DesignRelation:FK_RigheListePrelievo_ElencoCartellini" ZOrder="8" LineWidth="11">
<RoutePoints>
<Point>
<X>109</X>
<X>133</X>
<Y>659</Y>
</Point>
<Point>
<X>109</X>
<Y>901</Y>
<X>133</X>
<Y>846</Y>
</Point>
</RoutePoints>
</Connector>
@@ -115,11 +115,11 @@
<RoutePoints>
<Point>
<X>393</X>
<Y>1004</Y>
<Y>949</Y>
</Point>
<Point>
<X>306</X>
<Y>1004</Y>
<X>363</X>
<Y>949</Y>
</Point>
</RoutePoints>
</Connector>
Binary file not shown.
Binary file not shown.