Exemplo n.º 1
0
        protected void InitializePage()
        {
            this.InitializeLanguage();
            this.CaricaRfVisibili();

            if (!this.IsNew)
            {
                int posizione = this.verificaSelezioneNota();
                if (posizione >= 0)
                {
                    DocsPaWR.NotaElenco nota = (DocsPaWR.NotaElenco) this.ListaNote[posizione];
                    this.ddlRf.Items.FindByValue(nota.idRegRf).Selected = true;
                    this.txt_desc.Text = nota.descNota;
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "dialog", "ajaxDialogModal('ErrorNoteDataentryModifying', 'error', '');", true);
                }
            }
        }
Exemplo n.º 2
0
        protected void BtnConfirm_Click(object sender, EventArgs e)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "reallowOp", "reallowOp();", true);

            if (string.IsNullOrEmpty(this.ddlRf.SelectedValue))
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "dialog", "ajaxDialogModal('WarningNoteDataentrySelectRF', 'warning', '');", true);
                return;
            }
            else if (string.IsNullOrEmpty(this.txt_desc.Text))
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "dialog", "ajaxDialogModal('WarningNoteDataentrySelectDesc', 'warning', '');", true);
                return;
            }
            else
            {
                DocsPaWR.NotaElenco nota   = new DocsPaWR.NotaElenco();
                DocsPaWR.InfoUtente infoUt = UserManager.GetInfoUser();
                string message             = "";
                bool   result = false;

                if (this.IsNew)
                {
                    nota.codRegRf = this.ddlRf.SelectedItem.Text.Substring(0, this.ddlRf.SelectedItem.Text.IndexOf("-") - 1);
                    nota.idRegRf  = this.ddlRf.SelectedItem.Value;
                    nota.descNota = this.txt_desc.Text;

                    result = NoteManager.InsertNotaInElenco(nota, out message);
                }
                else
                {
                    nota          = (DocsPaWR.NotaElenco) this.ListaNote[this.verificaSelezioneNota()];
                    nota.codRegRf = this.ddlRf.SelectedItem.Text.Substring(0, this.ddlRf.SelectedItem.Text.IndexOf("-") - 1);
                    nota.idRegRf  = this.ddlRf.SelectedItem.Value;
                    nota.descNota = this.txt_desc.Text;

                    result = NoteManager.ModNotaInElenco(nota, out message);
                }

                if (result)
                {
                    if (!string.IsNullOrEmpty(message))
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "dialog", "ajaxDialogModal('ErrCustom', 'error', '', '" + utils.FormatJs(message) + "');", true);
                    }
                    else
                    {
                        this.CloseMask(true);
                    }
                }
                else
                {
                    if (!string.IsNullOrEmpty(message))
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "dialog", "ajaxDialogModal('ErrCustom', 'error', '', '" + utils.FormatJs(message) + "');", true);
                    }
                    else
                    {
                        if (this.IsNew)
                        {
                            ScriptManager.RegisterStartupScript(this, this.GetType(), "dialog", "ajaxDialogModal('ErrorNoteDataentryInserting', 'error', '');", true);
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this, this.GetType(), "dialog", "ajaxDialogModal('ErrorNoteDataentryModifying', 'error', '');", true);
                        }
                    }
                    return;
                }
            }
        }
Exemplo n.º 3
0
 public static bool ModNotaInElenco(DocsPaWR.NotaElenco nota, out string message)
 {
     return(ws.ModNotaInElenco(UserManager.GetInfoUser(), nota, out message));
 }