Esempio n. 1
0
        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();
            }
        }