72e5d9de00
fix vari e in produzione, x testare TUTTA parte Q ed S (update valori calcolo costi post update moduli in S e Q, ...)
85 lines
2.4 KiB
C#
85 lines
2.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace C2P.WebUserControls
|
|
{
|
|
public partial class mod_Q_Quot : SteamWare.UserControl
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
public event EventHandler eh_update;
|
|
/// <summary>
|
|
/// fa toggle tra modo edit e read/item
|
|
/// </summary>
|
|
public void toggleMode()
|
|
{
|
|
if (frmView.CurrentMode == FormViewMode.ReadOnly)
|
|
{
|
|
frmView.ChangeMode(FormViewMode.Edit);
|
|
}
|
|
else
|
|
{
|
|
frmView.ChangeMode(FormViewMode.ReadOnly);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// indica se il controllo sia in modalità editing
|
|
/// </summary>
|
|
public bool isEditing
|
|
{
|
|
get
|
|
{
|
|
return (frmView.CurrentMode == FormViewMode.Edit);
|
|
}
|
|
}
|
|
protected void odsQuotes_Updated(object sender, ObjectDataSourceStatusEventArgs e)
|
|
{
|
|
if (eh_update != null)
|
|
{
|
|
eh_update(this, new EventArgs());
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// restituisce classe CSS da confronto di 2 valori numerici:
|
|
/// - rosso se val1 minore val2
|
|
/// - verde se val1 >= val2
|
|
/// </summary>
|
|
/// <param name="val1"></param>
|
|
/// <param name="val2"></param>
|
|
/// <returns></returns>
|
|
public string colorByVal(object val1, object val2)
|
|
{
|
|
string answ = "text-success";
|
|
if (Math.Round(Convert.ToDecimal(val1), 3) < Math.Round(Convert.ToDecimal(val2), 3)) answ = "text-danger";
|
|
return answ;
|
|
}
|
|
/// <summary>
|
|
/// controllo se inviare evento refresh al cambio di modo della formview
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void frmView_ModeChanged(object sender, EventArgs e)
|
|
{
|
|
if (frmView.CurrentMode == FormViewMode.ReadOnly)
|
|
{
|
|
if (eh_update != null)
|
|
{
|
|
eh_update(this, new EventArgs());
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// effettua update
|
|
/// </summary>
|
|
public void doUpdate()
|
|
{
|
|
frmView.DataBind();
|
|
}
|
|
}
|
|
} |