protected void RegistersBtnRegisterModify_Click(object sender, EventArgs e) { try { string email = (this.GrdRegisters.SelectedRow.FindControl("DdlEmailRegister") as DropDownList).SelectedValue; List <DocsPaWR.InfoCheckMailbox> listCheckMailbox = CheckMailboxManager.InfoCheckMailbox(new List <string>() { email }); if ((from checkMailBox in listCheckMailbox where checkMailBox.Concluded.Equals("0") select checkMailBox).Count() > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "if (parent.fra_main) {parent.fra_main.ajaxDialogModal('WarningRegisterModifyPass', 'warning', '');} else {parent.ajaxDialogModal('WarningRegisterModifyPass', 'warning', '');}", true); return; } else { SelectedRegister.email = email; ScriptManager.RegisterStartupScript(this, this.GetType(), "viewPrintRegister", "ajaxModalPopupRegisterModify();", true); } } catch (System.Exception ex) { UIManager.AdministrationManager.DiagnosticError(ex); return; } }
/// <summary> /// Aggiorna lo stato di avanzamento per la casella /// </summary> private void UpdateStateMailbox(string typeUpdate) { //Tre possibili aggiornamenti: // -da bottone(si aggiornano tutte le caselle, attualmente selezionate, per tutti i registri) // -selezionado il registro(si va ad aggiornare la casella selezionata nel momento in cui si seleziona un registro) // -selezionando una casella nel dropDownList(si va ad aggiornare lo stato per la casella appena selezionata) List <string> listEmails = new List <string>(); List <DocsPaWR.InfoCheckMailbox> listCheckMailbox; string mail = string.Empty; switch (typeUpdate) { case "allMailbox": foreach (GridViewRow grd in this.GrdRegisters.Rows) { if ((grd.FindControl("DdlEmailRegister") as DropDownList).Enabled) { grd.FindControl("containerVerifyEmail").Visible = false; mail = (grd.FindControl("DdlEmailRegister") as DropDownList).SelectedValue; listEmails.Add(mail); } } listCheckMailbox = CheckMailboxManager.InfoCheckMailbox(listEmails); if ((from checkMailBox in listCheckMailbox where checkMailBox.UserID.Equals(UserManager.GetUserInSession().systemId) && checkMailBox.RoleID.Equals(RoleManager.GetRoleInSession().systemId) select checkMailBox).Count() > 0) { foreach (GridViewRow grd in this.GrdRegisters.Rows) { if ((grd.FindControl("DdlEmailRegister") as DropDownList).Enabled) { UpdateStateMailBoxManager(grd, listCheckMailbox); } } } break; case "selectedMailbox": { mail = (this.GrdRegisters.SelectedRow.FindControl("DdlEmailRegister") as DropDownList).SelectedValue; listEmails.Add(mail); listCheckMailbox = CheckMailboxManager.InfoCheckMailbox(listEmails); if ((from checkMailBox in listCheckMailbox where checkMailBox.UserID.Equals(UserManager.GetUserInSession().systemId) && checkMailBox.RoleID.Equals(RoleManager.GetRoleInSession().systemId) select checkMailBox).Count() > 0) { UpdateStateMailBoxManager(this.GrdRegisters.SelectedRow, listCheckMailbox); } else { this.GrdRegisters.SelectedRow.FindControl("containerVerifyEmail").Visible = false; } } break; } foreach (GridViewRow grd in this.GrdRegisters.Rows) { if (string.IsNullOrEmpty((grd.FindControl("checkMailbox") as HiddenField).Value)) { this.RegistersBtnUpdateStateBox.Enabled = false; } else { this.RegistersBtnUpdateStateBox.Enabled = true; break; } } //if (!this.RegistersBtnUpdateStateBox.Enabled) // this.TimerUpdateMailbox.Enabled = false; //else // if(!this.TimerUpdateMailbox.Enabled) // this.TimerUpdateMailbox.Enabled = true; }