Exemple #1
0
        /// <summary>
        /// Salvataggio dati della chiave
        /// </summary>
        private void Save()
        {
            DocsPaWR.ChiaveConfigurazione chiaveConfig = new DocsPAWA.DocsPaWR.ChiaveConfigurazione();
            this.RefreshChiaveConfigFromUI(chiaveConfig);

            DocsPaWR.ValidationResultInfo result = null;

            result = this.UpdateChiaveConfig(ref chiaveConfig);

            if (!result.Value)
            {
                this.ShowValidationMessage(result);
            }
            else
            {
                // Inserimento
                this.lbl_tit.Visible = true;

                // Pulizia della cache
                //pulizia della cache sul backend e sul frontend
                this.Clear(chiaveConfig.IDAmministrazione);
                //ricalcolo delle chiavi
                this.FillListChiaviConfig();
            }
        }
Exemple #2
0
        /// <summary>
        /// Elimina un documento dal fascicolo
        /// </summary>
        /// <param name="key">Chiave del record da elimnare</param>
        private void deleteDocument(int key)
        {
            Hashtable hashDoc = FascicoliManager.getHashDocProtENonProt(this);

            if (hashDoc != null)
            {
                DocsPaWR.InfoDocumento infoDoc = (DocsPAWA.DocsPaWR.InfoDocumento)hashDoc[key];
                if (infoDoc != null)
                {
                    string          msg              = string.Empty;
                    DocsPaWR.Folder fold             = FascicoliManager.getFolderSelezionato(this);
                    string          valoreChiaveFasc = utils.InitConfigurationKeys.GetValue(UserManager.getInfoUtente().idAmministrazione, "FE_FASC_RAPIDA_REQUIRED");
                    if (string.IsNullOrEmpty(valoreChiaveFasc))
                    {
                        valoreChiaveFasc = "false";
                    }
                    DocsPAWA.DocsPaWR.ValidationResultInfo result = FascicoliManager.deleteDocFromFolder(this, fold, infoDoc.idProfile, valoreChiaveFasc, out msg);
                    if (result != null && result.BrokenRules.Length > 0)
                    {
                        DocsPAWA.DocsPaWR.BrokenRule br = (DocsPAWA.DocsPaWR.BrokenRule)result.BrokenRules[0];
                        ClientScript.RegisterStartupScript(this.GetType(), "sottonumeroSuccessivo", "alert('" + br.Description + "');", true);
                        return;
                    }
                    if (msg != string.Empty)
                    {
                        Response.Write("<script>alert('" + msg + "')</script>");
                        return;
                    }
                }
            }

            // rimuove la sessione della chiave che specifica il record da eliminare
            Page.Session.Remove("key");
        }
Exemple #3
0
        /// <summary>
        /// Salvataggio dati del mezzo spedizione corrente
        /// </summary>
        private void Save()
        {
            DocsPaWR.MezzoSpedizione m_sped = new DocsPAWA.DocsPaWR.MezzoSpedizione();

            DocsPaWR.ValidationResultInfo result = null;

            bool insertMode = this.OnInsertMode();

            if (!this.txt_descrizione.Text.Equals(""))
            {
                m_sped.Descrizione = this.txt_descrizione.Text;
                // m_sped.chaTipoCanale = this.txt_chatipocanale.Text;
                m_sped.chaTipoCanale = this.txt_descrizione.Text.Substring(0, 1).ToUpper();
            }
            else
            {
                this.RegisterClientScript("AlertDescrizione", "alert('Inserire una descrizione per il mezzo di spedizione');");
                return;
            }

            if (insertMode)
            {
                result = this.InsertMezzoSpedizione(ref m_sped);
                if (!result.Value)
                {
                    this.RegisterClientScript("alert", "alert(\"Descrizione già presente\");");
                }
                else
                {
                    this.FillListMezziSpedizione();
                    this.lbl_tit.Visible = true;
                    // Predisposizione per un nuovo inserimento
                    this.SetInsertMode();
                }
            }
            else
            {
                string idMezzo = this.dg_mezzi.SelectedItem.Cells[0].Text.ToString();
                m_sped             = this.GetMezzoSpedizione(idMezzo);
                m_sped.Descrizione = this.txt_descrizione.Text;
                // m_sped.chaTipoCanale = this.txt_chatipocanale.Text;
                m_sped.chaTipoCanale = this.txt_descrizione.Text.Substring(0, 1).ToUpper();
                result = this.UpdateMezzoSpedizione(ref m_sped);
                if (!result.Value)
                {
                    this.RegisterClientScript("alert", "alert(\"Modifica non effettuata\");");
                }
                else
                {
                    // Aggiornamento
                    this.RefreshGridItem(m_sped);
                    this.ClearData();
                    this.pnl_info.Visible       = false;
                    this.lbl_tit.Visible        = true;
                    this.dg_mezzi.SelectedIndex = -1;
                }
            }
        }
