using GMW_data;
using SteamWare;
using System;

namespace GMW.WebUserControls
{
  public partial class mod_SearchProvDtx : System.Web.UI.UserControl
  {
    /// <summary>
    /// Oggetto locale gestione classe datamatrix...
    /// </summary>
    protected DataMatrix DataMatrix_mgr = new DataMatrix();
    protected void Page_Load(object sender, EventArgs e)
    {
      doSearch();
    }
    /// <summary>
    /// wrapper metodo traduzione
    /// </summary>
    /// <param name="lemma"></param>
    /// <returns></returns>
    public string traduci(string lemma)
    {
      return user_std.UtSn.Traduci(lemma);
    }
    public void doSearch()
    {
      lblDtx.Text = dtx_sel;
      lblPart.Text = part_sel;
      mod_listDtx1.doUpdate();
    }
    /// <summary>
    /// codice Dtx cercato
    /// </summary>
    public string dtx_sel
    {
      get
      {
        string answ = memLayer.ML.StringSessionObj("FullSearchValue");
        // cerco se esista il datamatrix cercato... se non trovo ritorno ""
        if (DataMatrix_mgr.taDtx2UDC.getByDtx(answ).Rows.Count == 0) answ = "";
        return answ;
      }
    }
    /// <summary>
    /// particolare associato al datamatrix
    /// </summary>
    public string part_sel
    {
      get
      {
        string answ = "";
        try
        {
          if (dtx_sel != "")
          {
            // vers 2.9 modifica per multi-datamatrix
            answ = DataMatrix_mgr.taDecode.GetData(dtx_sel, "")[0].Particolare;
          }
        }
        catch
        { }
        return answ;
      }
    }

  }
}