private void InsertRole(string role, int index, bool reason) { UserControls.CorrespondentCustom corrispondente = (UserControls.CorrespondentCustom) this.LoadControl("../UserControls/CorrespondentCustom.ascx"); corrispondente.EnableViewState = true; corrispondente.PageCaller = "Popup"; corrispondente.TxtEtiCustomCorrespondent = role; corrispondente.ID = index.ToString(); corrispondente.TypeCorrespondentCustom = "MISSING_ROLES"; PnlCorrespondent.Controls.Add(corrispondente); if (reason) { string language = UIManager.UserManager.GetUserLanguage(); DropDownList ddlReason = new DropDownList(); ddlReason.EnableViewState = true; ddlReason.ID = "ddlReason_" + index.ToString(); for (int i = 0; i < this.ListaRagioni.Length; i++) { ddlReason.Items.Add(new ListItem(this.ListaRagioni[i].descrizione, this.ListaRagioni[i].systemId)); } ddlReason.Items.Insert(0, new ListItem()); ddlReason.CssClass = "chzn-select-deselect"; ddlReason.Attributes.Add("data-placeholder", Utils.Languages.GetLabelFromCode("MissingRolesReason", language)); PnlCorrespondent.Controls.Add(ddlReason); } }
protected void btnAddressBookPostback_Click(object sender, EventArgs e) { ScriptManager.RegisterStartupScript(this, this.GetType(), "reallowOp", "reallowOp();", true); try { List <NttDataWA.Popup.AddressBook.CorrespondentDetail> atList = (List <NttDataWA.Popup.AddressBook.CorrespondentDetail>)HttpContext.Current.Session["AddressBook.At"]; List <NttDataWA.Popup.AddressBook.CorrespondentDetail> ccList = (List <NttDataWA.Popup.AddressBook.CorrespondentDetail>)HttpContext.Current.Session["AddressBook.Cc"]; string addressBookCallFrom = HttpContext.Current.Session["AddressBook.from"].ToString(); if (atList != null && atList.Count > 0) { Corrispondente corr = null; //Profiler document UserControls.CorrespondentCustom userCorr = (UserControls.CorrespondentCustom) this.PnlCorrespondent.FindControl(this.IdCustomObjectCustomCorrespondent); string idAmm = UIManager.UserManager.GetInfoUser().idAmministrazione; NttDataWA.Popup.AddressBook.CorrespondentDetail addressBookCorrespondent = (NttDataWA.Popup.AddressBook.CorrespondentDetail)atList[0]; if (!addressBookCorrespondent.isRubricaComune) { corr = UIManager.AddressBookManager.GetCorrespondentBySystemId(addressBookCorrespondent.SystemID); } else { corr = UIManager.AddressBookManager.getCorrispondenteByCodRubricaRubricaComune(addressBookCorrespondent.CodiceRubrica); } userCorr.TxtCodeCorrespondentCustom = corr.codiceRubrica; userCorr.TxtDescriptionCorrespondentCustom = corr.descrizione; userCorr.IdCorrespondentCustom = corr.systemId; } HttpContext.Current.Session["AddressBook.At"] = null; HttpContext.Current.Session["AddressBook.Cc"] = null; this.UpdMissingRolesGrid.Update(); } catch (Exception ex) { UIManager.AdministrationManager.DiagnosticError(ex); return; } }
protected void MissingRolesBtnTransmit_Click(object sender, EventArgs e) { ScriptManager.RegisterStartupScript(this, this.GetType(), "reallowOp", "reallowOp();", true); ArrayList roleReasonsList = new ArrayList(); // Check data foreach (Control ctrl in this.PnlCorrespondent.Controls) { if (ctrl is UserControls.CorrespondentCustom) { UserControls.CorrespondentCustom corr = (UserControls.CorrespondentCustom)ctrl; if (!string.IsNullOrEmpty(corr.TxtCodeCorrespondentCustom) && !string.IsNullOrEmpty(corr.TxtDescriptionCorrespondentCustom)) { DropDownList ddl = (DropDownList)PnlCorrespondent.FindControl("ddlReason_" + corr.ID); string reason = corr.TxtEtiCustomCorrespondent.Split('(')[1]; if (ddl != null) { reason = ddl.SelectedItem.Text + "§" + reason; } roleReasonsList.Add(corr.TxtCodeCorrespondentCustom + " (" + reason); } else { string msg = "WarningMissingRolesRequired"; ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "ajaxDialogModal('" + msg + "', 'warning', '');", true); break; } } } if (roleReasonsList.Count > 0) { // Creo le trasmissioni ai corrispondenti selezionati DiagrammiManager.CreateTransmissionsMissingRoles((string[])roleReasonsList.ToArray(typeof(string)), this.SelectedState.SYSTEM_ID.ToString()); this.SalvaStato(); this.SelectedState = null; this.CloseMask(); } }