Esempio n. 1
0
        protected void DocumentImgAddNewCorrispondent_Click(object sender, ImageClickEventArgs e)
        {
            Session.Remove("selCorrDaRubrica");

            DocsPaWR.Corrispondente corr = null;

            if (!string.IsNullOrEmpty(this.TxtCodeSender.Text) && !string.IsNullOrEmpty(this.TxtDescriptionSender.Text))
            {
                corr = AddressBookManager.getCorrispondenteRubrica(TxtCodeSender.Text, DocsPaWR.RubricaCallType.CALLTYPE_LISTE_DISTRIBUZIONE);

                if (corr != null && !string.IsNullOrEmpty(corr.systemId))
                {
                    if (!verificaDuplicazioneCorr(corr))
                    {
                        if (ViewState["dsCorr"] == null)
                        {
                            DataTable dt = new DataTable();
                            dt.Columns.Add("ID_DPA_CORR");
                            dt.Columns.Add("VAR_DESC_CORR");
                            dt.Columns.Add("VAR_COD_RUBRICA");
                            dt.Columns.Add("CHA_TIPO_IE");
                            dt.Columns.Add("CHA_DISABLED_TRASM");
                            dsCorrispondenti = new DataSet();
                            dsCorrispondenti.Tables.Add(dt);
                            ViewState.Add("dsCorr", dsCorrispondenti);
                        }

                        DataRow dr = ((DataSet)ViewState["dsCorr"]).Tables[0].NewRow();
                        dr[0] = corr.systemId;
                        dr[1] = corr.descrizione;
                        if (corr.disabledTrasm)
                        {
                            dr[4] = "1";
                        }
                        else
                        {
                            dr[4] = "0";
                        }
                        ((DataSet)ViewState["dsCorr"]).Tables[0].Rows.Add(dr);
                        gridViewResult.DataSource = ((DataSet)ViewState["dsCorr"]);
                        gridViewResult.DataBind();
                        TxtCodeSender.Text        = "";
                        TxtDescriptionSender.Text = "";
                        this.UpnlGrid.Update();
                    }
                    else
                    {
                        this.TxtCodeSender.Text        = "";
                        this.TxtDescriptionSender.Text = "";
                        this.UpnlGrid.Update();
                    }
                }
            }
        }
Esempio n. 2
0
 protected void TxtCodeSender_TextChanged(object sender, EventArgs e)
 {
     DocsPaWR.Corrispondente corr = null;
     if (TxtCodeSender.Text != "")
     {
         corr = AddressBookManager.getCorrispondenteRubrica(TxtCodeSender.Text, DocsPaWR.RubricaCallType.CALLTYPE_LISTE_DISTRIBUZIONE);
     }
     if (corr == null)
     {
         if (TxtCodeSender.Text != "")
         {
             string msg = "WarningDocumentCorrNotFound";
             ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "if (parent.fra_main) {parent.fra_main.ajaxDialogModal('" + msg.Replace("'", @"\'") + "', 'warning', '');} else {parent.ajaxDialogModal('" + msg.Replace("'", @"\'") + "', 'warning', '');}", true);
         }
         TxtDescriptionSender.Text = "";
     }
     else
     {
         TxtDescriptionSender.Text = corr.descrizione;
     }
 }