using CMS_SC_Data; using System; using System.Web.UI.WebControls; namespace CMS_SC.WebUserControls { public partial class mod_elencoSchedeDossier : SteamWare.UserControl { /// /// selezione valore in DettScheda /// public event EventHandler eh_selezioneValore; /// /// sollevo evento selezione /// protected void raiseEvent() { // sollevo evento nuovo valore... if (eh_selezioneValore != null) { eh_selezioneValore(this, new EventArgs()); } } protected void Page_Load(object sender, EventArgs e) { } /// /// dimensione pagina grid view /// public int pageSize { get { return grView.PageSize; } set { grView.PageSize = value; } } /// /// dossier selezionato /// public string idxDossier { get { return hfIdxDossier.Value; } set { hfIdxDossier.Value = value; grView.DataBind(); } } public void doUpdate() { grView.DataBind(); } /// /// selezione scheda... /// /// /// protected void grView_SelectedIndexChanged(object sender, EventArgs e) { // verifico se ho un argomento di tipo moveUp / moveDown... quale comando? string _comando = ""; string CodSchedaVersNum = ""; if (SteamWare.memLayer.ML.isInSessionObject("nextObjCommand")) { _comando = SteamWare.memLayer.ML.StringSessionObj("nextObjCommand"); SteamWare.memLayer.ML.emptySessionVal("nextObjCommand"); } if (_comando != "") { CodSchedaVersNum = string.Format("{0}.{1}.{2}", grView.SelectedDataKey["CodScheda"], grView.SelectedDataKey["Vers"], grView.SelectedDataKey["NumScheda"]); // SE c'era comando eseguo move... switch (_comando) { case "moveUp": case "moveDown": DtProxy.man.taSCM.moveUpDown(_comando, Convert.ToInt32(idxDossier), CodSchedaVersNum); break; //case "clone": // DtProxy.man.taDS.clone(memLayer.ML.QSS("CodSchedaVers"), grView.SelectedDataKey["CodMisura"].ToString()); // break; default: break; } resetSelezione(); } else { raiseEvent(); } } protected void btnReset_Click(object sender, EventArgs e) { resetSelezione(); } /// /// resetto selezione /// private void resetSelezione() { grView.SelectedIndex = -1; grView.DataBind(); raiseEvent(); } /// /// determina visibilità frecce spostamento /// /// direzione: UP / DOWN /// Ordinale /// public bool arrowVisible(object _direction, object _Ordinale) { bool answ = false; string direction = _direction.ToString(); int Ordinale = Convert.ToInt32(_Ordinale.ToString()); switch (direction) { case "UP": answ = Ordinale > 1; break; case "DOWN": answ = Ordinale < DtProxy.man.taSCM.getByDossier(Convert.ToInt32(idxDossier)).Rows.Count; break; default: break; } return answ; } /// /// salvo in session il prox comando /// /// /// protected void lb_Click(object sender, EventArgs e) { SteamWare.memLayer.ML.setSessionVal("nextObjCommand", ((LinkButton)sender).CommandArgument); } } }