3f332d0c3f
update vari, filtro su cliente
105 lines
3.1 KiB
C#
105 lines
3.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using C2P_Data;
|
|
using SteamWare;
|
|
|
|
namespace C2P.WebUserControls
|
|
{
|
|
public partial class mod_QuoteList : System.Web.UI.UserControl
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
txtCerca.Focus();
|
|
}
|
|
}
|
|
#if false
|
|
private void ricalcolaQuote(string quoteType, long CodQuote, int Rev)
|
|
{
|
|
DateTime tick = DateTime.Now;
|
|
// aggiorno dati!
|
|
DtProxy.man.taQL.stp_QL_update(quoteType, CodQuote, Rev);
|
|
lblOut.Text = string.Format("Tempo ricalcolo: {0} ms", DateTime.Now.Subtract(tick).TotalMilliseconds);
|
|
}
|
|
#endif
|
|
/// <summary>
|
|
/// salvo e vado a dettaglio!
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
// ricalcolo!
|
|
string QuoteType = grView.SelectedDataKey["QuoteType"].ToString();
|
|
long CodQuote = Convert.ToInt64(grView.SelectedDataKey["CodQuote"]);
|
|
int QuoteRev = Convert.ToInt16(grView.SelectedDataKey["QuoteRev"]);
|
|
// rimando a dettaglio!
|
|
Response.Redirect(string.Format("QuoteDet?QuoteType={0}&CodQuote={1}&QuoteRev={2}", QuoteType, CodQuote, QuoteRev));
|
|
}
|
|
/// <summary>
|
|
/// Calcola css dato valore prezzo offerto vs importi full cost e min price
|
|
/// </summary>
|
|
/// <param name="FullCost"></param>
|
|
/// <param name="MinPrice"></param>
|
|
/// <param name="PriceOff"></param>
|
|
/// <returns></returns>
|
|
public string priceVsCost(object _FullCost, object _MinPrice, object _PriceOff)
|
|
{
|
|
string answ = "";
|
|
double FullCost = 0;
|
|
double MinPrice = 0;
|
|
double PriceOff = 0;
|
|
try
|
|
{
|
|
FullCost = Convert.ToDouble(_FullCost);
|
|
MinPrice = Convert.ToDouble(_MinPrice);
|
|
PriceOff = Convert.ToDouble(_PriceOff);
|
|
}
|
|
catch
|
|
{ }
|
|
if (PriceOff > MinPrice)
|
|
{
|
|
answ = "allOk";
|
|
}
|
|
else if (PriceOff > FullCost)
|
|
{
|
|
answ = "warnOrange";
|
|
}
|
|
else
|
|
{
|
|
answ = "warnRed";
|
|
}
|
|
return answ;
|
|
}
|
|
|
|
protected string ricerca
|
|
{
|
|
get
|
|
{
|
|
return txtCerca.Text.Trim();
|
|
}
|
|
}
|
|
|
|
protected void txtCerca_TextChanged(object sender, EventArgs e)
|
|
{
|
|
doUpdate();
|
|
}
|
|
|
|
public void doUpdate()
|
|
{
|
|
memLayer.ML.setSessionVal("valoreRicerca", ricerca);
|
|
grView.DataBind();
|
|
txtCerca.Focus();
|
|
}
|
|
|
|
protected void btnCerca_Click(object sender, EventArgs e)
|
|
{
|
|
doUpdate();
|
|
}
|
|
}
|
|
} |