112 lines
3.6 KiB
C#
112 lines
3.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using SteamWare;
|
|
using WebSCR_data;
|
|
|
|
namespace WebSCR.WebUserControls
|
|
{
|
|
public partial class mod_elencoClienti : System.Web.UI.UserControl
|
|
{
|
|
public event EventHandler eh_selCliente;
|
|
/// <summary>
|
|
/// solleva evento selezione data
|
|
/// </summary>
|
|
protected void reportEvent()
|
|
{
|
|
// evento!
|
|
if (eh_selCliente != null)
|
|
{
|
|
eh_selCliente(this, new EventArgs());
|
|
}
|
|
}
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
memLayer.ML.emptySessionVal("Cliente");
|
|
hlLocalUploader.NavigateUrl = memLayer.ML.confReadString("localUplURL");
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// ultimo comando letto da link button
|
|
/// </summary>
|
|
public string lastCmd { get; set; }
|
|
/// <summary>
|
|
/// gestione evento novo record
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnNew_Click(object sender, EventArgs e)
|
|
{
|
|
// richiamo pagina di edit senza parametri x metodo NEW
|
|
Response.Redirect("ClientiEdit");
|
|
}
|
|
/// <summary>
|
|
/// evento selezione paziente...
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
// recupero dati paziente...
|
|
string CodCliente = "";
|
|
try
|
|
{
|
|
CodCliente = grView.SelectedDataKey["CodCliente"].ToString();
|
|
memLayer.ML.setSessionVal("CodCliente", CodCliente);
|
|
DS_Applicazione.AnagClientiRow riga = DtProxy.man.taAC.getByKey(CodCliente)[0];
|
|
memLayer.ML.setSessionVal("Cliente", string.Format("{0}", riga.RagSoc));
|
|
|
|
}
|
|
catch (Exception exc)
|
|
{
|
|
logger.lg.scriviLog(string.Format("Errore in rimando clienti --> interventi: {0}{1}", Environment.NewLine, exc));
|
|
}
|
|
reportEvent();
|
|
#if false
|
|
if (lastCmd == "add")
|
|
{
|
|
// mando a AGGIUNTA intervento cliente!
|
|
Response.Redirect(string.Format("Pianificazione?CodCliente={0}", grView.SelectedDataKey["CodCliente"]));
|
|
}
|
|
else
|
|
{
|
|
// mando a dettaglio con filtro x cliente!
|
|
Response.Redirect(string.Format("Interventi?FiltroCliente=1&ShowState=0&CodCliente={0}", grView.SelectedDataKey["CodCliente"]));
|
|
}
|
|
|
|
#endif
|
|
}
|
|
|
|
protected void grView_RowCommand(object sender, GridViewCommandEventArgs e)
|
|
{
|
|
// salvo il command argument...
|
|
lastCmd = e.CommandArgument.ToString();
|
|
}
|
|
/// <summary>
|
|
/// trimma una stringa alla lunghezza richiesta...
|
|
/// </summary>
|
|
/// <param name="stringa"></param>
|
|
/// <param name="maxChar"></param>
|
|
/// <returns></returns>
|
|
public string stringTrim(object _stringa, object _maxChar)
|
|
{
|
|
string answ = "";
|
|
try
|
|
{
|
|
answ = _stringa.ToString();
|
|
if (answ.Length > Convert.ToInt32(_maxChar))
|
|
{
|
|
answ = answ.Substring(0, Convert.ToInt32(_maxChar)) + "[...]";
|
|
}
|
|
}
|
|
catch
|
|
{ }
|
|
return answ;
|
|
}
|
|
}
|
|
} |