Inserita gestione embrionale risultati ricerca libera terminalino (manca corretto reinvio a moduli dettaglio)
git-svn-id: https://keyhammer.ath.cx/svn/GMW/trunk@228 365432ac-a1b5-4ffd-bb28-6d3099d32164
This commit is contained in:
@@ -145,6 +145,13 @@
|
||||
<Compile Include="WebUserControls\mod_search.ascx.designer.cs">
|
||||
<DependentUpon>mod_search.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WebUserControls\mod_searchResults.ascx.cs">
|
||||
<DependentUpon>mod_searchResults.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WebUserControls\mod_searchResults.ascx.designer.cs">
|
||||
<DependentUpon>mod_searchResults.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WS\AutoCompletamento.asmx.cs">
|
||||
<DependentUpon>AutoCompletamento.asmx</DependentUpon>
|
||||
<SubType>Component</SubType>
|
||||
@@ -258,6 +265,7 @@
|
||||
<ItemGroup>
|
||||
<Content Include="mazzAppSettings.config" />
|
||||
<Content Include="mazzConnectionStrings.config" />
|
||||
<Content Include="WebUserControls\mod_searchResults.ascx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
@@ -278,7 +286,7 @@
|
||||
<WebProjectProperties>
|
||||
<UseIIS>False</UseIIS>
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>50888</DevelopmentServerPort>
|
||||
<DevelopmentServerPort>50077</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>
|
||||
</IISUrl>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_search.ascx.cs"
|
||||
Inherits="GMW_Term.WebUserControls.mod_search" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
|
||||
<%@ Register src="mod_searchResults.ascx" tagname="mod_searchResults" tagprefix="uc1" %>
|
||||
<asp:ScriptManager ID="ScriptManager1" runat="server">
|
||||
</asp:ScriptManager>
|
||||
<div id="contenuto" style="text-align: center;">
|
||||
@@ -16,10 +17,10 @@
|
||||
<ContentTemplate>
|
||||
<div id="Data" style="padding-bottom: 10px;">
|
||||
<asp:TextBox ID="txtRicerca" runat="server" OnTextChanged="txtRicerca_TextChanged" />
|
||||
<cc1:AutoCompleteExtender ID="aceSearch" runat="server" TargetControlID="txtRicerca"
|
||||
ServicePath="~/WS/AutoCompletamento.asmx" ServiceMethod="elencoParticolari">
|
||||
</cc1:AutoCompleteExtender>
|
||||
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<uc1:mod_searchResults ID="mod_searchResults1" runat="server" />
|
||||
|
||||
|
||||
@@ -52,6 +52,12 @@ namespace GMW_Term.WebUserControls
|
||||
{
|
||||
Response.Redirect("Home.aspx");
|
||||
}
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
memLayer.ML.emptySessionVal("searchTerm");
|
||||
txtRicerca.Focus();
|
||||
mod_searchResults1.Visible = false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// in caso di valore cercato...
|
||||
@@ -61,6 +67,15 @@ namespace GMW_Term.WebUserControls
|
||||
protected void txtRicerca_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
valoreRicerca = txtSearch;
|
||||
updateSearchProviders();
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiorna i provider di ricerca con i valori consistenti trovati
|
||||
/// </summary>
|
||||
private void updateSearchProviders()
|
||||
{
|
||||
memLayer.ML.setSessionVal("searchTerm", txtRicerca.Text.Trim());
|
||||
mod_searchResults1.Visible = true;
|
||||
}
|
||||
/// <summary>
|
||||
/// testo contenuto nella textbox
|
||||
|
||||
+2
-2
@@ -68,12 +68,12 @@ namespace GMW_Term.WebUserControls {
|
||||
protected global::System.Web.UI.WebControls.TextBox txtRicerca;
|
||||
|
||||
/// <summary>
|
||||
/// aceSearch control.
|
||||
/// mod_searchResults1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::AjaxControlToolkit.AutoCompleteExtender aceSearch;
|
||||
protected global::GMW_Term.WebUserControls.mod_searchResults mod_searchResults1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_searchResults.ascx.cs"
|
||||
Inherits="GMW_Term.WebUserControls.mod_searchResults" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
|
||||
<div id="smallGrid">
|
||||
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
|
||||
OnSelectedIndexChanged="grView_SelectedIndexChanged" OnDataBound="grView_DataBound"
|
||||
Width="100%" DataKeyNames="valore" DataSourceID="ods" OnRowUpdating="grView_RowUpdating">
|
||||
<RowStyle CssClass="ctrRowStyle" />
|
||||
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
|
||||
<EditRowStyle CssClass="ctrEditRowStyle" />
|
||||
<SelectedRowStyle CssClass="ctrSelRowStyle" />
|
||||
<FooterStyle CssClass="ctrFooter" />
|
||||
<PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
|
||||
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
|
||||
<EmptyDataRowStyle CssClass="ctrRowStyle" />
|
||||
<EmptyDataTemplate>
|
||||
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
|
||||
</EmptyDataTemplate>
|
||||
<Columns>
|
||||
<%--<asp:TemplateField HeaderText="TipoLista" SortExpression="CodTipoLista" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton runat="server" ID="imgCodTipoLista" ImageUrl='<%# pathImgTipo(Eval("CodTipoLista")) %>'
|
||||
CausesValidation="False" CommandArgument="ShowDetail" OnClick="imgAzioneLista_Click"
|
||||
CommandName="Update" ToolTip='<%# tooltipTipo(Eval("CodTipoLista")) %>' />
|
||||
</ItemTemplate>
|
||||
|
||||
<ItemStyle HorizontalAlign="Center"></ItemStyle>
|
||||
</asp:TemplateField>--%>
|
||||
<asp:TemplateField HeaderText="Tipo" SortExpression="Tipo">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblTipo" runat="server" Text='<%# Eval("Tipo") %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="label" SortExpression="label">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbllabel" runat="server" Text='<%# Eval("label") %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="valore" SortExpression="valore">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblvalore" runat="server" Text='<%# Eval("valore") %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%-- <asp:TemplateField HeaderText="Part/qta" SortExpression="Particolare">
|
||||
<ItemTemplate>
|
||||
<div>
|
||||
<div style="float: left;">
|
||||
<b>
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Eval("Particolare") %>' />
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div style="float: right;">
|
||||
<asp:Label ID="lblPrelevati" runat="server" Text='<%# Eval("Prelevato","{0:0}") %>' />
|
||||
<asp:Label ID="lblTotale" runat="server" Text='<%# Eval("QtaTot","/ {0:0}") %>' />
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Stato" SortExpression="CodStatoLista" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton runat="server" ID="imgCodStatoLista" ImageUrl='<%# pathImgStato(Eval("CodStatoLista")) %>'
|
||||
CausesValidation="False" CommandArgument='<%# cmdArgStato(Eval("CodStatoLista")) %>'
|
||||
ToolTip='<%# cmdArgStato(Eval("CodStatoLista")) %>' OnClick="imgAzioneLista_Click"
|
||||
CommandName="Update" Enabled='<%# enabledStato(Eval("CodStatoLista")) %>' />
|
||||
<cc1:confirmbuttonextender id="cbeCambia" runat="server" confirmtext='<%# traduci(cmdArgStato(Eval("CodStatoLista")))%>'
|
||||
targetcontrolid="imgCodStatoLista" />
|
||||
</ItemTemplate>
|
||||
|
||||
<ItemStyle HorizontalAlign="Center"></ItemStyle>
|
||||
</asp:TemplateField>--%>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<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="GetData" TypeName="GMW_data.DS_UtilityTableAdapters.stp_ricercaFullTerminalinoTableAdapter"
|
||||
OnInserting="recuperaFooter" OnInserted="ods_Updated" OnUpdated="ods_Updated"
|
||||
OnDeleted="ods_Updated">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter Name="txtSearch" SessionField="searchTerm" Type="String" DefaultValue="*" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</div>
|
||||
@@ -0,0 +1,665 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
using GMW_data;
|
||||
|
||||
namespace GMW_Term.WebUserControls
|
||||
{
|
||||
public partial class mod_searchResults : System.Web.UI.UserControl
|
||||
{
|
||||
#region area da NON modificare
|
||||
|
||||
#region area protected
|
||||
|
||||
protected string _idxGridView;
|
||||
protected string _idxGridViewExt;
|
||||
protected string _tabCache;
|
||||
protected bool _showNewBtn = false;
|
||||
|
||||
/// <summary>
|
||||
/// wrapper traduzione termini
|
||||
/// </summary>
|
||||
/// <param name="lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduci(string lemma)
|
||||
{
|
||||
return user_std.UtSn.Traduci(lemma);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// imposta errore non cancellabilità per record correlati
|
||||
/// </summary>
|
||||
protected void setNoDeletableErrorMessage()
|
||||
{
|
||||
// mostro avviso di non cancellabilità...
|
||||
lblWarning.Text = traduci("notDeletable_hasChild");
|
||||
lblWarning.Visible = true;
|
||||
grView.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// esegue cancellazioen record
|
||||
/// </summary>
|
||||
protected void doDelete()
|
||||
{
|
||||
// posso cancellare...
|
||||
lblWarning.Visible = false;
|
||||
ods.Delete();
|
||||
}
|
||||
/// <summary>
|
||||
/// Valida la cancellazione per i dati mostrati dal gridView
|
||||
/// richiede sia preventivamentedichiarato _idxGridView
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected virtual void validaDelete(object sender, ObjectDataSourceMethodEventArgs e)
|
||||
{
|
||||
int idx = Convert.ToInt32(e.InputParameters[string.Format("Original_{0}", _idxGridView)]);
|
||||
if (objIsNotRelated(idx))
|
||||
{
|
||||
// annullo cancellazione...
|
||||
e.Cancel = true;
|
||||
// seleziono record... metto in session valore idx e poi ridisegno...
|
||||
SteamWare.memLayer.ML.setSessionVal(_idxGridView, idx);
|
||||
setNoDeletableErrorMessage();
|
||||
}
|
||||
else
|
||||
{
|
||||
doDelete();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// recupera i dati di un nuovo record contenuti nel footer di un gridView;
|
||||
/// questi devono esses opportunamente nominati (es: txt{0}, dl{0}, ...)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e)
|
||||
{
|
||||
//recupero la riga footer...
|
||||
DataColumnCollection colonne = colonneObj();
|
||||
string nomeCol;
|
||||
string tipoColonna = "";
|
||||
foreach (DataColumn colonna in colonne)
|
||||
{
|
||||
nomeCol = colonna.ColumnName;
|
||||
// cerco un textbox o quello che sia...
|
||||
if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "textBox";
|
||||
}
|
||||
else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "dropDownList";
|
||||
}
|
||||
else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "checkBox";
|
||||
}
|
||||
else if (grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "selAjax";
|
||||
}
|
||||
// in base al tipo salvo negli inputparameters dell'ODS
|
||||
switch (tipoColonna)
|
||||
{
|
||||
case "textBox":
|
||||
e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text;
|
||||
break;
|
||||
case "dropDownList":
|
||||
e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue;
|
||||
break;
|
||||
case "checkBox":
|
||||
e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
tipoColonna = "";
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// inserisce nuovo valore da footer
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lblIns_click(object sender, EventArgs e)
|
||||
{
|
||||
// click su inserimento, chiamo il metodo insert dell'ObjectDataSource
|
||||
ods.Insert();
|
||||
SteamWare.memLayer.ML.emptyCacheVal(_tabCache);
|
||||
}
|
||||
/// <summary>
|
||||
/// annulla inserimento nuovo valore da footer
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lblCanc_click(object sender, EventArgs e)
|
||||
{
|
||||
// annullo inserimento: nascondo footer, bind controlli...
|
||||
grView.FooterRow.Visible = false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// traduce gli header delle colonne
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
if (grView.Rows.Count > 0)
|
||||
{
|
||||
LinkButton lb;
|
||||
// aggiorno gli headers
|
||||
foreach (TableCell cella in grView.HeaderRow.Cells)
|
||||
{
|
||||
try
|
||||
{
|
||||
lb = (LinkButton)cella.Controls[0];
|
||||
lb.Text = traduci(lb.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1);
|
||||
lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord);
|
||||
}
|
||||
else
|
||||
{
|
||||
lblNumRec.Text = "";
|
||||
}
|
||||
}
|
||||
/// <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());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// reset della selezione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
resetSelezione();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region gestione eventi
|
||||
|
||||
public event EventHandler eh_resetSelezione;
|
||||
public event EventHandler eh_nuovoValore;
|
||||
public event EventHandler eh_selValore;
|
||||
|
||||
#endregion
|
||||
|
||||
#region public
|
||||
|
||||
/// <summary>
|
||||
/// definisce visibilità btnNew
|
||||
/// </summary>
|
||||
public bool showNewBtn
|
||||
{
|
||||
get
|
||||
{
|
||||
return _showNewBtn;
|
||||
}
|
||||
set
|
||||
{
|
||||
_showNewBtn = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua update del modulo
|
||||
/// </summary>
|
||||
public void doUpdate()
|
||||
{
|
||||
resetSelezione();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// metodi al caricamento della pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
#if false
|
||||
// controllo se ci sia richiesta x mostrare dettagli...
|
||||
if (memLayer.ML.BoolSessionObj("showDetListaPre"))
|
||||
{
|
||||
memLayer.ML.emptySessionVal("showDetListaPre");
|
||||
showListDetails(memLayer.ML.StringSessionObj("CodListaAttiva"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// elenco colonne del datagrid
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected DataColumnCollection colonneObj()
|
||||
{
|
||||
DS_Utility.stp_ricercaFullTerminalinoDataTable tabella = new DS_Utility.stp_ricercaFullTerminalinoDataTable();
|
||||
DataColumnCollection colonne = tabella.Columns;
|
||||
return colonne;
|
||||
}
|
||||
/// <summary>
|
||||
/// inizializzazione valori di default
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit(e);
|
||||
_idxGridView = "TipoSearch";
|
||||
|
||||
aggiornaControlliDataGL();
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiorna controlli datagrid e numero righe in pagina
|
||||
/// </summary>
|
||||
protected void aggiornaControlliDataGL()
|
||||
{
|
||||
grView.PageSize = 5;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// gestione cambio selezione valore
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
||||
/// </summary>
|
||||
public void resetSelezione()
|
||||
{
|
||||
SteamWare.memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView));
|
||||
grView.SelectedIndex = -1;
|
||||
grView.DataBind();
|
||||
lblWarning.Visible = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// salvo in session che il prox comando è iniziare lista prelievo...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void imgAzioneLista_Click(object sender, ImageClickEventArgs e)
|
||||
{
|
||||
ImageButton imgb = (ImageButton)sender;
|
||||
SteamWare.memLayer.ML.setSessionVal("nextObjCommand", imgb.CommandArgument);
|
||||
}
|
||||
/// <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();
|
||||
// quale comando?
|
||||
string _comando = "";
|
||||
if (SteamWare.memLayer.ML.isInSessionObject("nextObjCommand"))
|
||||
{
|
||||
_comando = SteamWare.memLayer.ML.StringSessionObj("nextObjCommand");
|
||||
SteamWare.memLayer.ML.emptySessionVal("nextObjCommand");
|
||||
}
|
||||
string CodSoggetto = MagClass.magazzino.CodSoggCurrUser;
|
||||
switch (_comando)
|
||||
{
|
||||
case "IniziaListaPrelievo":
|
||||
GMW_data.MagClass.magazzino.iniziaListaPrelievo(memLayer.ML.StringSessionObj("CodCS"), codLista, CodSoggetto);
|
||||
updateOds();
|
||||
grView.EditIndex = -1;
|
||||
grView.DataBind();
|
||||
// sollevo evento nuovo valore...
|
||||
if (eh_nuovoValore != null)
|
||||
{
|
||||
eh_nuovoValore(this, new EventArgs());
|
||||
}
|
||||
// blocco update!
|
||||
e.Cancel = true;
|
||||
break;
|
||||
case "CompletaListaPrelievo":
|
||||
GMW_data.MagClass.magazzino.completaListaPrelievo(memLayer.ML.StringSessionObj("CodCS"), codLista, CodSoggetto);
|
||||
updateOds();
|
||||
grView.EditIndex = -1;
|
||||
grView.DataBind();
|
||||
// sollevo evento nuovo valore...
|
||||
if (eh_nuovoValore != null)
|
||||
{
|
||||
eh_nuovoValore(this, new EventArgs());
|
||||
}
|
||||
// tolgo dalla session la lista prelievo attuale...
|
||||
memLayer.ML.emptySessionVal("CodLista_sel");
|
||||
// blocco update!
|
||||
e.Cancel = true;
|
||||
break;
|
||||
default:
|
||||
// faccio update!
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// chiamato post modifica valore check/selezione nel selettore filtro stato
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
public void eh_selectedStato(object sender, EventArgs e)
|
||||
{
|
||||
checkFixOds();
|
||||
}
|
||||
/// <summary>
|
||||
/// ssitema visualizzazione dal filtraggi
|
||||
/// </summary>
|
||||
private void checkFixOds()
|
||||
{
|
||||
#if false
|
||||
ods.FilterParameters.Clear();
|
||||
ods.FilterExpression = "(CodLista LIKE '%{0}%' OR Particolare LIKE '%{0}%' OR DescParticolare LIKE '%{0}%')";
|
||||
// parametro ricerca attuale
|
||||
SessionParameter parametroFiltro = new SessionParameter();
|
||||
parametroFiltro.SessionField = "valoreCercato";
|
||||
parametroFiltro.Name = "ricerca";
|
||||
parametroFiltro.DefaultValue = "*";
|
||||
ods.FilterParameters.Add(parametroFiltro);
|
||||
|
||||
#endif
|
||||
// chiamo procedura che aggiorna ods principale
|
||||
grView.SelectedIndex = -1;
|
||||
updateOds();
|
||||
}
|
||||
/// <summary>
|
||||
/// chiamato post modifica valore check/selezione nel selettore filtro tipo
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
public void eh_selectedTipo(object sender, EventArgs e)
|
||||
{
|
||||
checkFixOds();
|
||||
}
|
||||
/// <summary>
|
||||
/// restituisce URL immagine del codice da mostrare x stato lista
|
||||
/// </summary>
|
||||
/// <param name="codStato"></param>
|
||||
/// <returns></returns>
|
||||
public string pathImgStato(object codStato)
|
||||
{
|
||||
int stato = Convert.ToInt32(codStato);
|
||||
string answ = "";
|
||||
if (MagClass.magazzino.userHasActiveLP && stato == 1)
|
||||
{
|
||||
answ = string.Format("~/images/circleDis_s_{0}.png", codStato);
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = string.Format("~/images/circle_s_{0}.png", codStato);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// restituisce il comando da associare all'immagine dato lo stato della lista
|
||||
/// </summary>
|
||||
/// <param name="codStato"></param>
|
||||
/// <returns></returns>
|
||||
public string cmdArgStato(object codStato)
|
||||
{
|
||||
int stato = Convert.ToInt32(codStato);
|
||||
string answ = "";
|
||||
switch (stato)
|
||||
{
|
||||
case 1:
|
||||
answ = "IniziaListaPrelievo";
|
||||
break;
|
||||
case 2:
|
||||
answ = "CompletaListaPrelievo";
|
||||
break;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica la possibilità di click dato lo stato della lista secondo la regola:
|
||||
/// - se utente ne ha in carico una può solo chiuderla
|
||||
/// - altrimenti può prendere in carico una nuova
|
||||
/// </summary>
|
||||
/// <param name="codStato"></param>
|
||||
/// <returns></returns>
|
||||
public bool enabledStato(object codStato)
|
||||
{
|
||||
int stato = Convert.ToInt32(codStato);
|
||||
bool answ = false;
|
||||
switch (stato)
|
||||
{
|
||||
case 1:
|
||||
answ = !MagClass.magazzino.userHasActiveLP;
|
||||
break;
|
||||
case 2:
|
||||
answ = MagClass.magazzino.userHasActiveLP;
|
||||
break;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// determina se sia abilitato il pulsante x iniziare una lista di prelievo
|
||||
/// </summary>
|
||||
/// <param name="statoIniziata"></param>
|
||||
/// <returns></returns>
|
||||
public bool iniziaEnabled(object codStato)
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
answ = ((int)codStato == (int)statoLista.generata);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// determina se sia abilitato il pulsante x completare una lista di prelievo
|
||||
/// </summary>
|
||||
/// <param name="statoIniziata"></param>
|
||||
/// <returns></returns>
|
||||
public bool completaEnabled(object codStato)
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
answ = ((int)codStato == (int)statoLista.iniziata);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica se sia prelevabile
|
||||
/// </summary>
|
||||
/// <param name="statoPrelevata"></param>
|
||||
/// <param name="udc"></param>
|
||||
/// <returns></returns>
|
||||
public bool prelevaEnabled(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="annullaPrelevata"></param>
|
||||
/// <returns></returns>
|
||||
public bool annullaEnabled(object annullaPrelevata)
|
||||
{
|
||||
bool answ = prelievoEnabled;
|
||||
if (prelievoEnabled)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = Convert.ToBoolean(annullaPrelevata);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// determina se le righe di prelievo siano confermabili per prelievo (durante pick-up) - se c'è lista prelievo attiva ed è quella corrente!!!
|
||||
/// </summary>
|
||||
public bool prelievoEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
bool ListaInPrelievo = memLayer.ML.isInSessionObject("CodListaAttiva");
|
||||
bool ListaSelOk = (memLayer.ML.StringSessionObj("CodListaAttiva") == memLayer.ML.StringSessionObj("CodLista_sel"));
|
||||
return (ListaInPrelievo && ListaSelOk);
|
||||
}
|
||||
}
|
||||
/// <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>
|
||||
/// restituisce tooltip da mostrare x STATO lista
|
||||
/// </summary>
|
||||
/// <param name="codStato"></param>
|
||||
/// <returns></returns>
|
||||
public string tooltipStato(object codice)
|
||||
{
|
||||
return traduci(string.Format("StatoLista_{0}", codice));
|
||||
}
|
||||
/// <summary>
|
||||
/// restituisce URL immagine del codice da mostrare x TIPO lista
|
||||
/// </summary>
|
||||
/// <param name="codStato"></param>
|
||||
/// <returns></returns>
|
||||
public string pathImgTipo(object codice)
|
||||
{
|
||||
return string.Format("~/images/lista_{0}_m.png", codice);
|
||||
}
|
||||
/// <summary>
|
||||
/// restituisce tooltip da mostrare x TIPO lista
|
||||
/// </summary>
|
||||
/// <param name="codStato"></param>
|
||||
/// <returns></returns>
|
||||
public string tooltipTipo(object codice)
|
||||
{
|
||||
return traduci(codice.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// effettua logout...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnLoginPage_Click(object sender, EventArgs e)
|
||||
{
|
||||
TermUtils.TU.forceLogOut();
|
||||
Response.Redirect("~/Barcode.aspx");
|
||||
}
|
||||
/// <summary>
|
||||
/// va alla pagina dei buttons principale
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnButtonsHome_Click(object sender, EventArgs e)
|
||||
{
|
||||
Response.Redirect("~/Home.aspx");
|
||||
}
|
||||
/// <summary>
|
||||
/// nasconde dettagli
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnCloseDet_Click(object sender, EventArgs e)
|
||||
{
|
||||
//pnlDetail.Visible = false;
|
||||
//grView.Visible = true;
|
||||
// ricarico x evitare proliferazione "_" su prima colonna
|
||||
Response.Redirect("~/ListePrelievo.aspx");
|
||||
}
|
||||
/// <summary>
|
||||
/// passa al barcode!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnBarcode_Click(object sender, EventArgs e)
|
||||
{
|
||||
Response.Redirect("~/Barcode.aspx");
|
||||
}
|
||||
/// <summary>
|
||||
/// salvo in session che il prox comando è confermare 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>
|
||||
/// salvo in session che il prox comando è annullare prelievo...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void imgAnnullato_Click(object sender, ImageClickEventArgs e)
|
||||
{
|
||||
SteamWare.memLayer.ML.setSessionVal("nextObjCommand", "annullaPrelievo");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.4927
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GMW_Term.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_searchResults {
|
||||
|
||||
/// <summary>
|
||||
/// grView control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView grView;
|
||||
|
||||
/// <summary>
|
||||
/// lblNumRec control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblNumRec;
|
||||
|
||||
/// <summary>
|
||||
/// lblWarning control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblWarning;
|
||||
|
||||
/// <summary>
|
||||
/// ods control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -27,32 +27,3 @@ c:\Users\samuele.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term
|
||||
c:\Users\samuele.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\obj\Debug\ResolveAssemblyReference.cache
|
||||
c:\Users\samuele.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\obj\Debug\GMW_Term.dll
|
||||
c:\Users\samuele.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\obj\Debug\GMW_Term.pdb
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\GMW_Term.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\GMW_Term.pdb
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\AjaxControlToolkit.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\GMW_data.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\SteamWare.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\ICSharpCode.SharpZipLib.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\AjaxControlToolkit.pdb
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\GMW_data.pdb
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\SteamWare.pdb
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\SteamWare.xml
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\ar\AjaxControlToolkit.resources.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\cs\AjaxControlToolkit.resources.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\de\AjaxControlToolkit.resources.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\es\AjaxControlToolkit.resources.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\fr\AjaxControlToolkit.resources.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\he\AjaxControlToolkit.resources.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\hi\AjaxControlToolkit.resources.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\it\AjaxControlToolkit.resources.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\ja\AjaxControlToolkit.resources.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\ko\AjaxControlToolkit.resources.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\nl\AjaxControlToolkit.resources.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\pt\AjaxControlToolkit.resources.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\ru\AjaxControlToolkit.resources.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\tr-TR\AjaxControlToolkit.resources.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\zh-CHS\AjaxControlToolkit.resources.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\bin\zh-CHT\AjaxControlToolkit.resources.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\obj\Debug\ResolveAssemblyReference.cache
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\obj\Debug\GMW_Term.dll
|
||||
C:\Users\ermanno.STEAMWAREWIN\Documents\Visual Studio 2008\Projects\GMW\GMW_Term\obj\Debug\GMW_Term.pdb
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user