fix navigazione tra dett commesse e fasi...

This commit is contained in:
Samuele Locatelli
2013-07-25 08:38:43 +02:00
parent 3b575ced6a
commit 79c81c5279
7 changed files with 44 additions and 5 deletions
+26
View File
@@ -4,6 +4,7 @@ using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ETS_Data;
namespace PROJ_ETS
{
@@ -11,7 +12,32 @@ namespace PROJ_ETS
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
updateFaseComm();
}
mod_filtroComm1.eh_nuovoValore += mod_filtroComm1_eh_nuovoValore;
}
void mod_filtroComm1_eh_nuovoValore(object sender, EventArgs e)
{
updateFaseComm();
}
/// <summary>
/// ricalcola fase commessa
/// </summary>
private void updateFaseComm()
{
#if false
idxFaseComm = DataProxy_ProjEts.DP.taAF.getByIdx(idxFase)[0].idxFaseAncest;
// se diventa "0" uso fase direttamente..
if (idxFaseComm == 0)
{
idxFaseComm = idxFase;
}
#endif
// aggiorno visualizzazione
mod_fasi1.doUpdate();
}
}
}
@@ -582,7 +582,8 @@ namespace PROJ_ETS.WebUserControls
protected void grView_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
// salvo progetto sel
utils.obj.setSessionVal("idxFase_sel", e.Keys["idxFase"]);
int idxFase = Convert.ToInt32(e.Keys["idxFase"]);
utils.obj.setSessionVal("idxFase_sel", idxFase);
// quale comando?
string _comando = "";
if (utils.obj.isInSessionObject("nextObjCommand"))
@@ -612,9 +613,10 @@ namespace PROJ_ETS.WebUserControls
{ }
utils.obj.setSessionVal("idxCli_sel", idxCli);
utils.obj.setSessionVal("nomeCli_sel", nomeCli);
Response.Redirect("DatiCommessa");
// blocco update!
e.Cancel = true;
// redirect
Response.Redirect("DatiCommessa");
break;
case "dettFasi":
// salvo idxCli...
@@ -633,6 +635,9 @@ namespace PROJ_ETS.WebUserControls
{ }
utils.obj.setSessionVal("idxCli_sel", idxCli);
utils.obj.setSessionVal("nomeCli_sel", nomeCli);
// devo salvare fase ancestor!!!
int idxFaseAncest = DataProxy_ProjEts.DP.taAF.getByIdx(idxFase)[0].idxFaseAncest;
utils.obj.setSessionVal("idxFase_sel", idxFaseAncest);
// blocco update!
e.Cancel = true;
// redirect
@@ -618,10 +618,8 @@ namespace PROJ_ETS.WebUserControls
// salvo fase e proj sel
int idxFase = Convert.ToInt32(e.Keys["idxFase"]);
int idxProj = DataProxy_ProjEts.DP.taAF.getByIdx(idxFase)[0].idxProgetto;
int idxFaseAncest = DataProxy_ProjEts.DP.taAF.getByIdx(idxFase)[0].idxFaseAncest;
utils.obj.setSessionVal("idxProgetto_sel", idxProj);
utils.obj.setSessionVal("idxFase_sel", idxFase);
utils.obj.setSessionVal("idxFaseAncest_sel", idxFaseAncest);
// quale comando?
string _comando = "";
if (utils.obj.isInSessionObject("nextObjCommand"))
@@ -673,6 +671,9 @@ namespace PROJ_ETS.WebUserControls
{ }
utils.obj.setSessionVal("idxCli_sel", idxCli);
utils.obj.setSessionVal("nomeCli_sel", nomeCli);
// devo salvare fase ancestor!!!
int idxFaseAncest = DataProxy_ProjEts.DP.taAF.getByIdx(idxFase)[0].idxFaseAncest;
utils.obj.setSessionVal("idxFase_sel", idxFaseAncest);
// blocco update!
e.Cancel = true;
// redirect
@@ -25,7 +25,7 @@
</asp:GridView>
<asp:ObjectDataSource ID="odsFasi" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByIdxFaseComm" TypeName="ETS_Data.Ds_ProjEtsTableAdapters.ElencoFasiExplTableAdapter">
<SelectParameters>
<asp:SessionParameter DefaultValue="-1" Name="idxFaseAncestor" SessionField="idxFaseAncest_sel" Type="Int32" />
<asp:SessionParameter DefaultValue="-1" Name="idxFaseAncestor" SessionField="idxFase_sel" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
@@ -12,5 +12,12 @@ namespace PROJ_ETS.WebUserControls
protected void Page_Load(object sender, EventArgs e)
{
}
/// <summary>
/// effettua update controllo
/// </summary>
public void doUpdate()
{
grViewFasi.DataBind();
}
}
}
Binary file not shown.
Binary file not shown.