151 lines
4.5 KiB
C#
151 lines
4.5 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 C2P_Data;
|
|
|
|
namespace C2P
|
|
{
|
|
public partial class Import : SteamWare.UserPage
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
grViewLog.Visible = false;
|
|
}
|
|
}
|
|
|
|
protected void grViewTicket_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
grViewLog.Visible = true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// verifica se utente sia SuperAdmin
|
|
/// </summary>
|
|
public bool userIsSuperAdmin
|
|
{
|
|
get
|
|
{
|
|
return devicesAuthProxy.stObj.userHasRight("SuperAdmin");
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// wrapper traduzione
|
|
/// </summary>
|
|
/// <param name="lemma"></param>
|
|
/// <returns></returns>
|
|
public string traduci(string lemma)
|
|
{
|
|
return user_std.UtSn.Traduci(lemma);
|
|
}
|
|
/// <summary>
|
|
/// classe css dato controllo esito stored
|
|
/// </summary>
|
|
/// <param name="isOk"></param>
|
|
/// <param name="isDone"></param>
|
|
/// <returns>warnRed/warnOrange/allOk</returns>
|
|
public string cssByCheck(object isOk, object isDone)
|
|
{
|
|
string answ = "warnRed";
|
|
try
|
|
{
|
|
if (!Convert.ToBoolean(isDone))
|
|
{
|
|
answ = "running";
|
|
}
|
|
else
|
|
{
|
|
if (Convert.ToBoolean(isOk)) answ = "allOk";
|
|
}
|
|
}
|
|
catch
|
|
{ }
|
|
return answ;
|
|
}
|
|
/// <summary>
|
|
/// restituisce icona corretta a seconda dello stato della riga...
|
|
/// </summary>
|
|
/// <param name="dataStart"></param>
|
|
/// <param name="dataEnd"></param>
|
|
/// <param name="isDone"></param>
|
|
/// <param name="isOk"></param>
|
|
/// <returns></returns>
|
|
public string currIcon(object dataStart, object dataEnd, object isDone, object isOk)
|
|
{
|
|
/*-----------------------------------------
|
|
* OUTPUT possibili:
|
|
* waiting: fa fa-list-ol fa-2x
|
|
* running: fa fa-refresh fa-spin fa-2x
|
|
* done: fa fa-check fa-2x
|
|
* error: fa fa-times fa-2x
|
|
*----------------------------------------- */
|
|
string answ = "fa fa-bolt fa-2x";
|
|
if (Convert.ToBoolean(isDone))
|
|
{
|
|
if (Convert.ToBoolean(isOk))
|
|
{
|
|
answ = "fa fa-check fa-2x";
|
|
}
|
|
else
|
|
{
|
|
answ = "fa fa-times fa-2x";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (dataStart.ToString() == "")
|
|
{
|
|
answ = "fa fa-list-ol fa-2x";
|
|
}
|
|
else
|
|
{
|
|
answ = "fa fa-refresh fa-spin fa-2x";
|
|
}
|
|
}
|
|
return answ;
|
|
}
|
|
/// <summary>
|
|
/// chiamata procedura di import file
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void lbtImport_Click(object sender, EventArgs e)
|
|
{
|
|
insertStepTicket("step01");
|
|
}
|
|
/// <summary>
|
|
/// fa la chiamata di inserimento step richeisto e aggiorna
|
|
/// </summary>
|
|
/// <param name="stepCode"></param>
|
|
private void insertStepTicket(string stepCode)
|
|
{
|
|
DtProxy.man.taImpTL.InsertQuery(memLayer.ML.confReadString(stepCode + "_stp"), memLayer.ML.confReadString(stepCode + "_par"));
|
|
grViewTicket.SelectedIndex = -1;
|
|
grViewTicket.DataBind();
|
|
}
|
|
/// <summary>
|
|
/// chiamata procedura di convert tracciati
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void lbtConvert_Click(object sender, EventArgs e)
|
|
{
|
|
insertStepTicket("step02");
|
|
}
|
|
/// <summary>
|
|
/// chiamata procedura di merge dati
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void lbtMerge_Click(object sender, EventArgs e)
|
|
{
|
|
insertStepTicket("step03");
|
|
}
|
|
|
|
}
|
|
} |