Exemple #4
0
        /// <summary>
        /// Visualizzazione messaggi di validazione
        /// </summary>
        /// <param name="validationResult"></param>
        private void ShowValidationMessage(DocsPAWA.DocsPaWR.ValidationResultInfo validationResult)
        {
            // Visualizzazione delle regole di business non valide
            bool    warningMessage;
            Control firstInvalidControl;

            string validationMessage = this.GetValidationMessage(validationResult, out firstInvalidControl, out warningMessage);

            this.RegisterClientScript("ShowValidationMessage", "ShowValidationMessage('" + validationMessage + "'," + warningMessage.ToString().ToLower() + ");");

            if (firstInvalidControl != null)
            {
                this.SetFocus(firstInvalidControl);
            }
        }
Exemple #5
0
        /// <summary>
        /// Salvataggio dati del tipo ruolo corrente
        /// </summary>
        private void Save()
        {
            DocsPaWR.OrgTipoRuolo tipoRuolo = new DocsPAWA.DocsPaWR.OrgTipoRuolo();
            this.RefreshTipoRuoloFromUI(tipoRuolo);

            DocsPaWR.ValidationResultInfo result = null;

            this.SetIdAmministrazione(tipoRuolo);

            bool insertMode = this.OnInsertMode();

            if (insertMode)
            {
                result = this.InsertTipoRuolo(ref tipoRuolo);
            }
            else
            {
                result = this.UpdateTipoRuolo(ref tipoRuolo);
            }

            if (!result.Value)
            {
                this.ShowValidationMessage(result);
            }
            else if (!insertMode)
            {
                // Aggiornamento
                this.RefreshGridItem(tipoRuolo);

                this.ClearData();

                this.pnl_info.Visible = false;
                this.lbl_tit.Visible  = true;

                this.dg_ruoli.SelectedIndex = -1;
            }
            else
            {
                // Inserimento
                this.lbl_tit.Visible = true;

                // Refresh lista registri
                this.FillListTipiRuolo();

                // Predisposizione per un nuovo inserimento
                this.SetInsertMode();
            }
        }
Exemple #6
0
        private string GetValidationMessage(DocsPAWA.DocsPaWR.ValidationResultInfo validationResult,
                                            out Control firstInvalidControl,
                                            out bool warningMessage)
        {
            string retValue     = string.Empty;
            bool   errorMessage = false;

            firstInvalidControl = null;

            foreach (DocsPAWA.DocsPaWR.BrokenRule rule in validationResult.BrokenRules)
            {
                if (!errorMessage && rule.Level == DocsPAWA.DocsPaWR.BrokenRuleLevelEnum.Error)
                {
                    errorMessage = true;
                }

                if (retValue != string.Empty)
                {
                    retValue += "\\n";
                }

                retValue += " - " + rule.Description;

                if (firstInvalidControl == null)
                {
                    firstInvalidControl = this.GetBusinessRuleControl(rule.ID);
                }
            }

            if (errorMessage)
            {
                retValue = "Sono state riscontrate le seguenti anomalie:\\n\\n" + retValue;
            }
            else
            {
                retValue = "Attenzione:\\n\\n" + retValue;
            }

            warningMessage = !errorMessage;

            return(retValue.Replace("'", "\\'"));
        }
