pulizia codice da #IF FALSE vari...
This commit is contained in:
+5
-10
@@ -2,16 +2,11 @@
|
||||
|
||||
namespace MP_IO
|
||||
{
|
||||
public partial class Alive : System.Web.UI.Page
|
||||
public partial class Alive : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
Response.Redirect("IOB");
|
||||
#if false
|
||||
Response.Clear();
|
||||
Response.Write("OK");
|
||||
Context.Response.End();
|
||||
#endif
|
||||
}
|
||||
Response.Redirect("IOB");
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
-40
@@ -2,46 +2,16 @@
|
||||
|
||||
namespace MP_IO
|
||||
{
|
||||
public partial class inputIOB : System.Web.UI.Page
|
||||
public partial class inputIOB : System.Web.UI.Page
|
||||
{
|
||||
/// <summary>
|
||||
/// caricamento pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
/// <summary>
|
||||
/// caricamento pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
Response.Redirect(string.Format("IOB/input/{0}?valore={1}&dtEve={2}&dtCurr={3}&cnt={4}", Request.QueryString["idxMacchina"], Request.QueryString["valore"], Request.QueryString["dtEve"], Request.QueryString["dtCurr"], Request.QueryString["cnt"]));
|
||||
#if false
|
||||
// legge i get x processare la seriale
|
||||
string idxMacchina = "";
|
||||
string valore = "";
|
||||
string dtEve = "";
|
||||
string dtCurr = "";
|
||||
string contatore = "";
|
||||
string answ = "";
|
||||
DateTime dataOraEvento = DateTime.Now;
|
||||
try
|
||||
{
|
||||
idxMacchina = Request.QueryString["idxMacchina"];
|
||||
valore = Request.QueryString["valore"];
|
||||
dtEve = Request.QueryString["dtEve"]; // formato yyyymmddHHMMSSnnn ovvero da anno a millisecondi
|
||||
dtCurr = Request.QueryString["dtCurr"]; // formato yyyymmddHHMMSSnnn ovvero da anno a millisecondi
|
||||
contatore = Request.QueryString["cnt"];
|
||||
if (contatore == "" || contatore == null) contatore = "0";
|
||||
if (memLayer.ML.CRI("_logLevel") > 6)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Valori letti:{0}idxMacchina: {1}{0}valore: {2}{0}dtEve: {3}{0}dtCurr: {4}{0}cnt: {5}", Environment.NewLine, idxMacchina, valore, dtEve, dtCurr, contatore), tipoLog.INFO);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
answ = DataLayer.processInput(idxMacchina, valore, dtEve, dtCurr, contatore);
|
||||
// ripulisco pagina restituita e tolgo html (solo codice ok/NO)
|
||||
Response.Clear();
|
||||
Response.Write(answ);
|
||||
Context.Response.End();
|
||||
#endif
|
||||
}
|
||||
Response.Redirect(string.Format("IOB/input/{0}?valore={1}&dtEve={2}&dtCurr={3}&cnt={4}", Request.QueryString["idxMacchina"], Request.QueryString["valore"], Request.QueryString["dtEve"], Request.QueryString["dtCurr"], Request.QueryString["cnt"]));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,71 +3,60 @@
|
||||
|
||||
<div class="row statusMap">
|
||||
|
||||
@foreach (var item in Model)
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
// fix codice semaforo: sVe --> Ve, sRo -->Ro...
|
||||
string codSemaf = item.Semaforo;
|
||||
if (codSemaf.Length == 3)
|
||||
{
|
||||
// fix codice semaforo: sVe --> Ve, sRo -->Ro...
|
||||
string codSemaf = item.Semaforo;
|
||||
if (codSemaf.Length == 3)
|
||||
{
|
||||
codSemaf = codSemaf.Substring(1, 2);
|
||||
}
|
||||
string cssStatus = ViewBag.baseCss + codSemaf;
|
||||
#if false
|
||||
// calcolo durata...
|
||||
TimeSpan durata = TimeSpan.FromMinutes((double)item.durata);
|
||||
// converto a stringa!
|
||||
string durataForm = durata.ToString(@"hh\:mm");
|
||||
// se dura è+ di 1 gg aggiungo...
|
||||
if (durata.TotalDays >= 1)
|
||||
{
|
||||
durataForm = durata.ToString(@"dd") + "gg " + durataForm;
|
||||
}
|
||||
#endif
|
||||
// calcolo durata...
|
||||
TimeSpan TC = TimeSpan.FromMinutes((double)item.TCAssegnato);
|
||||
// converto a stringa!
|
||||
string TCAssegnato = TC.ToString(@"mm\:ss");
|
||||
|
||||
|
||||
// verifico SE è disabilitata modalità animazione --> blink a stati (e refresh 1s)
|
||||
if (System.Web.Configuration.WebConfigurationManager.AppSettings["doAnimate"] == "0")
|
||||
{
|
||||
// blink se secondo pari...
|
||||
DateTime adesso = DateTime.Now;
|
||||
int resto = 0;
|
||||
Math.DivRem(adesso.Second, 2, out resto);
|
||||
if (resto == 0)
|
||||
{
|
||||
cssStatus += "_b";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
<div class="col-xs-4 col-sm-4 col-md-3 col-lg-2" style="padding: 2px;">
|
||||
<div class="@cssStatus" style="padding: 1px;">
|
||||
@*noCpu*@
|
||||
<div class="row" style="margin-bottom: 0.5em;">
|
||||
<div class="col-xs-12"><div class="ui-title">@Html.DisplayFor(modelItem => item.CodMacchina)</div></div>
|
||||
</div>
|
||||
<div class="row" style="padding: 0.4em 0.2em;">
|
||||
<div class="col-xs-4 padZR">articolo:</div>
|
||||
<div class="col-xs-8 padZL text-right">@Html.DisplayFor(modelItem => item.CodArticolo)</div>
|
||||
<div class="col-xs-12"><b>@Html.DisplayFor(modelItem => item.DescrizioneStato)</b></div>
|
||||
<div class="col-xs-6 padZR">tempo ciclo:</div>
|
||||
<div class="col-xs-6 padZL text-right">@TCAssegnato</div>
|
||||
|
||||
@*<div class="col-xs-6 padZR">ODL: @Html.DisplayFor(modelItem => item.idxODL)</div>
|
||||
<div class="col-xs-6 padZL text-right">art: @Html.DisplayFor(modelItem => item.CodArticolo)</div>
|
||||
<div class="col-xs-12"><b>@Html.DisplayFor(modelItem => item.DescrizioneStato)</b></div>
|
||||
<div class="col-xs-4 padZR">durata:</div>
|
||||
<div class="col-xs-8 padZL text-right">@durataForm</div>
|
||||
<div class="col-xs-6 padZR">prod: @Html.DisplayFor(modelItem => item.PezziProd)</div>
|
||||
<div class="col-xs-6 padZL text-right">lotto: @Html.DisplayFor(modelItem => item.NumPezzi)</div>*@
|
||||
</div>
|
||||
<div class="row fontSmall" style="margin-top: 0.5em;">
|
||||
<div class="col-xs-12"><div class="text-right ui-footer">last update: @Html.DisplayFor(modelItem => item.lastUpdate)</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
codSemaf = codSemaf.Substring(1, 2);
|
||||
}
|
||||
string cssStatus = ViewBag.baseCss + codSemaf;
|
||||
// calcolo durata...
|
||||
TimeSpan TC = TimeSpan.FromMinutes((double)item.TCAssegnato);
|
||||
// converto a stringa!
|
||||
string TCAssegnato = TC.ToString(@"mm\:ss");
|
||||
|
||||
|
||||
// verifico SE è disabilitata modalità animazione --> blink a stati (e refresh 1s)
|
||||
if (System.Web.Configuration.WebConfigurationManager.AppSettings["doAnimate"] == "0")
|
||||
{
|
||||
// blink se secondo pari...
|
||||
DateTime adesso = DateTime.Now;
|
||||
int resto = 0;
|
||||
Math.DivRem(adesso.Second, 2, out resto);
|
||||
if (resto == 0)
|
||||
{
|
||||
cssStatus += "_b";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
<div class="col-xs-4 col-sm-4 col-md-3 col-lg-2" style="padding: 2px;">
|
||||
<div class="@cssStatus" style="padding: 1px;">
|
||||
@*noCpu*@
|
||||
<div class="row" style="margin-bottom: 0.5em;">
|
||||
<div class="col-xs-12"><div class="ui-title">@Html.DisplayFor(modelItem => item.CodMacchina)</div></div>
|
||||
</div>
|
||||
<div class="row" style="padding: 0.4em 0.2em;">
|
||||
<div class="col-xs-4 padZR">articolo:</div>
|
||||
<div class="col-xs-8 padZL text-right">@Html.DisplayFor(modelItem => item.CodArticolo)</div>
|
||||
<div class="col-xs-12"><b>@Html.DisplayFor(modelItem => item.DescrizioneStato)</b></div>
|
||||
<div class="col-xs-6 padZR">tempo ciclo:</div>
|
||||
<div class="col-xs-6 padZL text-right">@TCAssegnato</div>
|
||||
|
||||
@*<div class="col-xs-6 padZR">ODL: @Html.DisplayFor(modelItem => item.idxODL)</div>
|
||||
<div class="col-xs-6 padZL text-right">art: @Html.DisplayFor(modelItem => item.CodArticolo)</div>
|
||||
<div class="col-xs-12"><b>@Html.DisplayFor(modelItem => item.DescrizioneStato)</b></div>
|
||||
<div class="col-xs-4 padZR">durata:</div>
|
||||
<div class="col-xs-8 padZL text-right">@durataForm</div>
|
||||
<div class="col-xs-6 padZR">prod: @Html.DisplayFor(modelItem => item.PezziProd)</div>
|
||||
<div class="col-xs-6 padZL text-right">lotto: @Html.DisplayFor(modelItem => item.NumPezzi)</div>*@
|
||||
</div>
|
||||
<div class="row fontSmall" style="margin-top: 0.5em;">
|
||||
<div class="col-xs-12"><div class="text-right ui-footer">last update: @Html.DisplayFor(modelItem => item.lastUpdate)</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
+205
-209
@@ -5,217 +5,213 @@ using System.Web.UI.WebControls;
|
||||
|
||||
namespace MoonPro
|
||||
{
|
||||
public partial class AnalisiProduzione : System.Web.UI.Page
|
||||
public partial class AnalisiProduzione : System.Web.UI.Page
|
||||
{
|
||||
protected resoconti _resoconti;
|
||||
protected intervalloDate _intervalloAnalisi;
|
||||
protected intervalloDate intervalloAnalisi
|
||||
{
|
||||
protected resoconti _resoconti;
|
||||
protected intervalloDate _intervalloAnalisi;
|
||||
protected intervalloDate intervalloAnalisi
|
||||
get
|
||||
{
|
||||
return _intervalloAnalisi;
|
||||
}
|
||||
set
|
||||
{
|
||||
// controllo che la data di fine non sia posteriore ad adesso...
|
||||
if (value.fine > DateTime.Now)
|
||||
{
|
||||
get
|
||||
{
|
||||
return _intervalloAnalisi;
|
||||
}
|
||||
set
|
||||
{
|
||||
// controllo che la data di fine non sia posteriore ad adesso...
|
||||
if (value.fine > DateTime.Now)
|
||||
{
|
||||
value.fine = DateTime.Now;
|
||||
}
|
||||
_intervalloAnalisi = value;
|
||||
}
|
||||
}
|
||||
protected int durataMin;
|
||||
/// <summary>
|
||||
/// elenco idx COMMA separated da controllo selezione multiplo
|
||||
/// </summary>
|
||||
protected string idxMulti
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
foreach (ListItem riga in listMacchine.Items)
|
||||
{
|
||||
// se è selezionata creo riga anche x lei...
|
||||
if (riga.Selected)
|
||||
{
|
||||
answ += string.Format(",{0}", riga.Value);
|
||||
}
|
||||
}
|
||||
answ = answ.Substring(1, answ.Length - 1);
|
||||
}
|
||||
catch
|
||||
{
|
||||
answ = "";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua traduzione del lemma
|
||||
/// </summary>
|
||||
/// <param name="lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduci(string lemma)
|
||||
{
|
||||
return user_std.UtSn.Traduci(lemma);
|
||||
}
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
_resoconti = new resoconti();
|
||||
durataMin = (int)Session["_durataMin"];
|
||||
mod_periodoAnalisi.eh_doUpdate += new EventHandler(Mod_periodoAnalisi1_eh_doUpdate);
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
showDetails(false);
|
||||
ridisegnaChk();
|
||||
ridisegna();
|
||||
}
|
||||
mod_AnPro_Totali.eh_selVal += Mod_AnPro_Totali_eh_selVal;
|
||||
mod_AnPro_Totali.eh_reset += Mod_AnPro_Totali_eh_reset;
|
||||
}
|
||||
/// <summary>
|
||||
/// richiesta reset: nascondo!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Mod_AnPro_Totali_eh_reset(object sender, EventArgs e)
|
||||
{
|
||||
#if false
|
||||
// nascondo moduli
|
||||
showDetails(false);
|
||||
#endif
|
||||
fixVisDet();
|
||||
}
|
||||
|
||||
private void showDetails(bool showMod)
|
||||
{
|
||||
mod_AnPro_DettArt.Visible = showMod;
|
||||
mod_AnPro_DettGg.Visible = showMod;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// selezionato articolo e macchina --> dettaglio!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Mod_AnPro_Totali_eh_selVal(object sender, EventArgs e)
|
||||
{
|
||||
fixVisDet();
|
||||
}
|
||||
/// <summary>
|
||||
/// sistema visualizzazione dettagli---
|
||||
/// </summary>
|
||||
private void fixVisDet()
|
||||
{
|
||||
if (mod_AnPro_Totali.IdxMacchina != "" && mod_AnPro_Totali.CodArticolo != "")
|
||||
{
|
||||
// passo parametri selezione ai moduli
|
||||
mod_AnPro_DettArt.doUpdate(mod_AnPro_Totali.IdxMacchina, mod_AnPro_Totali.CodArticolo, chkOdlClosed.Checked, chkOdlOpen.Checked, chkOdlNew.Checked);
|
||||
mod_AnPro_DettGg.doUpdate(mod_AnPro_Totali.IdxMacchina, mod_AnPro_Totali.CodArticolo, chkOdlClosed.Checked, chkOdlOpen.Checked, chkOdlNew.Checked);
|
||||
// mostro 2 moduli dettaglio
|
||||
showDetails(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// nascondo moduli
|
||||
showDetails(false);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// valorizzazione iniziale filtro impianti
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void listMacchine_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
foreach (ListItem item in ((ListBox)sender).Items)
|
||||
{
|
||||
item.Selected = true;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// salvo elenco impianti selected
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void listMacchine_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
ridisegna();
|
||||
}
|
||||
void Mod_periodoAnalisi1_eh_doUpdate(object sender, EventArgs e)
|
||||
{
|
||||
ridisegna();
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// ridisegna buttons checkbox
|
||||
/// </summary>
|
||||
protected void ridisegnaChk()
|
||||
{
|
||||
// verifico cosa sia selezionato e cosa no...
|
||||
string baseCss = "btn btn-default";
|
||||
string selCss = "btn btn-info";
|
||||
if (chkOdlClosed.Checked)
|
||||
{
|
||||
chkOdlClosed.CssClass = "btn btn-danger";
|
||||
}
|
||||
else
|
||||
{
|
||||
chkOdlClosed.CssClass = baseCss;
|
||||
}
|
||||
if (chkOdlOpen.Checked)
|
||||
{
|
||||
chkOdlOpen.CssClass = selCss;
|
||||
}
|
||||
else
|
||||
{
|
||||
chkOdlOpen.CssClass = baseCss;
|
||||
}
|
||||
if (chkOdlNew.Checked)
|
||||
{
|
||||
chkOdlNew.CssClass = "btn btn-success";
|
||||
}
|
||||
else
|
||||
{
|
||||
chkOdlNew.CssClass = baseCss;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiorna dati x ridisegno
|
||||
/// </summary>
|
||||
private void ridisegna()
|
||||
{
|
||||
// update controlli child
|
||||
intervalloAnalisi = (intervalloDate)Session["_intervallo"];
|
||||
mod_AnPro_Totali.doUpdate(idxMulti, chkOdlClosed.Checked, chkOdlOpen.Checked, chkOdlNew.Checked);
|
||||
}
|
||||
|
||||
protected void chkOdlClosed_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
ridisegnaChk();
|
||||
ridisegna();
|
||||
}
|
||||
|
||||
protected void chkOdlOpen_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
ridisegnaChk();
|
||||
ridisegna();
|
||||
}
|
||||
|
||||
protected void chkOdlNew_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
ridisegnaChk();
|
||||
ridisegna();
|
||||
}
|
||||
|
||||
protected void btnUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
ridisegnaChk();
|
||||
ridisegna();
|
||||
value.fine = DateTime.Now;
|
||||
}
|
||||
_intervalloAnalisi = value;
|
||||
}
|
||||
}
|
||||
protected int durataMin;
|
||||
/// <summary>
|
||||
/// elenco idx COMMA separated da controllo selezione multiplo
|
||||
/// </summary>
|
||||
protected string idxMulti
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
foreach (ListItem riga in listMacchine.Items)
|
||||
{
|
||||
// se è selezionata creo riga anche x lei...
|
||||
if (riga.Selected)
|
||||
{
|
||||
answ += string.Format(",{0}", riga.Value);
|
||||
}
|
||||
}
|
||||
answ = answ.Substring(1, answ.Length - 1);
|
||||
}
|
||||
catch
|
||||
{
|
||||
answ = "";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua traduzione del lemma
|
||||
/// </summary>
|
||||
/// <param name="lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduci(string lemma)
|
||||
{
|
||||
return user_std.UtSn.Traduci(lemma);
|
||||
}
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
_resoconti = new resoconti();
|
||||
durataMin = (int)Session["_durataMin"];
|
||||
mod_periodoAnalisi.eh_doUpdate += new EventHandler(Mod_periodoAnalisi1_eh_doUpdate);
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
showDetails(false);
|
||||
ridisegnaChk();
|
||||
ridisegna();
|
||||
}
|
||||
mod_AnPro_Totali.eh_selVal += Mod_AnPro_Totali_eh_selVal;
|
||||
mod_AnPro_Totali.eh_reset += Mod_AnPro_Totali_eh_reset;
|
||||
}
|
||||
/// <summary>
|
||||
/// richiesta reset: nascondo!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Mod_AnPro_Totali_eh_reset(object sender, EventArgs e)
|
||||
{
|
||||
fixVisDet();
|
||||
}
|
||||
|
||||
private void showDetails(bool showMod)
|
||||
{
|
||||
mod_AnPro_DettArt.Visible = showMod;
|
||||
mod_AnPro_DettGg.Visible = showMod;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// selezionato articolo e macchina --> dettaglio!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Mod_AnPro_Totali_eh_selVal(object sender, EventArgs e)
|
||||
{
|
||||
fixVisDet();
|
||||
}
|
||||
/// <summary>
|
||||
/// sistema visualizzazione dettagli---
|
||||
/// </summary>
|
||||
private void fixVisDet()
|
||||
{
|
||||
if (mod_AnPro_Totali.IdxMacchina != "" && mod_AnPro_Totali.CodArticolo != "")
|
||||
{
|
||||
// passo parametri selezione ai moduli
|
||||
mod_AnPro_DettArt.doUpdate(mod_AnPro_Totali.IdxMacchina, mod_AnPro_Totali.CodArticolo, chkOdlClosed.Checked, chkOdlOpen.Checked, chkOdlNew.Checked);
|
||||
mod_AnPro_DettGg.doUpdate(mod_AnPro_Totali.IdxMacchina, mod_AnPro_Totali.CodArticolo, chkOdlClosed.Checked, chkOdlOpen.Checked, chkOdlNew.Checked);
|
||||
// mostro 2 moduli dettaglio
|
||||
showDetails(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// nascondo moduli
|
||||
showDetails(false);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// valorizzazione iniziale filtro impianti
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void listMacchine_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
foreach (ListItem item in ((ListBox)sender).Items)
|
||||
{
|
||||
item.Selected = true;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// salvo elenco impianti selected
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void listMacchine_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
ridisegna();
|
||||
}
|
||||
void Mod_periodoAnalisi1_eh_doUpdate(object sender, EventArgs e)
|
||||
{
|
||||
ridisegna();
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// ridisegna buttons checkbox
|
||||
/// </summary>
|
||||
protected void ridisegnaChk()
|
||||
{
|
||||
// verifico cosa sia selezionato e cosa no...
|
||||
string baseCss = "btn btn-default";
|
||||
string selCss = "btn btn-info";
|
||||
if (chkOdlClosed.Checked)
|
||||
{
|
||||
chkOdlClosed.CssClass = "btn btn-danger";
|
||||
}
|
||||
else
|
||||
{
|
||||
chkOdlClosed.CssClass = baseCss;
|
||||
}
|
||||
if (chkOdlOpen.Checked)
|
||||
{
|
||||
chkOdlOpen.CssClass = selCss;
|
||||
}
|
||||
else
|
||||
{
|
||||
chkOdlOpen.CssClass = baseCss;
|
||||
}
|
||||
if (chkOdlNew.Checked)
|
||||
{
|
||||
chkOdlNew.CssClass = "btn btn-success";
|
||||
}
|
||||
else
|
||||
{
|
||||
chkOdlNew.CssClass = baseCss;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiorna dati x ridisegno
|
||||
/// </summary>
|
||||
private void ridisegna()
|
||||
{
|
||||
// update controlli child
|
||||
intervalloAnalisi = (intervalloDate)Session["_intervallo"];
|
||||
mod_AnPro_Totali.doUpdate(idxMulti, chkOdlClosed.Checked, chkOdlOpen.Checked, chkOdlNew.Checked);
|
||||
}
|
||||
|
||||
protected void chkOdlClosed_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
ridisegnaChk();
|
||||
ridisegna();
|
||||
}
|
||||
|
||||
protected void chkOdlOpen_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
ridisegnaChk();
|
||||
ridisegna();
|
||||
}
|
||||
|
||||
protected void chkOdlNew_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
ridisegnaChk();
|
||||
ridisegna();
|
||||
}
|
||||
|
||||
protected void btnUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
ridisegnaChk();
|
||||
ridisegna();
|
||||
}
|
||||
}
|
||||
}
|
||||
+88
-212
@@ -8,223 +8,99 @@ using System.Data;
|
||||
/// </summary>
|
||||
public class reportExporter
|
||||
{
|
||||
/// <summary>
|
||||
/// mimeType del report
|
||||
/// </summary>
|
||||
public string mimeType;
|
||||
/// <summary>
|
||||
/// encoding dei dati
|
||||
/// </summary>
|
||||
public string encoding;
|
||||
/// <summary>
|
||||
/// nome estensione
|
||||
/// </summary>
|
||||
public string fileNameExtension;
|
||||
/// <summary>
|
||||
/// steam di bytes del report
|
||||
/// </summary>
|
||||
public byte[] renderedBytes;
|
||||
/// <summary>
|
||||
/// metodo protected
|
||||
/// </summary>
|
||||
public reportExporter()
|
||||
/// <summary>
|
||||
/// mimeType del report
|
||||
/// </summary>
|
||||
public string mimeType;
|
||||
/// <summary>
|
||||
/// encoding dei dati
|
||||
/// </summary>
|
||||
public string encoding;
|
||||
/// <summary>
|
||||
/// nome estensione
|
||||
/// </summary>
|
||||
public string fileNameExtension;
|
||||
/// <summary>
|
||||
/// steam di bytes del report
|
||||
/// </summary>
|
||||
public byte[] renderedBytes;
|
||||
/// <summary>
|
||||
/// metodo protected
|
||||
/// </summary>
|
||||
public reportExporter()
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// carica i dati richiesti dal report dalla StoredProcedure (filtrando quindi...)
|
||||
/// </summary>
|
||||
/// <param name="tipoReport">report ammessi: RichiestaIntervento</param>
|
||||
/// <param name="idxObj">num int mtz</param>
|
||||
/// <returns>tabella dati</returns>
|
||||
private DataTable caricaDati(reportRichiesto tipoReport, string idxObj)
|
||||
{
|
||||
// calcolo idxODL
|
||||
int idxOdl = 0;
|
||||
try
|
||||
{
|
||||
idxOdl = Convert.ToInt32(idxObj);
|
||||
}
|
||||
/// <summary>
|
||||
/// carica i dati richiesti dal report dalla StoredProcedure (filtrando quindi...)
|
||||
/// </summary>
|
||||
/// <param name="tipoReport">report ammessi: RichiestaIntervento</param>
|
||||
/// <param name="idxObj">num int mtz</param>
|
||||
/// <returns>tabella dati</returns>
|
||||
private DataTable caricaDati(reportRichiesto tipoReport, string idxObj)
|
||||
catch
|
||||
{ }
|
||||
DataTable tab = new DataTable();
|
||||
switch (tipoReport)
|
||||
{
|
||||
// calcolo idxODL
|
||||
int idxOdl = 0;
|
||||
try
|
||||
{
|
||||
idxOdl = Convert.ToInt32(idxObj);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
DataTable tab = new DataTable();
|
||||
switch (tipoReport)
|
||||
{
|
||||
case reportRichiesto.SchedaODL:
|
||||
tab = (DataTable)MapoDb.DataLayer.obj.taODL.getByIdx(idxOdl, false);
|
||||
break;
|
||||
//case reportRichiesto.RichiestaIntervento:
|
||||
// tab = (DataTable)TA_app.obj.taInterventiMtz.getByIdx(Convert.ToInt32(idxObj));
|
||||
// break;
|
||||
//default:
|
||||
// break;
|
||||
}
|
||||
return tab;
|
||||
case reportRichiesto.SchedaODL:
|
||||
tab = (DataTable)MapoDb.DataLayer.obj.taODL.getByIdx(idxOdl, false);
|
||||
break;
|
||||
//case reportRichiesto.RichiestaIntervento:
|
||||
// tab = (DataTable)TA_app.obj.taInterventiMtz.getByIdx(Convert.ToInt32(idxObj));
|
||||
// break;
|
||||
//default:
|
||||
// break;
|
||||
}
|
||||
#if false
|
||||
/// <summary>
|
||||
/// carica i dati richiesti dal report dalla StoredProcedure (filtrando quindi...)
|
||||
/// </summary>
|
||||
/// <param name="tipoReport">report ammessi: ElencoMacchine</param>
|
||||
/// <returns>tabella dati</returns>
|
||||
private DataTable caricaDati(reportRichiesto tipoReport)
|
||||
return tab;
|
||||
}
|
||||
/// <summary>
|
||||
/// renderizza il report in pdf
|
||||
/// </summary>
|
||||
/// <param name="tipoReport">report ammessi: RichiestaIntervento</param>
|
||||
/// <param name="parametro">idx della richiesta (numIntMtz)</param>
|
||||
/// <returns></returns>
|
||||
public void popolaPdfStream(reportRichiesto tipoReport, string parametro)
|
||||
{
|
||||
LocalReport report = new LocalReport();
|
||||
devInfoParam deviceInfo = new devInfoParam("PDF", "21cm", "29.7cm", "0.2cm", "0.2cm", "0.2cm", "0.2cm");
|
||||
switch (tipoReport)
|
||||
{
|
||||
DataTable tab = new DataTable();
|
||||
switch (tipoReport)
|
||||
{
|
||||
case reportRichiesto.SchedaODL:
|
||||
tab = (DataTable)TA_app.obj.taElencoImpMacch.GetData();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return tab;
|
||||
}
|
||||
#endif
|
||||
#if false
|
||||
/// <summary>
|
||||
/// carica i dati richiesti dal report dalla StoredProcedure (filtrando quindi...)
|
||||
/// </summary>
|
||||
/// <param name="tipoReport">report ammessi: ElencoInterventi / MTBF_MTTR</param>
|
||||
/// <param name="periodoAnalizzato">oggetto che contiene data inizio e data fine dell'analisi richiesta per il report</param>
|
||||
/// <param name="username">username (per caricare i suoi filtraggi...</param>
|
||||
/// <param name="soloMacchinaFerma">se si devono includere SOLO i dati di macchina ferma</param>
|
||||
/// <param name="includiMtzPrev">se si deve includere anche nel report le fermate di mtz preventiva</param>
|
||||
/// <returns>tabella dati</returns>
|
||||
private DataTable caricaDati(reportRichiesto tipoReport, intervalloDate periodoAnalizzato, string username, bool soloMacchinaFerma, bool includiMtzPrev)
|
||||
{
|
||||
DataTable tab = new DataTable();
|
||||
switch (tipoReport)
|
||||
{
|
||||
case reportRichiesto.ElencoInterventi:
|
||||
// controllo: se include mtz prev e non solo ferma
|
||||
if (!soloMacchinaFerma && includiMtzPrev)
|
||||
{
|
||||
// ...uso metodo std
|
||||
tab = (DataTable)TA_app.obj.taElencoIntFilt.getByIntervDateUsernameFilt(periodoAnalizzato.inizio, periodoAnalizzato.fine, username);
|
||||
}
|
||||
else
|
||||
{
|
||||
// altrimenti stored compelta (e + lenta)
|
||||
tab = (DataTable)TA_app.obj.taElencoIntFilt.getByIntervDateUsernameFilt_fermaPrev(periodoAnalizzato.inizio, periodoAnalizzato.fine, username, soloMacchinaFerma, includiMtzPrev);
|
||||
}
|
||||
break;
|
||||
case reportRichiesto.MTBF_MTTR:
|
||||
// controllo: se include mtz prev e non solo ferma
|
||||
if (!soloMacchinaFerma && includiMtzPrev)
|
||||
{
|
||||
// ...uso metodo std
|
||||
tab = (DataTable)TA_app.obj.taElenco_MTBF_MTTR.GetData(periodoAnalizzato.inizio, periodoAnalizzato.fine, username);
|
||||
}
|
||||
else
|
||||
{
|
||||
// altrimenti stored compelta (e + lenta)
|
||||
tab = (DataTable)TA_app.obj.taElenco_MTBF_MTTR.getByFermaPrev(periodoAnalizzato.inizio, periodoAnalizzato.fine, username, soloMacchinaFerma, includiMtzPrev);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return tab;
|
||||
}
|
||||
#endif
|
||||
#if false
|
||||
/// <summary>
|
||||
/// renderizza il report in pdf
|
||||
/// </summary>
|
||||
/// <param name="tipoReport">report ammessi: ElencoMacchine</param>
|
||||
/// <returns></returns>
|
||||
public void popolaPdfStream(reportRichiesto tipoReport)
|
||||
{
|
||||
LocalReport report = new LocalReport();
|
||||
devInfoParam deviceInfo = new devInfoParam("PDF", "21cm", "29.7cm", "0.2cm", "0.2cm", "0.2cm", "0.2cm");
|
||||
switch (tipoReport)
|
||||
{
|
||||
case reportRichiesto.SchedaODL:
|
||||
report.ReportPath = @".\Reports\Donati_ODL.rdlc";
|
||||
report.DataSources.Add(new ReportDataSource("MoonPro", caricaDati(tipoReport)));
|
||||
deviceInfo = new devInfoParam("PDF", "21cm", "29.7cm", "0.2cm", "0.2cm", "0.2cm", "0.2cm");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
createPdfStream(report, deviceInfo.xmlParam);
|
||||
}
|
||||
#endif
|
||||
/// <summary>
|
||||
/// renderizza il report in pdf
|
||||
/// </summary>
|
||||
/// <param name="tipoReport">report ammessi: RichiestaIntervento</param>
|
||||
/// <param name="parametro">idx della richiesta (numIntMtz)</param>
|
||||
/// <returns></returns>
|
||||
public void popolaPdfStream(reportRichiesto tipoReport, string parametro)
|
||||
{
|
||||
LocalReport report = new LocalReport();
|
||||
devInfoParam deviceInfo = new devInfoParam("PDF", "21cm", "29.7cm", "0.2cm", "0.2cm", "0.2cm", "0.2cm");
|
||||
switch (tipoReport)
|
||||
{
|
||||
case reportRichiesto.SchedaODL:
|
||||
report.ReportPath = @".\Reports\Donati_ODL.rdlc";
|
||||
report.DataSources.Add(new ReportDataSource("MoonPro", caricaDati(tipoReport, parametro))); // OCCHIO!!! va messa sorgente dati CORRETTA
|
||||
deviceInfo = new devInfoParam("PDF", "29.7cm", "21cm", "0.2cm", "0.2cm", "0.2cm", "0.2cm");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
createPdfStream(report, deviceInfo.xmlParam);
|
||||
}
|
||||
#if false
|
||||
/// <summary>
|
||||
/// renderizza il report in pdf
|
||||
/// </summary>
|
||||
/// <param name="tipoReport">report ammessi: ElencoInterventi / MTBF_MTTR</param>
|
||||
/// <param name="periodoAnalizzato">oggetto che contiene data inizio e data fine dell'analisi richiesta per il report</param>
|
||||
/// <param name="username">username (per caricare i suoi filtraggi...</param>
|
||||
/// <param name="soloMacchinaFerma">se si devono includere SOLO i dati di macchina ferma</param>
|
||||
/// <param name="includiMtzPrev">se si deve includere anche nel report le fermate di mtz preventiva</param>
|
||||
public void popolaPdfStream(reportRichiesto tipoReport, intervalloDate periodoAnalizzato, string username, bool soloMacchinaFerma, bool includiMtzPrev)
|
||||
{
|
||||
LocalReport report = new LocalReport();
|
||||
devInfoParam deviceInfo = new devInfoParam("PDF", "21cm", "29.7cm", "0.2cm", "0.2cm", "0.2cm", "0.2cm");
|
||||
switch (tipoReport)
|
||||
{
|
||||
case reportRichiesto.ElencoInterventi:
|
||||
report.ReportPath = @".\Reports\ReportInterventi.rdlc";
|
||||
report.DataSources.Add(new ReportDataSource("WebGim", caricaDati(tipoReport, periodoAnalizzato, username, soloMacchinaFerma, includiMtzPrev)));
|
||||
deviceInfo = new devInfoParam("PDF", "29.7cm", "21cm", "0.2cm", "0.2cm", "0.2cm", "0.2cm");
|
||||
break;
|
||||
case reportRichiesto.MTBF_MTTR:
|
||||
report.ReportPath = @".\Reports\Report_MTBF_MTTR.rdlc";
|
||||
report.DataSources.Add(new ReportDataSource("WebGim", caricaDati(tipoReport, periodoAnalizzato, username, soloMacchinaFerma, includiMtzPrev)));
|
||||
deviceInfo = new devInfoParam("PDF", "29.7cm", "21cm", "0.2cm", "0.2cm", "0.2cm", "0.2cm");
|
||||
// calcolo le ore totali equivalenti...
|
||||
ReportParameter[] OreTotali = { new ReportParameter("OreTotali", WebGimUtils.obj.oreEquivalenti(periodoAnalizzato).ToString()) };
|
||||
report.SetParameters(OreTotali);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
createPdfStream(report, deviceInfo.xmlParam);
|
||||
}
|
||||
#endif
|
||||
/// <summary>
|
||||
/// crea il vero e proprio stream pdf
|
||||
/// </summary>
|
||||
/// <param name="report"></param>
|
||||
/// <param name="deviceInfo"></param>
|
||||
private void createPdfStream(LocalReport report, string deviceInfo)
|
||||
{
|
||||
// export in PDF
|
||||
string reportType = "PDF";
|
||||
Warning[] warnings;
|
||||
string[] streams;
|
||||
renderedBytes = report.Render(
|
||||
reportType,
|
||||
deviceInfo,
|
||||
out mimeType,
|
||||
out encoding,
|
||||
out fileNameExtension,
|
||||
out streams,
|
||||
out warnings);
|
||||
case reportRichiesto.SchedaODL:
|
||||
report.ReportPath = @".\Reports\Donati_ODL.rdlc";
|
||||
report.DataSources.Add(new ReportDataSource("MoonPro", caricaDati(tipoReport, parametro))); // OCCHIO!!! va messa sorgente dati CORRETTA
|
||||
deviceInfo = new devInfoParam("PDF", "29.7cm", "21cm", "0.2cm", "0.2cm", "0.2cm", "0.2cm");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
createPdfStream(report, deviceInfo.xmlParam);
|
||||
}
|
||||
/// <summary>
|
||||
/// crea il vero e proprio stream pdf
|
||||
/// </summary>
|
||||
/// <param name="report"></param>
|
||||
/// <param name="deviceInfo"></param>
|
||||
private void createPdfStream(LocalReport report, string deviceInfo)
|
||||
{
|
||||
// export in PDF
|
||||
string reportType = "PDF";
|
||||
Warning[] warnings;
|
||||
string[] streams;
|
||||
renderedBytes = report.Render(
|
||||
reportType,
|
||||
deviceInfo,
|
||||
out mimeType,
|
||||
out encoding,
|
||||
out fileNameExtension,
|
||||
out streams,
|
||||
out warnings);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+150
-206
@@ -14,232 +14,176 @@ using System.Text;
|
||||
public class reportPrinter
|
||||
{
|
||||
|
||||
#region area codice da non modificare
|
||||
#region area codice da non modificare
|
||||
|
||||
private int m_currentPageIndex;
|
||||
private IList<Stream> m_streams;
|
||||
/// <summary>
|
||||
/// ciclo da fornire al renderizzatore dei report, per salvare 1 immagine da ogni pagina del report
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="fileNameExtension"></param>
|
||||
/// <param name="encoding"></param>
|
||||
/// <param name="mimeType"></param>
|
||||
/// <param name="willSeek"></param>
|
||||
/// <returns></returns>
|
||||
private Stream CreateStream(string name, string fileNameExtension, Encoding encoding, string mimeType, bool willSeek)
|
||||
private int m_currentPageIndex;
|
||||
private IList<Stream> m_streams;
|
||||
/// <summary>
|
||||
/// ciclo da fornire al renderizzatore dei report, per salvare 1 immagine da ogni pagina del report
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="fileNameExtension"></param>
|
||||
/// <param name="encoding"></param>
|
||||
/// <param name="mimeType"></param>
|
||||
/// <param name="willSeek"></param>
|
||||
/// <returns></returns>
|
||||
private Stream CreateStream(string name, string fileNameExtension, Encoding encoding, string mimeType, bool willSeek)
|
||||
{
|
||||
Stream stream = new FileStream(SteamWare.SteamwareStrings.getFilePath(@".\temp\" + name + "." + fileNameExtension), FileMode.Create);
|
||||
m_streams.Add(stream);
|
||||
return stream;
|
||||
}
|
||||
/// <summary>
|
||||
/// Handler per PrintPageEvents
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="ev"></param>
|
||||
private void PrintPage(object sender, PrintPageEventArgs ev)
|
||||
{
|
||||
Metafile pageImage = new Metafile(m_streams[m_currentPageIndex]);
|
||||
ev.Graphics.DrawImage(pageImage, ev.PageBounds);
|
||||
m_currentPageIndex++;
|
||||
ev.HasMorePages = (m_currentPageIndex < m_streams.Count);
|
||||
}
|
||||
/// <summary>
|
||||
/// funzione di stampa...
|
||||
/// </summary>
|
||||
private void Print(string printerName)
|
||||
{
|
||||
//const string printerName = "Microsoft Office Document Image Writer";
|
||||
//const string printerName = "Brother HL-2170W series";
|
||||
if (m_streams == null || m_streams.Count == 0)
|
||||
return;
|
||||
PrintDocument printDoc = new PrintDocument();
|
||||
printDoc.PrinterSettings.PrinterName = printerName;
|
||||
if (!printDoc.PrinterSettings.IsValid)
|
||||
{
|
||||
Stream stream = new FileStream(SteamWare.SteamwareStrings.getFilePath(@".\temp\" + name + "." + fileNameExtension), FileMode.Create);
|
||||
m_streams.Add(stream);
|
||||
return stream;
|
||||
logger.lg.scriviLog(String.Format("Can't find printer \"{0}\".", printerName), tipoLog.ERROR);
|
||||
return;
|
||||
}
|
||||
/// <summary>
|
||||
/// Handler per PrintPageEvents
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="ev"></param>
|
||||
private void PrintPage(object sender, PrintPageEventArgs ev)
|
||||
printDoc.PrintPage += new PrintPageEventHandler(PrintPage);
|
||||
printDoc.Print();
|
||||
}
|
||||
/// <summary>
|
||||
/// Export del report come EMF (Enhanced Metafile) file.
|
||||
/// </summary>
|
||||
/// <param name="report"></param>
|
||||
private void Export(LocalReport report, string deviceInfo)
|
||||
{
|
||||
Warning[] warnings;
|
||||
m_streams = new List<Stream>();
|
||||
report.Render("Image", deviceInfo, CreateStream, out warnings);
|
||||
foreach (Stream stream in m_streams) stream.Position = 0;
|
||||
}
|
||||
/// <summary>
|
||||
/// dispone l'applicazione e rilascia le risorse
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
if (m_streams != null)
|
||||
{
|
||||
Metafile pageImage = new Metafile(m_streams[m_currentPageIndex]);
|
||||
ev.Graphics.DrawImage(pageImage, ev.PageBounds);
|
||||
m_currentPageIndex++;
|
||||
ev.HasMorePages = (m_currentPageIndex < m_streams.Count);
|
||||
}
|
||||
/// <summary>
|
||||
/// funzione di stampa...
|
||||
/// </summary>
|
||||
private void Print(string printerName)
|
||||
{
|
||||
//const string printerName = "Microsoft Office Document Image Writer";
|
||||
//const string printerName = "Brother HL-2170W series";
|
||||
if (m_streams == null || m_streams.Count == 0)
|
||||
return;
|
||||
PrintDocument printDoc = new PrintDocument();
|
||||
printDoc.PrinterSettings.PrinterName = printerName;
|
||||
if (!printDoc.PrinterSettings.IsValid)
|
||||
{
|
||||
logger.lg.scriviLog(String.Format("Can't find printer \"{0}\".", printerName), tipoLog.ERROR);
|
||||
return;
|
||||
}
|
||||
printDoc.PrintPage += new PrintPageEventHandler(PrintPage);
|
||||
printDoc.Print();
|
||||
}
|
||||
/// <summary>
|
||||
/// Export del report come EMF (Enhanced Metafile) file.
|
||||
/// </summary>
|
||||
/// <param name="report"></param>
|
||||
private void Export(LocalReport report, string deviceInfo)
|
||||
{
|
||||
Warning[] warnings;
|
||||
m_streams = new List<Stream>();
|
||||
report.Render("Image", deviceInfo, CreateStream, out warnings);
|
||||
foreach (Stream stream in m_streams) stream.Position = 0;
|
||||
}
|
||||
/// <summary>
|
||||
/// dispone l'applicazione e rilascia le risorse
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
if (m_streams != null)
|
||||
{
|
||||
foreach (Stream stream in m_streams)
|
||||
stream.Close();
|
||||
m_streams = null;
|
||||
}
|
||||
foreach (Stream stream in m_streams)
|
||||
stream.Close();
|
||||
m_streams = null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region area codice da modificare
|
||||
#region area codice da modificare
|
||||
|
||||
/// <summary>
|
||||
/// carica i dati richiesti dal report dalla StoredProcedure (filtrando quindi...)
|
||||
/// </summary>
|
||||
/// <param name="tipoReport">report ammessi: ElencoMacchine / RichiestaIntervento</param>
|
||||
/// <param name="periodoAnalizzato">oggetto che contiene data inizio e data fine dell'analisi richiesta per il report</param>
|
||||
/// <returns>tabella dati</returns>
|
||||
private DataTable caricaDati(reportRichiesto tipoReport, string idxObj)
|
||||
/// <summary>
|
||||
/// carica i dati richiesti dal report dalla StoredProcedure (filtrando quindi...)
|
||||
/// </summary>
|
||||
/// <param name="tipoReport">report ammessi: ElencoMacchine / RichiestaIntervento</param>
|
||||
/// <param name="periodoAnalizzato">oggetto che contiene data inizio e data fine dell'analisi richiesta per il report</param>
|
||||
/// <returns>tabella dati</returns>
|
||||
private DataTable caricaDati(reportRichiesto tipoReport, string idxObj)
|
||||
{
|
||||
// calcolo idxODL
|
||||
int idxOdl = 0;
|
||||
try
|
||||
{
|
||||
// calcolo idxODL
|
||||
int idxOdl = 0;
|
||||
try
|
||||
{
|
||||
idxOdl = Convert.ToInt32(idxObj);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
DataTable tab = new DataTable();
|
||||
switch (tipoReport)
|
||||
{
|
||||
case reportRichiesto.SchedaODL:
|
||||
tab = (DataTable)MapoDb.DataLayer.obj.taODL.getByIdx(idxOdl, false);
|
||||
break;
|
||||
//case reportRichiesto.RichiestaIntervento:
|
||||
// tab = (DataTable)TA_app.obj.taInterventiMtz.getByIdx(Convert.ToInt32(idxObj));
|
||||
// break;
|
||||
//default:
|
||||
// break;
|
||||
}
|
||||
return tab;
|
||||
idxOdl = Convert.ToInt32(idxObj);
|
||||
}
|
||||
#if false
|
||||
/// <summary>
|
||||
/// carica i dati richiesti dal report dalla StoredProcedure (filtrando quindi...)
|
||||
/// </summary>
|
||||
/// <param name="tipoReport">report ammessi: ElencoInterventi / MTBF_MTTR</param>
|
||||
/// <param name="periodoAnalizzato">oggetto che contiene data inizio e data fine dell'analisi richiesta per il report</param>
|
||||
/// <returns>tabella dati</returns>
|
||||
private DataTable caricaDati(reportRichiesto tipoReport, intervalloDate periodoAnalizzato, string username)
|
||||
catch
|
||||
{ }
|
||||
DataTable tab = new DataTable();
|
||||
switch (tipoReport)
|
||||
{
|
||||
DataTable tab = new DataTable();
|
||||
switch (tipoReport)
|
||||
{
|
||||
case reportRichiesto.ElencoInterventi:
|
||||
tab = (DataTable)TA_app.obj.taElencoIntFilt.getByIntervDateUsernameFilt(periodoAnalizzato.inizio, periodoAnalizzato.fine, username);
|
||||
break;
|
||||
case reportRichiesto.MTBF_MTTR:
|
||||
tab = (DataTable)TA_app.obj.taElenco_MTBF_MTTR.GetData(periodoAnalizzato.inizio, periodoAnalizzato.fine, username);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return tab;
|
||||
}
|
||||
#endif
|
||||
/// <summary>
|
||||
/// Crea un report locale da file rdlc, carica i dati, esporta report come EMF file e quindi lo invia alla stampante
|
||||
/// </summary>
|
||||
/// <param name="tipoReport">report ammessi: ElencoMacchine / RichiestaIntervento</param>
|
||||
/// <param name="printerName">nome completo stampante (rispetto al server)</param>
|
||||
/// <param name="parametro">numIntMtz (codice numero richiesta)</param>
|
||||
public void printReport(reportRichiesto tipoReport, string printerName, string parametro)
|
||||
{
|
||||
LocalReport report = new LocalReport();
|
||||
devInfoParam deviceInfo = new devInfoParam("EMF", "21cm", "29.7cm", "0.2cm", "0.2cm", "0.2cm", "0.2cm");
|
||||
switch (tipoReport)
|
||||
{
|
||||
case reportRichiesto.SchedaODL:
|
||||
report.ReportPath = @".\Reports\Donati_ODL.rdlc";
|
||||
report.DataSources.Add(new ReportDataSource("MoonPro", caricaDati(tipoReport, parametro)));
|
||||
deviceInfo = new devInfoParam("EMF", "21cm", "29.7cm", "0.2cm", "0.2cm", "0.2cm", "0.2cm");
|
||||
break;
|
||||
//case reportRichiesto.RichiestaIntervento:
|
||||
// report.ReportPath = @".\Reports\RichiestaIntervento.rdlc";
|
||||
// report.DataSources.Add(new ReportDataSource("WebGim", caricaDati(tipoReport, parametro)));
|
||||
// deviceInfo = new devInfoParam("EMF", "29.7cm", "21cm", "0.2cm", "0.2cm", "0.2cm", "0.2cm");
|
||||
// break;
|
||||
//default:
|
||||
// break;
|
||||
}
|
||||
doEmfPrint(printerName, report, deviceInfo.xmlParam);
|
||||
case reportRichiesto.SchedaODL:
|
||||
tab = (DataTable)MapoDb.DataLayer.obj.taODL.getByIdx(idxOdl, false);
|
||||
break;
|
||||
//case reportRichiesto.RichiestaIntervento:
|
||||
// tab = (DataTable)TA_app.obj.taInterventiMtz.getByIdx(Convert.ToInt32(idxObj));
|
||||
// break;
|
||||
//default:
|
||||
// break;
|
||||
}
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Crea un report locale da file rdlc, carica i dati, esporta report come EMF file e quindi lo invia alla stampante
|
||||
/// </summary>
|
||||
/// <param name="tipoReport">report ammessi: ElencoInterventi / MTBF_MTTR</param>
|
||||
/// <param name="printerName">nome completo stampante (rispetto al server)</param>
|
||||
/// <param name="periodoAnalizzato">oggetto che contiene data inizio e data fine dell'analisi richiesta per il report</param>
|
||||
public void printReport(reportRichiesto tipoReport, string printerName, intervalloDate periodoAnalizzato, string username)
|
||||
return tab;
|
||||
}
|
||||
/// <summary>
|
||||
/// Crea un report locale da file rdlc, carica i dati, esporta report come EMF file e quindi lo invia alla stampante
|
||||
/// </summary>
|
||||
/// <param name="tipoReport">report ammessi: ElencoMacchine / RichiestaIntervento</param>
|
||||
/// <param name="printerName">nome completo stampante (rispetto al server)</param>
|
||||
/// <param name="parametro">numIntMtz (codice numero richiesta)</param>
|
||||
public void printReport(reportRichiesto tipoReport, string printerName, string parametro)
|
||||
{
|
||||
LocalReport report = new LocalReport();
|
||||
devInfoParam deviceInfo = new devInfoParam("EMF", "21cm", "29.7cm", "0.2cm", "0.2cm", "0.2cm", "0.2cm");
|
||||
switch (tipoReport)
|
||||
{
|
||||
LocalReport report = new LocalReport();
|
||||
devInfoParam deviceInfo = new devInfoParam("EMF", "21cm", "29.7cm", "0.2cm", "0.2cm", "0.2cm", "0.2cm");
|
||||
switch (tipoReport)
|
||||
{
|
||||
case reportRichiesto.ElencoInterventi:
|
||||
report.ReportPath = @".\Reports\ReportInterventi.rdlc";
|
||||
report.DataSources.Add(new ReportDataSource("WebGim", caricaDati(tipoReport, periodoAnalizzato, username)));
|
||||
deviceInfo = new devInfoParam("EMF", "29.7cm", "21cm", "0.2cm", "0.2cm", "0.2cm", "0.2cm");
|
||||
break;
|
||||
case reportRichiesto.MTBF_MTTR:
|
||||
report.ReportPath = @".\Reports\Report_MTBF_MTTR.rdlc";
|
||||
report.DataSources.Add(new ReportDataSource("WebGim", caricaDati(tipoReport, periodoAnalizzato, username)));
|
||||
deviceInfo = new devInfoParam("EMF", "29.7cm", "21cm", "0.2cm", "0.2cm", "0.2cm", "0.2cm");
|
||||
// calcolo le ore totali equivalenti...
|
||||
ReportParameter[] OreTotali = { new ReportParameter("OreTotali", WebGimUtils.obj.oreEquivalenti(periodoAnalizzato).ToString()) };
|
||||
report.SetParameters(OreTotali);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
doEmfPrint(printerName, report, deviceInfo.xmlParam);
|
||||
}
|
||||
#endif
|
||||
/// <summary>
|
||||
/// esegue print vero e proprio
|
||||
/// </summary>
|
||||
/// <param name="printerName"></param>
|
||||
/// <param name="report"></param>
|
||||
/// <param name="deviceInfo"></param>
|
||||
private void doEmfPrint(string printerName, LocalReport report, string deviceInfo)
|
||||
{
|
||||
// export in EMF
|
||||
Export(report, deviceInfo);
|
||||
m_currentPageIndex = 0;
|
||||
// stampo
|
||||
Print(printerName);
|
||||
// do dispose?
|
||||
Dispose();
|
||||
case reportRichiesto.SchedaODL:
|
||||
report.ReportPath = @".\Reports\Donati_ODL.rdlc";
|
||||
report.DataSources.Add(new ReportDataSource("MoonPro", caricaDati(tipoReport, parametro)));
|
||||
deviceInfo = new devInfoParam("EMF", "21cm", "29.7cm", "0.2cm", "0.2cm", "0.2cm", "0.2cm");
|
||||
break;
|
||||
//case reportRichiesto.RichiestaIntervento:
|
||||
// report.ReportPath = @".\Reports\RichiestaIntervento.rdlc";
|
||||
// report.DataSources.Add(new ReportDataSource("WebGim", caricaDati(tipoReport, parametro)));
|
||||
// deviceInfo = new devInfoParam("EMF", "29.7cm", "21cm", "0.2cm", "0.2cm", "0.2cm", "0.2cm");
|
||||
// break;
|
||||
//default:
|
||||
// break;
|
||||
}
|
||||
doEmfPrint(printerName, report, deviceInfo.xmlParam);
|
||||
}
|
||||
/// <summary>
|
||||
/// esegue print vero e proprio
|
||||
/// </summary>
|
||||
/// <param name="printerName"></param>
|
||||
/// <param name="report"></param>
|
||||
/// <param name="deviceInfo"></param>
|
||||
private void doEmfPrint(string printerName, LocalReport report, string deviceInfo)
|
||||
{
|
||||
// export in EMF
|
||||
Export(report, deviceInfo);
|
||||
m_currentPageIndex = 0;
|
||||
// stampo
|
||||
Print(printerName);
|
||||
// do dispose?
|
||||
Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// oggetto protected
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
protected reportPrinter()
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// singleton pubblico
|
||||
/// </summary>
|
||||
public static reportPrinter obj = new reportPrinter();
|
||||
/// <summary>
|
||||
/// oggetto protected
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
protected reportPrinter()
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// singleton pubblico
|
||||
/// </summary>
|
||||
public static reportPrinter obj = new reportPrinter();
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
/// <summary>
|
||||
/// tipologia di report ammessi alla stampa...
|
||||
/// </summary>
|
||||
public enum reportRichiesto
|
||||
{
|
||||
SchedaODL
|
||||
SchedaODL
|
||||
}
|
||||
|
||||
@@ -125,21 +125,6 @@ public class resoconti
|
||||
}
|
||||
}
|
||||
protected MapoDb.DS_applicazioneTableAdapters.ParetoDurateTableAdapter taParetoDurate;
|
||||
#if false
|
||||
protected MapoDb.DS_applicazione.ParetoDurateDataTable _ParetoDurate;
|
||||
protected MapoDb.DS_applicazione.ParetoDurateDataTable ParetoDurate
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_ParetoDurate == null)
|
||||
{
|
||||
// set vuoto...
|
||||
_ParetoDurate = taParetoDurate.GetParetoDurateFilt("", 100, DateTime.Now, DateTime.Now);
|
||||
}
|
||||
return _ParetoDurate;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
protected MapoDb.DS_applicazioneTableAdapters.AnagraficaEventiTableAdapter taAnagraficaEventi;
|
||||
protected MapoDb.DS_applicazione.AnagraficaEventiDataTable _AnagraficaEventi;
|
||||
protected MapoDb.DS_applicazione.AnagraficaEventiDataTable AnagraficaEventi
|
||||
|
||||
Reference in New Issue
Block a user