using SteamWare;
using System;
using System.Web.UI;

namespace GMW
{
  public partial class AnagFormatiDtx : UserPage
  {
    protected void Page_Load(object sender, EventArgs e)
    {
      if (!Page.IsPostBack)
      {
        mod_specDmtx.FormatoDtmx = "*";
        mod_trascFormDmtx.FormatoDtmx = "*";
        mod_trascPn2Part.FormatoDtmx = "*";
        mod_trascPn2Part.PartNumber = "*";
        mod_trascPn2Pn.FormatoDtmx = "*";
        mod_trascPn2Pn.PartNumberOut = "*";
      }
      mod_anagFormatiDtx.eh_ucev += Mod_anagFormatiDtx_eh_ucev;
      mod_trascPn2Pn.eh_ucev += Mod_trascPn2Pn_eh_ucev;
      mod_trascPn2Part.eh_ucev += Mod_trascPn2Part_eh_ucev;
    }

    private void Mod_trascPn2Part_eh_ucev(object sender, EventArgs e)
    {
      // se trovo evento select/reset mostro/nascondo dettagli...
      ucEvent evento = (ucEvent)e;
      switch (evento.tipoEvento)
      {
        case ucEvType.Delete:
          break;
        case ucEvType.Edit:
          break;
        case ucEvType.New:
          break;
        case ucEvType.Reset:
          mod_trascPn2Pn.PartNumberOut = "*";
          break;
        case ucEvType.ReqUpdateParent:
          break;
        case ucEvType.Selected:
          mod_trascPn2Pn.PartNumberOut = mod_trascPn2Part.PartNumberSel;
          break;
        default:
          break;
      }
    }

    private void Mod_trascPn2Pn_eh_ucev(object sender, EventArgs e)
    {
      //non faccio nulla
    }

    private void Mod_anagFormatiDtx_eh_ucev(object sender, EventArgs e)
    {
      // se trovo evento select/reset mostro/nascondo dettagli...
      ucEvent evento = (ucEvent)e;
      switch (evento.tipoEvento)
      {
        case ucEvType.Delete:
          break;
        case ucEvType.Edit:
          break;
        case ucEvType.New:
          break;
        case ucEvType.Reset:
          mod_specDmtx.FormatoDtmx = "*";
          mod_trascFormDmtx.FormatoDtmx = "*";
          mod_trascPn2Part.FormatoDtmx = "*";
          mod_trascPn2Pn.FormatoDtmx = "*";
          mod_trascPn2Pn.PartNumberOut = "*";
          mod_trascPn2Part.PartNumber = "*";
          break;
        case ucEvType.ReqUpdateParent:
          break;
        case ucEvType.Selected:
          mod_specDmtx.FormatoDtmx = mod_anagFormatiDtx.FormatoDtmxSel;
          mod_trascFormDmtx.FormatoDtmx = mod_anagFormatiDtx.FormatoDtmxSel;
          mod_trascPn2Part.FormatoDtmx = mod_anagFormatiDtx.FormatoDtmxSel;
          mod_trascPn2Pn.FormatoDtmx = mod_anagFormatiDtx.FormatoDtmxSel;
          mod_trascPn2Pn.PartNumberOut = "*";
          mod_trascPn2Part.PartNumber = "*";
          break;
        default:
          break;
      }
    }
  }
}