Exemplo n.º 1
0
        protected void SelectKeywordBtnOk_Click(object sender, EventArgs e)
        {
            try {
                DocsPaWR.DocumentoParolaChiave[] listaDocParoleChiave = new DocsPaWR.DocumentoParolaChiave[0];;

                for (int i = 0; i < this.ListParoleChiave.Items.Count; i++)
                {
                    if (this.ListParoleChiave.Items[i].Selected)
                    {
                        DocsPaWR.DocumentoParolaChiave docParoleChiave = new DocsPaWR.DocumentoParolaChiave();
                        docParoleChiave.systemId          = this.ListParoleChiave.Items[i].Value;
                        docParoleChiave.descrizione       = this.ListParoleChiave.Items[i].Text;
                        docParoleChiave.idAmministrazione = UserManager.GetInfoUser().idAmministrazione;
                        listaDocParoleChiave = utils.addToArrayParoleChiave(listaDocParoleChiave, docParoleChiave);
                    }
                }

                DocsPaWR.SchedaDocumento schedaDocumento = DocumentManager.getSelectedRecord();
                if (schedaDocumento != null)
                {
                    schedaDocumento.paroleChiave             = addParoleChiaveToDoc(schedaDocumento, listaDocParoleChiave);
                    schedaDocumento.daAggiornareParoleChiave = true;
                }

                Session["ReturnValuePopup"] = listaDocParoleChiave;

                DocumentManager.setSelectedRecord(schedaDocumento);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "SelectKeyword", "parent.closeAjaxModal('SelectKeyword', 'up', parent);", true);
            }
            catch (System.Exception ex)
            {
                UIManager.AdministrationManager.DiagnosticError(ex);
                return;
            }
        }
Exemplo n.º 2
0
        private bool listaContains(DocsPaWR.DocumentoParolaChiave[] lista, DocsPaWR.DocumentoParolaChiave el)
        {
            bool trovato = false;

            if (lista != null)
            {
                for (int i = 0; i < lista.Length; i++)
                {
                    if (lista[i].systemId.Equals(el.systemId))
                    {
                        trovato = true;
                        break;
                    }
                }
            }
            return(trovato);
        }
Exemplo n.º 3
0
        protected void AddKeywordBtnOk_Click(object sender, EventArgs e)
        {
            try {
                string msg;
                DocsPaWR.DocumentoParolaChiave parolaC = new DocsPaWR.DocumentoParolaChiave();

                //controllo sull'inserimento della parola chiave
                if (this.NewKeywordText.Text.Equals("") || this.NewKeywordText.Text == null)
                {
                    //string msg = "Inserire il valore: parola chiave.";
                    msg = "WarningAddKeywordNotFound";
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "if (parent.fra_main) {parent.fra_main.ajaxDialogModal('" + msg.Replace("'", @"\'") + "', 'warning', '');} else {parent.parent.ajaxDialogModal('" + msg.Replace("'", @"\'") + "', 'warning', '');}", true);

                    return;
                }

                parolaC.descrizione = this.NewKeywordText.Text.ToUpper();
                parolaC             = DocumentManager.addParolaChiave(this, parolaC);

                if (parolaC != null)
                {
                    // string msg = "Operazione effettuata con successo.";
                    msg = "ConfermAddKeywordOk";
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "if (parent.fra_main) {parent.fra_main.ajaxDialogModal('" + msg.Replace("'", @"\'") + "', 'check', '');} else {parent.parent.ajaxDialogModal('" + msg.Replace("'", @"\'") + "', 'check', '');}", true);
                    keyWordAdd = parolaC.systemId;
                    this.NewKeywordText.Text = "";
                }
                else
                {
                    // string msg = "Attenzione, parola chiave già presente.";
                    msg = "WarningAddKeywordFound";
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "if (parent.fra_main) {parent.fra_main.ajaxDialogModal('" + msg.Replace("'", @"\'") + "', 'warning', '');} else {parent.parent.ajaxDialogModal('" + msg.Replace("'", @"\'") + "', 'warning', '');}", true);
                }
            }
            catch (System.Exception ex)
            {
                UIManager.AdministrationManager.DiagnosticError(ex);
                return;
            }
        }