Ejemplo n.º 1
0
        protected void BtnExecTest_Click(object sender, EventArgs e)
        {
            if (this.VerificaCampi(false))
            {
                DocsPAWA.DocsPaWR.PolicyPARER policy = this.PopolaOggettoPolicy();

                string result = this.WsInstance.GetCountDocumentiFromPolicy(policy, this.IdAmministrazione.ToString());
                if (!string.IsNullOrEmpty(result))
                {
                    string msg = string.Format("Sono stati ottenuti {0} risultati utilizzando i parametri di configurazione impostati", result);
                    if (!string.IsNullOrEmpty(this.LimiteDocVersamento))
                    {
                        int limite = 0;
                        if (Int32.TryParse(this.LimiteDocVersamento, out limite))
                        {
                            if (Convert.ToInt32(result) > limite)
                            {
                                msg = msg + "\\n" + "ATTENZIONE: il limite massimo di documenti versabili per l\\'amministrazione è " + limite;
                            }
                        }
                    }
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "test_result", "alert('" + msg + "');", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "test_error", "alert('Attenzione, si è verificato un errore');", true);
                }
            }
        }
Ejemplo n.º 2
0
        protected void BtnSavePolicy_Click(object sender, EventArgs e)
        {
            // Controllo e validazione campi
            bool verifica = this.VerificaCampi(true);

            if (verifica)
            {
                DocsPAWA.DocsPaWR.PolicyPARER policy = this.PopolaOggettoPolicy();

                if (Request.QueryString["s"] != null && Request.QueryString["s"].ToString().Equals("new"))
                {
                    // inserisco una nuova policy
                    if (this.WsInstance.InsertNewPolicyPARER(policy, this.GetInfoUser()))
                    {
                        if (Session["refreshGrid"] != null)
                        {
                            Session.Add("refreshGrid", "1");
                        }
                        else
                        {
                            Session["refreshGrid"] = "1";
                        }

                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "chiudi", "close_and_save('Y');", true);
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "insert_error", "alert('Errore nell\\' inserimento della policy');", true);
                    }
                }
                else
                {
                    if (Request.QueryString["id"] != null && !string.IsNullOrEmpty(Request.QueryString["id"]))
                    {
                        policy.id = Request.QueryString["id"];
                    }
                    if (this.WsInstance.UpdatePolicyPARER(policy, this.GetInfoUser()))
                    {
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "chiudi", "close_and_save('Y');", true);
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "update_error", "alert('Errore nel salvataggio della policy');", true);
                    }
                }
            }
        }