Beispiel #1
0
        protected void btn_AggiungiContesto_Click(object sender, EventArgs e)
        {
            //Verifico che tutti i campi siano stati inseriti
            if (string.IsNullOrEmpty(this.txt_tipoContesto.Text) || string.IsNullOrEmpty(this.txt_Nome.Text) ||
                string.IsNullOrEmpty(this.txt_famiglia.Text) || string.IsNullOrEmpty(this.txt_versione.Text))
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "alert('Tutti i campi sono obbligatori!');", true);
            }
            else
            {
                DocsPAWA.DocsPaWR.ContestoProcedurale contesto = new DocsPaWR.ContestoProcedurale();

                contesto.TIPO_CONTESTO_PROCEDURALE = this.txt_tipoContesto.Text;
                contesto.NOME     = this.txt_Nome.Text;
                contesto.FAMIGLIA = this.txt_famiglia.Text;
                contesto.VERSIONE = this.txt_versione.Text;

                DocsPAWA.AdminTool.Manager.SessionManager session = new DocsPAWA.AdminTool.Manager.SessionManager();
                DocsPAWA.DocsPaWR.InfoUtente infoUtente           = session.getUserAmmSession();

                if (ProfilazioneDocManager.InsertContestoProcedurale(contesto, infoUtente))
                {
                    LoadGridContestoProcedurale();
                    this.ClearField();
                    this.pnlNuovoContesto.Visible = false;
                    this.btnNuovoContesto.Enabled = true;

                    this.upButtons.Update();
                    this.UpNuovoContesto.Update();
                    this.UpDgContestoProcedurale.Update();
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "alert('Si è verificato un errore durante il salvataggio dei dati');", true);
                }
            }
        }