Files
WebSCR/WebSCR/WebUserControls/mod_dettInt.ascx.cs
T
2015-05-12 17:19:45 +02:00

132 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 WebSCR_data;
namespace WebSCR.WebUserControls
{
public partial class mod_dettInt : System.Web.UI.UserControl
{
public event EventHandler eh_update;
/// <summary>
/// solleva evento selezione data
/// </summary>
protected void reportEvent()
{
// evento!
if (eh_update != null)
{
eh_update(this, new EventArgs());
}
}
/// <summary>
/// disabilita modalità EDIT record...
/// </summary>
public bool disableEdit { get; set; }
/// <summary>
/// determina se sia visibile...
/// </summary>
public string isVisible
{
get
{
string answ = "visible";
if (disableEdit)
{
answ = "hidden";
}
return answ;
}
}
/// <summary>
/// determina altezza visibile
/// </summary>
public string visHeight
{
get
{
string answ = "1em";
if (disableEdit)
{
answ = "0px";
}
return answ;
}
}
/// <summary>
/// impegno corrente
/// </summary>
public int idxImpegno
{
get
{
int answ = 0;
try
{
answ = Convert.ToInt32(qsVal("IdxImpegno"));
}
catch
{ }
return answ;
}
}
/// <summary>
/// recupera valore querystring
/// </summary>
/// <param name="nome"></param>
/// <returns></returns>
protected string qsVal(string nome)
{
string answ = "";
try
{
answ = Request.QueryString[nome].ToString();
}
catch
{ }
return answ;
}
protected void Page_Load(object sender, EventArgs e)
{
}
/// <summary>
/// aggiunge il task corrente all'elenco dei task...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbAdd_Click(object sender, EventArgs e)
{
DtProxy.man.taDetImp.insertQuery(idxImpegno, ddlTipoCons.SelectedValue);
//doUpdate();
reportEvent();
}
protected void odsDettInt_Deleted(object sender, ObjectDataSourceStatusEventArgs e)
{
//doUpdate();
reportEvent();
}
protected void odsDettInt_Updated(object sender, ObjectDataSourceStatusEventArgs e)
{
//doUpdate();
reportEvent();
}
public void doUpdate()
{
grViewDettInt.DataBind();
}
protected void odsDettInt_Updating(object sender, ObjectDataSourceMethodEventArgs e)
{
#if false
// recupero valori consegna e note...
e.InputParameters["CodConsegna"] = ((DropDownList)grViewDettInt.Rows[grViewDettInt.EditIndex].FindControl("ddlTipoCons")).SelectedValue;
e.InputParameters["Note"] = ((TextBox)grViewDettInt.Rows[grViewDettInt.EditIndex].FindControl("txtNote")).Text;
#endif
}
}
}