Exemplo n.º 1
0
        protected void btnConfirm_Click(object sender, EventArgs e)
        {
            string systemIdContesto = string.Empty;

            foreach (var item in this.dg_ContestoProcedurale.Items)
            {
                if (((RadioButton)(((DataGridItem)item).FindControl("rbSelezioneContesto"))).Checked)
                {
                    systemIdContesto = ((HiddenField)(((DataGridItem)item).FindControl("System_id"))).Value;
                    break;
                }
            }
            if (!string.IsNullOrEmpty(systemIdContesto))
            {
                DocsPAWA.DocsPaWR.Templates template = Session["template"] as DocsPAWA.DocsPaWR.Templates;

                DocsPAWA.AdminTool.Manager.SessionManager session = new DocsPAWA.AdminTool.Manager.SessionManager();
                DocsPAWA.DocsPaWR.InfoUtente infoUtente           = session.getUserAmmSession();
                if (ProfilazioneDocManager.UpdateAssociazioneTemplateContestoProcedurale(template.SYSTEM_ID.ToString(), systemIdContesto, infoUtente))
                {
                    template.ID_CONTESTO_PROCEDURALE = systemIdContesto;
                    System.Web.HttpContext.Current.Session["template"] = template;
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Close", "window.close();", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "alert('Si è verificato un errore durante il salvataggio dei dati');", true);
                }
            }
        }