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); } } }
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; } } }
public static bool ModNotaInElenco(DocsPaWR.NotaElenco nota, out string message) { return(ws.ModNotaInElenco(UserManager.GetInfoUser(), nota, out message)); }