Aggiornato comportamento selettore macchine
#fixed 1036 git-svn-id: https://keyhammer.ath.cx/svn/WebGIM/trunk@116 3e04ef4b-3b25-4b6c-be27-bb5389ca777b
This commit is contained in:
Binary file not shown.
@@ -58,5 +58,5 @@
|
||||
<add key="autoEnrollModulo" value="GIM"/>
|
||||
<add key="autoEnrollFunzione" value="GIM_U"/>
|
||||
<!--gestione stampanti-->
|
||||
<add key ="stampanteRichiesteMtz" value="PDFCreator"/>
|
||||
<add key ="stampanteRichiesteMtz" value="\\pc-manutenzione\HP-manut"/>
|
||||
</appSettings>
|
||||
@@ -1,101 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
|
||||
public partial class mod_famiglieMacchine : System.Web.UI.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
mod_elFamMacch1.eh_selezioneValore += new EventHandler(mod_elFamMacch1_eh_selezioneValore);
|
||||
mod_elFamMacch1.eh_resetSelezione += new EventHandler(mod_elFamMacch1_eh_resetSelezione);
|
||||
mod_elMacch2Fam1.eh_delValore += new EventHandler(mod_elMacch2Fam1_eh_delValore);
|
||||
traduciObj();
|
||||
}
|
||||
|
||||
private void traduciObj()
|
||||
{
|
||||
btnShowAdd.Text = traduci("showAddMacchine");
|
||||
btnAddMacchine.Text = traduci("AddMacchine2Fam");
|
||||
lblMacchineInteressate.Text = traduci("lblMacchineInteressate");
|
||||
}
|
||||
/// <summary>
|
||||
/// wrapper traduzione
|
||||
/// </summary>
|
||||
/// <param name="lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduci(object lemma)
|
||||
{
|
||||
return user_std.UtSn.Traduci(lemma.ToString());
|
||||
}
|
||||
void mod_elMacch2Fam1_eh_delValore(object sender, EventArgs e)
|
||||
{
|
||||
mod_elFamMacch1.doUpdate();
|
||||
}
|
||||
|
||||
void mod_elFamMacch1_eh_resetSelezione(object sender, EventArgs e)
|
||||
{
|
||||
mod_elMacch2Fam1.Visible = false;
|
||||
}
|
||||
|
||||
void mod_elFamMacch1_eh_selezioneValore(object sender, EventArgs e)
|
||||
{
|
||||
mod_elMacch2Fam1.idxFamMacchSel = mod_elFamMacch1.idxFamMacc_sel;
|
||||
mod_elMacch2Fam1.Visible = true;
|
||||
}
|
||||
protected void btnAddMacchine_Click(object sender, EventArgs e)
|
||||
{
|
||||
// controllo se si possa salvare
|
||||
if ((mod_elFamMacch1.idxFamMacc_sel != -1) && (listMacchine.SelectedIndex != -1))
|
||||
{
|
||||
lblWarning.Visible = false;
|
||||
// ciclo ed inserisco le macchine selezionate
|
||||
foreach (ListItem riga in listMacchine.Items)
|
||||
{
|
||||
// se è selezionata creo riga anche x lei...
|
||||
if (riga.Selected)
|
||||
{
|
||||
associaMacchinaFamiglia(Convert.ToInt32(riga.Value), mod_elFamMacch1.idxFamMacc_sel);
|
||||
}
|
||||
}
|
||||
mod_elMacch2Fam1.doUpdate();
|
||||
}
|
||||
else
|
||||
{
|
||||
lblWarning.Visible = true;
|
||||
lblWarning.Text = traduci("pregoSelMacchFamMacch");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// associa la macchina indicata alla famiglia
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <param name="idxFamMacc"></param>
|
||||
private bool associaMacchinaFamiglia(int idxMacchina, int idxFamMacc)
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
TA_app.obj.taMacc2Fam.InsertQuery(idxMacchina, idxFamMacc);
|
||||
answ = true;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
protected void btnShowAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
pnlSceltaMacchine.Visible = !pnlSceltaMacchine.Visible;
|
||||
if (pnlSceltaMacchine.Visible)
|
||||
{
|
||||
btnShowAdd.Text = user_std.UtSn.Traduci("hideAddMacchine");
|
||||
}
|
||||
else
|
||||
{
|
||||
btnShowAdd.Text = user_std.UtSn.Traduci("showAddMacchine");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_gestCausali.ascx.cs"
|
||||
Inherits="mod_gestCausali" %>
|
||||
<%@ Register Src="mod_filtro.ascx" TagName="mod_filtro" TagPrefix="uc1" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
|
||||
<uc1:mod_filtro ID="mod_filtroFam" runat="server" css="txtMini" changeCheckEnabled="false"
|
||||
changeCheckVisible="false" />
|
||||
<asp:ObjectDataSource ID="odsFam" runat="server" OldValuesParameterFormatString="Original_{0}"
|
||||
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selFamTableAdapter">
|
||||
</asp:ObjectDataSource>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
|
||||
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
|
||||
DataKeyNames="idxCausale" DataSourceID="ods" OnDataBound="grView_DataBound">
|
||||
<RowStyle CssClass="ctrRowStyle" />
|
||||
@@ -46,7 +46,8 @@
|
||||
ReadOnly="True" />
|
||||
<asp:TemplateField HeaderText="descrCausale" SortExpression="descrCausale">
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtdescrCausale" runat="server" Text='<%# Bind("descrCausale") %>' Width="30em" />
|
||||
<asp:TextBox ID="txtdescrCausale" runat="server" Text='<%# Bind("descrCausale") %>'
|
||||
Width="30em" />
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbldescrCausale" runat="server" Text='<%# Eval("descrCausale") %>' />
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
Inherits="mod_macchine" %>
|
||||
<%@ Register Src="mod_selettore_ajax.ascx" TagName="mod_selettore_ajax" TagPrefix="uc1" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
|
||||
<%@ Register Src="mod_filtro.ascx" TagName="mod_filtro" TagPrefix="uc2" %>
|
||||
<uc2:mod_filtro ID="mod_filtroImpianti" runat="server" css="txtMini" changeCheckEnabled="true" />
|
||||
<asp:ObjectDataSource ID="odsImpianti" runat="server" OldValuesParameterFormatString="Original_{0}"
|
||||
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selImpiantiTableAdapter">
|
||||
</asp:ObjectDataSource>
|
||||
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
|
||||
Width="100%" OnSelectedIndexChanged="grView_SelectedIndexChanged" OnDataBound="grView_DataBound"
|
||||
DataKeyNames="idxMacchina" DataSourceID="ods" OnRowDataBound="grView_RowDataBound"
|
||||
@@ -26,8 +31,6 @@
|
||||
Visible="false" />
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<%--<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select" ToolTip='<%# traduci("Select") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.seleziona, SteamWare.dimImg.small) %>' />
|
||||
--%>
|
||||
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit"
|
||||
ToolTip='<%# traduci("Edit") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.modifica, SteamWare.dimImg.small) %>' />
|
||||
</ItemTemplate>
|
||||
|
||||
@@ -331,6 +331,11 @@ public partial class mod_macchine : ApplicationUserControl
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit(e);
|
||||
mod_filtroImpianti.eh_selValore += new EventHandler(mod_filtroImpianti_eh_selValore);
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
mod_filtroImpianti.ods = odsImpianti;
|
||||
}
|
||||
_idxGridView = "idxmacchina";
|
||||
// determino quale grView a seconda del tipo visibilità colonne...
|
||||
if (_dispLessCol)
|
||||
@@ -345,16 +350,41 @@ public partial class mod_macchine : ApplicationUserControl
|
||||
}
|
||||
updateOdsDaFiltro();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// aggiorna visualizzazioni varie
|
||||
/// </summary>
|
||||
private void aggiornaAll()
|
||||
{
|
||||
// imposto visibilità filtro in base a tipo controllo
|
||||
if (vistaModulo == tipoVistaMod.selezione)
|
||||
{
|
||||
mod_filtroImpianti.Visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
mod_filtroImpianti.Visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
void mod_filtroImpianti_eh_selValore(object sender, EventArgs e)
|
||||
{
|
||||
if (mod_filtroImpianti.valoreInt != 0)
|
||||
{
|
||||
// salvo il valore selezionato...
|
||||
idxImpiantoSel = mod_filtroImpianti.valoreInt;
|
||||
}
|
||||
doUpdate();
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica e sistema il filtro dell'ods...
|
||||
/// </summary>
|
||||
private void updateOdsDaFiltro()
|
||||
{
|
||||
string filterExpr = " (codMacchina LIKE '%{0}%' OR nomeMacchina LIKE '%{0}%' OR modello LIKE '%{0}%' OR matricola LIKE '%{0}%' OR descrImpianto LIKE '%{0}%') ";
|
||||
if (vistaModulo == tipoVistaMod.selezione)
|
||||
if (vistaModulo == tipoVistaMod.selezione || (mod_filtroImpianti.Visible && mod_filtroImpianti.valore != "*"))
|
||||
{
|
||||
filterExpr += " AND idxImpianto = {1} ";
|
||||
|
||||
}
|
||||
ods.FilterExpression = filterExpr;
|
||||
}
|
||||
@@ -475,8 +505,10 @@ public partial class mod_macchine : ApplicationUserControl
|
||||
set
|
||||
{
|
||||
lblImpianto.Text = value.ToString();
|
||||
aggiornaAll();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// definisce se mostrare meno colonne (per funzione MOVE delle macchine tra diversi impianti)
|
||||
/// </summary>
|
||||
@@ -502,7 +534,7 @@ public partial class mod_macchine : ApplicationUserControl
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// restituisce idx della amcchina selezionata nel grVIew versione "short"
|
||||
/// restituisce idx della macchina selezionata nel grVIew versione "short"
|
||||
/// </summary>
|
||||
public int idxMacchinaSel
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user