100 lines
3.4 KiB
C#
100 lines
3.4 KiB
C#
using SteamWare;
|
|
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_consegne : System.Web.UI.UserControl
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if(!Page.IsPostBack)
|
|
{
|
|
reloadSessionByCookie();
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// rilegge (eventualmente90 dati ins essione da cookie se non presenti
|
|
/// </summary>
|
|
private static void reloadSessionByCookie()
|
|
{
|
|
// se valore in session è nullo PROVO a leggerlo da cookie...
|
|
if (!memLayer.ML.isInSessionObject("DataRif"))
|
|
{
|
|
try
|
|
{
|
|
DateTime adesso = Convert.ToDateTime(memLayer.ML.getCookieVal("DataRif"));
|
|
memLayer.ML.setSessionVal("DataRif", adesso.ToString("yyyy-MM-dd"), true);
|
|
}
|
|
catch
|
|
{ }
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// verifica se valore passato è NON NULLO
|
|
/// </summary>
|
|
/// <param name="dataInizio"></param>
|
|
/// <returns></returns>
|
|
public bool notNull(object dataInizio)
|
|
{
|
|
bool answ = false;
|
|
try
|
|
{
|
|
answ = dataInizio.ToString() != "";
|
|
}
|
|
catch
|
|
{ }
|
|
return answ;
|
|
}
|
|
protected void grView_RowCommand(object sender, GridViewCommandEventArgs e)
|
|
{
|
|
// salvo il command argument...
|
|
lastCmd = e.CommandArgument.ToString();
|
|
}
|
|
/// <summary>
|
|
/// ultimo comando letto da link button
|
|
/// </summary>
|
|
public string lastCmd { get; set; }
|
|
/// <summary>
|
|
/// evento selezione paziente...
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
// recupero dati paziente...
|
|
int IdxImpegno = 0;
|
|
DS_Applicazione.ImpegniRow riga;// = DtProxy.man.taImp.GetData()[0];
|
|
try
|
|
{
|
|
IdxImpegno = Convert.ToInt32(grView.SelectedDataKey["IdxImpegno"]);
|
|
memLayer.ML.setSessionVal("IdxImpegno", IdxImpegno);
|
|
riga = DtProxy.man.taImp.getByKey(IdxImpegno)[0];
|
|
memLayer.ML.setSessionVal("Cliente", string.Format("{0}", riga.RagSoc));
|
|
memLayer.ML.setSessionVal("CodCliente", riga.CodCliente);
|
|
}
|
|
catch (Exception exc)
|
|
{
|
|
logger.lg.scriviLog(string.Format("Errore in rimando clienti --> interventi: {0}{1}", Environment.NewLine, exc));
|
|
riga = DtProxy.man.taImp.GetData()[0];
|
|
}
|
|
// ricarico!
|
|
Response.Redirect(string.Format("{0}?CodCliente={1}&Indir={2}&Data={3:yyyy-MM-dd}&IdxImpegno={4}", devicesAuthProxy.pagCorrente, riga.CodCliente, riga.Indir, riga.DataOra, IdxImpegno));
|
|
}
|
|
/// <summary>
|
|
/// forza update
|
|
/// </summary>
|
|
public void doUpdate()
|
|
{
|
|
DateTime adesso = Convert.ToDateTime(memLayer.ML.getCookieVal("DataRif"));
|
|
grView.DataBind();
|
|
}
|
|
}
|
|
} |