Exemple #7
0
        private void Save()
        {
            bool insertMode = this.OnInsertMode();

            DocsPAWA.DocsPaWR.ValidationResultInfo   result  = null;
            DocsPAWA.DocsPaWR.OrgRagioneTrasmissione ragione = new DocsPAWA.DocsPaWR.OrgRagioneTrasmissione();

            this.RefreshRagioneTrasmissioneFromUI(ragione);

            if (insertMode)
            {
                result = this.InsertRagioneTrasmissione(ref ragione);
            }
            else
            {
                result = this.UpdateRagioneTrasmissione(ref ragione);
            }

            if (!result.Value)
            {
                this.ShowValidationMessage(result);
            }
            else if (!insertMode)
            {
                // Aggiornamento
                this.RefreshGridItem(ragione);

                this.ClearData();

                this.pnl_info.Visible = false;
                this.lbl_cod.Visible  = true;
                this.impostaBlocchiRispettoCessione(false);
            }
            else
            {
                // Refresh lista ragioni trasmissione
                this.FillGridRagioniTrasmissione();

                // Predisposizione per un nuovo inserimento
                this.SetInsertMode();
            }
        }
Exemple #8
0
        private void btn_ok_Click(object sender, System.EventArgs e)
        {
            if (Session["regToModify"] != null)
            {
                var orgRegistro = ((OrgRegistro)Session["regToModify"]);

                if (checkField(orgRegistro.Mail.Password))
                {
                    orgRegistro.Mail.Password = txtNuovaPass.Text;
                    DocsPAWA.DocsPaWR.ValidationResultInfo result = null;
                    result = this.UpdateRegistro(ref orgRegistro);
                    if (result.Value)
                    {
                        string funct = "alert('Modifica Password avvenuta con successo');window.close();";
                        Session.Remove("regToModify");
                        Response.Write("<script> " + funct + "</script>");
                    }
                }
            }
        }
Exemple #9
0
        /// <summary>
        /// Cancellazione ragione trasmissione
        /// </summary>
        private void Delete()
        {
            DocsPAWA.DocsPaWR.OrgRagioneTrasmissione ragione = new DocsPAWA.DocsPaWR.OrgRagioneTrasmissione();
            this.RefreshRagioneTrasmissioneFromUI(ragione);

            DocsPAWA.DocsPaWR.ValidationResultInfo result = this.DeleteRagioneTrasmissione(ref ragione);

            if (result.Value)
            {
                this.FillGridRagioniTrasmissione();

                pnl_info.Visible = false;
                this.ClearData();
                this.impostaBlocchiRispettoCessione(false);
            }
            else
            {
                this.ShowValidationMessage(result);
            }
        }
Exemple #10
0
        /// <summary>
        /// Cancellazione mezzo di spedizione
        /// </summary>
        private void Delete()
        {
            if (!this.dg_mezzi.SelectedItem.Cells[GRID_COL_ID].Text.Equals(""))
            {
                DocsPaWR.MezzoSpedizione m_sped = new DocsPAWA.DocsPaWR.MezzoSpedizione();
                m_sped = this.GetMezzoSpedizione(this.dg_mezzi.SelectedItem.Cells[GRID_COL_ID].Text.ToString());
                DocsPaWR.ValidationResultInfo result = this.DeleteMezzoSpedizione(ref m_sped);

                if (result.Value)
                {
                    this.FillListMezziSpedizione();
                    pnl_info.Visible = false;
                    this.ClearData();
                    dg_mezzi.SelectedIndex = -1;
                }
                else
                {
                    this.RegisterClientScript("alert2", "alert('La cancellazione mezzo di spedizione non è avvenuta correttamente');");
                }
            }
        }
Exemple #11
0
        /// <summary>
        /// Cancellazione registro
        /// </summary>
        private void Delete()
        {
            DocsPaWR.OrgTipoRuolo tipoRuolo = new DocsPAWA.DocsPaWR.OrgTipoRuolo();
            this.RefreshTipoRuoloFromUI(tipoRuolo);

            DocsPaWR.ValidationResultInfo result = this.DeleteTipoRuolo(ref tipoRuolo);

            if (result.Value)
            {
                this.FillListTipiRuolo();

                pnl_info.Visible = false;

                this.ClearData();

                dg_ruoli.SelectedIndex = -1;
            }
            else
            {
                this.ShowValidationMessage(result);
            }
        }
Exemple #12
0
 public static DocsPAWA.DocsPaWR.ValidationResultInfo ExtAppAddUte(String idApplicazione, String idUtente)
 {
     AmmUtils.WebServiceLink ws = new AmmUtils.WebServiceLink();
     DocsPAWA.DocsPaWR.ValidationResultInfo retValue = docsPaWS.ExtAppAddUte(idApplicazione, idUtente);
     return(retValue);
 }