protected void btn_ok_Click(object sender, EventArgs e) { if (!String.IsNullOrEmpty(txt_note_annullamento.Text) && !String.IsNullOrEmpty(idOggetto)) { //Annullamento ProfilazioneDocManager.AnnullaContatoreDiRepertorio(idOggetto, docNumber, this); DocsPaWR.SchedaDocumento documentoSelezionato = DocumentManager.getDocumentoSelezionato(this); documentoSelezionato.template = ProfilazioneDocManager.getTemplateDettagli(docNumber, this); DocumentManager.setDocumentoSelezionato(documentoSelezionato); //Storicizzazione DocsPaWR.OggettoCustom oggettoCustom = documentoSelezionato.template.ELENCO_OGGETTI.Where(oggetto => oggetto.SYSTEM_ID.ToString().Equals(idOggetto)).FirstOrDefault(); DocsPaWR.Storicizzazione storico = new DocsPaWR.Storicizzazione(); storico.ID_TEMPLATE = documentoSelezionato.template.SYSTEM_ID.ToString(); storico.DATA_MODIFICA = oggettoCustom.DATA_ANNULLAMENTO; storico.ID_PROFILE = documentoSelezionato.docNumber; storico.ID_OGG_CUSTOM = oggettoCustom.SYSTEM_ID.ToString(); storico.ID_PEOPLE = UserManager.getInfoUtente(this).idPeople; storico.ID_RUOLO_IN_UO = UserManager.getInfoUtente(this).idCorrGlobali; storico.DESC_MODIFICA = txt_note_annullamento.Text.Replace("'", "''"); ProfilazioneDocManager.Storicizza(storico, this); ClientScript.RegisterStartupScript(this.GetType(), "close", "window.close();", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('La motivazione è obbligatoria.');", true); } }
public static void Storicizza(DocsPaWR.Storicizzazione storico) { try { docsPaWS.Storicizza(storico); } catch (System.Exception ex) { UIManager.AdministrationManager.DiagnosticError(ex); } }
protected void AbortCounterBtnOk_Click(object sender, EventArgs e) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "function", "reallowOp();", true); if (!String.IsNullOrEmpty(this.TxtTextAborCounter.Text) && !String.IsNullOrEmpty(this.IdObjectCustom)) { SchedaDocumento doc = DocumentManager.getSelectedRecord(); string idOggetto = this.IdObjectCustom.Replace("btn_a_", string.Empty); //Annullamento ProfilerDocManager.AnnullaContatoreDiRepertorio(idOggetto, doc.docNumber); Templates tempTemp = ProfilerDocManager.getTemplateDettagli(doc.docNumber); //Storicizzazione DocsPaWR.OggettoCustom oggettoCustom = tempTemp.ELENCO_OGGETTI.Where(oggetto => oggetto.SYSTEM_ID.ToString().Equals(idOggetto)).FirstOrDefault(); DocsPaWR.Storicizzazione storico = new DocsPaWR.Storicizzazione(); storico.ID_TEMPLATE = doc.template.SYSTEM_ID.ToString(); storico.DATA_MODIFICA = oggettoCustom.DATA_ANNULLAMENTO; storico.ID_PROFILE = doc.docNumber; storico.ID_OGG_CUSTOM = oggettoCustom.SYSTEM_ID.ToString(); storico.ID_PEOPLE = UserManager.GetInfoUser().idPeople; storico.ID_RUOLO_IN_UO = UserManager.GetInfoUser().idCorrGlobali; storico.DESC_MODIFICA = this.TxtTextAborCounter.Text.Replace("'", "''"); ProfilerDocManager.Storicizza(storico); for (int i = 0; i < doc.template.ELENCO_OGGETTI.Length; i++) { if (doc.template.ELENCO_OGGETTI[i].SYSTEM_ID.ToString().Equals(idOggetto)) { doc.template.ELENCO_OGGETTI[i] = oggettoCustom; break; } } DocumentManager.setSelectedRecord(doc); Response.Write("<html><body><script type=\"text/javascript\">parent.closeAjaxModal('AbortCounter', 'up');</script></body></html>"); Response.End(); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "alert", "alert('La motivazione è obbligatoria.');", true); } }