protected void BtnSaveDocument_Click(object sender, EventArgs e) { bool insert = CheckValues(); if (insert) { Policy policy = PopulatePolicy(); if (Request.QueryString["s"] != null && Request.QueryString["s"].ToString().Equals("new")) { //Inserimento di una nuova policy bool result = WsInstance.InserisciPolicyConservazione(policy); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "chiudi", "close_and_save('Y');", true); } else { //Modifica policy policy.system_id = Request.QueryString["id"].ToString(); bool result = WsInstance.ModifyPolicyConservazione(policy); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "chiudi", "close_and_save('Y');", true); } } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "no_stampa", "alert('Inserire il nome della Policy');", true); } }
protected void BtnSaveDocument_Click(object sender, EventArgs e) { bool insert = CheckValues(); if (insert) { Policy policy = PopulatePolicy(); if (Request.QueryString["s"] != null && Request.QueryString["s"].ToString().Equals("new")) { //Inserimento di una nuova policy bool result = WsInstance.InserisciPolicyConservazione(policy); // svuoto la cache per ricaricare la lista aggiornata try { bool svuotaCache = WsInstance.SvuotaCachePolicy(this.IdAmministrazione.ToString(), "D"); } catch (Exception ex) { } ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "chiudi", "close_and_save('Y');", true); } else { //Inserimento di una nuova policy policy.system_id = Request.QueryString["id"].ToString(); bool result = WsInstance.ModifyPolicyConservazione(policy); // svuoto la cache per ricaricare la lista aggiornata nel dettaglio try { bool svuotaCache = WsInstance.SvuotaCachePolicy(this.IdAmministrazione.ToString(), "D"); } catch (Exception ex) { } ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "chiudi", "close_and_save('Y');", true); } } else { if (string.IsNullOrEmpty(this.txt_nome.Text)) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "no_project", "alert('Inserire un nome per la Policy');", true); } else { if (!string.IsNullOrEmpty(this.txtCodFascicolo.Text) && !string.IsNullOrEmpty(this.txtDescFascicolo.Text) && string.IsNullOrEmpty(this.chk_tipo_class.SelectedValue)) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "no_project", "alert('Seleziona un tipo di ricerca per la classificazione');", true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "no_project", "alert('Selezionare almeno un criterio per la creazione della Policy');", true); } } } }
protected void BtnSaveDocument_Click(object sender, EventArgs e) { bool insert = CheckValues(); if (insert) { Policy policy = PopulatePolicy(); if (Request.QueryString["s"] != null && Request.QueryString["s"].ToString().Equals("new")) { //Inserimento di una nuova policy bool result = WsInstance.InserisciPolicyConservazione(policy); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "chiudi", "close_and_save('Y');", true); } else { //Inserimento di una nuova policy policy.system_id = Request.QueryString["id"].ToString(); bool result = WsInstance.ModifyPolicyConservazione(policy); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "chiudi", "close_and_save('Y');", true); } } else { if (string.IsNullOrEmpty(this.txt_nome.Text)) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "no_project", "alert('Inserire un nome per la Policy');", true); } else { if (string.IsNullOrEmpty(this.txtCodFascicolo.Text) || string.IsNullOrEmpty(txtDescFascicolo.Text)) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "no_project", "alert('Inserire un codice di classifica');", true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "no_project", "alert('Selezionare almeno un criterio per la creazione della Policy');", true); } } } }