107 lines
3.5 KiB
C#
107 lines
3.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using ETS_Data;
|
|
|
|
namespace ETS_WS.WebUserControls
|
|
{
|
|
public partial class mod_anagFasi : System.Web.UI.UserControl
|
|
{
|
|
/// <summary>
|
|
/// caricamento
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
/// <summary>
|
|
/// reset della selezione
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnReset_Click(object sender, EventArgs e)
|
|
{
|
|
resetSelezione();
|
|
}
|
|
/// <summary>
|
|
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
|
/// </summary>
|
|
public void resetSelezione()
|
|
{
|
|
grView.SelectedIndex = -1;
|
|
grView.DataBind();
|
|
}
|
|
/// <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();
|
|
}
|
|
/// <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;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// determina se sia eliminabile il record (=non usato)
|
|
/// </summary>
|
|
/// <param name="idxMaker"></param>
|
|
/// <returns></returns>
|
|
public bool delEnabled(object idxObj)
|
|
{
|
|
bool answ = true;
|
|
return answ;
|
|
}
|
|
/// <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)
|
|
{
|
|
// leggo i valori!
|
|
e.InputParameters["codFase"] = ((TextBox)grView.FooterRow.FindControl("txtCodFase")).Text.Substring(0, 2);
|
|
e.InputParameters["descrizione"] = ((TextBox)grView.FooterRow.FindControl("txtDescrizione")).Text;
|
|
e.InputParameters["folderName"] = ((TextBox)grView.FooterRow.FindControl("txtFolderName")).Text;
|
|
}
|
|
|
|
/// <summary>
|
|
/// refresh post edit
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void ods_Updated(object sender, ObjectDataSourceStatusEventArgs e)
|
|
{
|
|
grView.DataBind();
|
|
}
|
|
/// <summary>
|
|
/// refresh post delete
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void ods_Deleted(object sender, ObjectDataSourceStatusEventArgs e)
|
|
{
|
|
grView.DataBind();
|
|
}
|
|
}
|
|
} |