/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.img_logo.Click += new System.Web.UI.ImageClickEventHandler(this.img_logo_Click); this.btn_logout.Click += new System.Web.UI.ImageClickEventHandler(this.btn_logout_Click); this.Load += new System.EventHandler(this.Page_Load); this.PreRender += new System.EventHandler(this.testata317_PreRender); this.Init += new EventHandler(testata320_Init); this.btn_help.Click += new System.Web.UI.ImageClickEventHandler(this.btn_help_Click); // Visualizzazione del pulsante del centro notifiche bool isEnabledNC = NotificationCenterHelper.IsUserEnabledToViewNotificationsCenter(this); this.imgNotificationCenter.Visible = isEnabledNC; this.imgNotificationCenter.Enabled = isEnabledNC; if (isEnabledNC) { int itemCount = 0; try { itemCount = NotificationCenterHelper.CountNotViewedItems(Int32.Parse(UserManager.getInfoUtente().idPeople), UserManager.getInfoAmmCorrente(UserManager.getInfoUtente().idAmministrazione).Codice); } catch (Exception e) { } this.imgNotificationCenter.AlternateText = String.Format("Centro notifiche ({0})", itemCount.ToString()); } }
/// <summary> /// Metodo per l'impostazione di un item come visto /// </summary> protected void imgDelete_Click(object sender, ImageClickEventArgs e) { ImageButton convertedSource = sender as ImageButton; if (convertedSource != null) { NotificationCenterHelper.SetItemAsViewed( Int32.Parse(convertedSource.CommandArgument), Int32.Parse(UserManager.getInfoUtente().idPeople), UserManager.getInfoAmmCorrente(UserManager.getInfoUtente().idAmministrazione).Codice); } this.Initialize(); this.SearchAndShowItems(); }
protected void Page_Load(object sender, EventArgs e) { Response.Expires = -1; // Se è la prima volta che viene caricato il controllo, viene eseguita la // procedura di inizializzatione del controollo if (!IsPostBack) { this.Initialize(); } // Caricamento degli item ancora non visualizzati dall'utente, solo se l'utente è abilitato alla visualizzazione if (NotificationCenterHelper.IsUserEnabledToViewNotificationsCenter(this.Page)) { this.SearchAndShowItems(); } }
/// <summary> /// Metodo per la ricerca e la visualizzazione degli item non ancora visti dall'utente /// </summary> private void SearchAndShowItems() { // Numero di elementi totali da visualizzare int itemCount = 0; // Ricerca degli elementi InfoUtente userInfo = UserManager.getInfoUtente(this.Page); List <Item> notificationCenterItems = null; try { notificationCenterItems = NotificationCenterHelper.LoadItemsNotViewedByUser( Int32.Parse(userInfo.idAmministrazione), UserManager.getInfoAmmCorrente(UserManager.getInfoUtente().idAmministrazione).Codice, Int32.Parse(userInfo.idPeople), this.PageNumber, this.PageSize, out itemCount); } catch (Exception e) { } // Visualizzazione degli elemnti trovati this.dlNotificationCenter.DataSource = notificationCenterItems; this.dlNotificationCenter.DataBind(); // Gestione visualizzazione frecce per lo scorrimento dei risultati in avanti ed indietro // in base al numero di elementi ed al numero di pagina attuale this.imgPreviousPage.Enabled = this.PageNumber > 1; this.imgNextPage.Enabled = (itemCount > (this.PageNumber * this.PageSize)); // Impostazione dell'immagine per le due frecce this.imgPreviousPage.ImageUrl = !this.imgPreviousPage.Enabled ? String.Format(URL_LEFT_ARROW, String.Empty) : String.Format(URL_LEFT_ARROW, "_black"); this.imgNextPage.ImageUrl = !this.imgNextPage.Enabled ? String.Format(URL_RIGHT_ARROW, String.Empty) : String.Format(URL_RIGHT_ARROW, "_black"); // Forzatura dell'aggiornamento dei due update panel con le frecce per fare in modo che // rispecchino lo stato attuale di abilitazione upLeftArrow.Update(); upRightArrow.Update(); }
/// <summary> /// Ricerca degli item e visualizzazione dei risultati nel data grid /// </summary> protected void btnSearch_Click(object sender, EventArgs e) { // Conversione dei valori inseriti nei filtri DateTime lowDate, hightDate; int lowNum, maxNum; DateTime.TryParse(this.txtRecDateFrom.Text, out lowDate); DateTime.TryParse(this.txtRecDateTo.Text, out hightDate); Int32.TryParse(this.txtProtoNumFrom.Text, out lowNum); Int32.TryParse(this.txtProtoNumTo.Text, out maxNum); List <Item> items = new List <Item>(); // Validazione dei filtri ed eventuale ricerca o segnalazione di errore if (this.ValidateSearchFilters()) { items = NotificationCenterHelper.SearchItem( Int32.Parse(UserManager.getInfoUtente(this).idPeople), lowNum > 0, lowNum, maxNum > lowNum ? maxNum : lowNum, lowDate > new DateTime(1972, 01, 01), lowDate, hightDate > lowDate ? hightDate : lowDate, this.ddlEvent.SelectedIndex != 0, this.ddlEvent.SelectedValue == "M" ? "consegna" : "eccezione", UserManager.getInfoAmmCorrente(UserManager.getInfoUtente().idAmministrazione).Codice); } if (items.Count == 0) { items = null; string noItemText = "Nessun risultato trovato."; ScriptManager.RegisterStartupScript(this, this.GetType(), "NoItems", String.Format("alert('{0}');", noItemText.ToString()), true); } this.dgResult.DataSource = items; this.dgResult.DataBind(); }
/// <summary> /// Metodo per l'analisi di una richiesta di generazione di una ricevuta di eccezione o di eliminazione /// di un documento /// </summary> /// <param name="senderRecordInfo">Informazioni sul protocollo mittente</param> /// <param name="receiverRecordInfo">Informazioni sul protocollo destinatario</param> /// <param name="reason">Ragione della cancellazione del documento o dettaglio errore</param> /// <param name="receiverUrl">Url del mittente della spedizione</param> /// <param name="operation">Tipo di ricevuta da generare</param> /// <param name="receiverCode">Codice del destinatario per cui generare la ricevuta</param> public void AnalyzeDocumentDroppedOrErrorMessageProof( RecordInfo senderRecordInfo, RecordInfo receiverRecordInfo, String reason, String receiverUrl, OperationDiscriminator operation, String receiverCode) { try { SimplifiedInteroperabilityRecordDroppedAndExceptionManager.SaveProofData( new DocsPaVO.Interoperabilita.Semplificata.RecordInfo() { AdministrationCode = senderRecordInfo.AdministrationCode, AOOCode = senderRecordInfo.AOOCode, RecordDate = senderRecordInfo.RecordDate, RecordNumber = senderRecordInfo.RecordNumber }, new DocsPaVO.Interoperabilita.Semplificata.RecordInfo() { AdministrationCode = receiverRecordInfo.AdministrationCode, AOOCode = receiverRecordInfo.AOOCode, RecordDate = receiverRecordInfo.RecordDate, RecordNumber = receiverRecordInfo.RecordNumber }, reason, receiverUrl, operation == OperationDiscriminator.Drop, receiverCode); // Se l'operazione richiesta non è la segnalazione di eliminazione di un documento // viene inviato un item al centro notifiche if (operation != OperationDiscriminator.Drop && NotificationCenterHelper.IsEnabled(OrganigrammaManager.GetIDAmm(senderRecordInfo.AdministrationCode))) { // Recupero dell'id del ruolo creatore del documento e dell'id del documento String userId = BusinessLogic.Documenti.DocManager.GetDocumentAttribute( senderRecordInfo.RecordDate, senderRecordInfo.RecordNumber, senderRecordInfo.AOOCode, senderRecordInfo.AdministrationCode, DocsPaDB.Query_DocsPAWS.Documenti.DocumentAttribute.UserId); String documentId = BusinessLogic.Documenti.DocManager.GetDocumentAttribute( senderRecordInfo.RecordDate, senderRecordInfo.RecordNumber, senderRecordInfo.AOOCode, senderRecordInfo.AdministrationCode, DocsPaDB.Query_DocsPAWS.Documenti.DocumentAttribute.IdProfile); NotificationCenterHelper.InsertItem( receiverCode, reason, "Notifica di eccezione", Convert.ToInt32(userId), "IS", Int32.Parse(documentId), Int32.Parse(senderRecordInfo.RecordNumber), senderRecordInfo.AdministrationCode); } } catch (Exception e) { throw new FaultException <InteroperabilityFault>( new InteroperabilityFault { Exceptions = new List <Exception>() { e } }, new FaultReason(e.Message)); } }