private void Page_Load(object sender, System.EventArgs e) { template = (SAAdminTool.DocsPaWR.Templates)Session["template"]; lbl_NomeModello.Text = template.DESCRIZIONE; inserisciComponenti(); }
protected void Page_Load(object sender, EventArgs e) { // Caricamento delle informazioni sullo stato di abilitazione dello // storico relativamente ai campi della tipologia attualemnte in editing if (!IsPostBack) { // La pagina deve essere considerata scaduta non appena viene caricata dal browser Response.Expires = -1; // Caricamento dello stato di abilitazione dello storico sui campi relativi al template SAAdminTool.DocsPaWR.Templates template = Session["template"] as SAAdminTool.DocsPaWR.Templates; SelectiveHistoryResponse response = null; if (Request["objType"] == "D") { response = ProfilazioneDocManager.GetCustomHistoryList(template.SYSTEM_ID.ToString()); } else { response = ProfilazioneFascManager.GetCustomHistoryList(template.SYSTEM_ID.ToString()); } this.dgFields.DataSource = response.Fields; this.dgFields.DataBind(); // Se tutti i campi sono selezionati, viene flaggato "Seleziona tutti" this.chkSelectDeselectAll.Checked = response.Fields.Count(f => f.Enabled) == response.Fields.Length; // Se non ci sono campi, viene visualizzato un messaggio e viene chiusa la finestra if (response.Fields.Length == 0) { AjaxMessageBox.ShowMessage("Non è stato rilevato alcun campo per cui è possibile abilitare lo storico"); ScriptManager.RegisterStartupScript(this, this.GetType(), "Close", "window.close();", true); } } }
public static bool verificaCampiObbligatori(SAAdminTool.DocsPaWR.Templates template) { if (template != null) { for (int i = 0; i < template.ELENCO_OGGETTI.Length; i++) { DocsPaWR.OggettoCustom oggCustom = (SAAdminTool.DocsPaWR.OggettoCustom)template.ELENCO_OGGETTI[i]; switch (oggCustom.TIPO.DESCRIZIONE_TIPO) { case "CasellaDiSelezione": bool selezione = false; for (int j = 0; j < oggCustom.VALORI_SELEZIONATI.Length; j++) { if (oggCustom.VALORI_SELEZIONATI[j] != null) { selezione = true; } } if (oggCustom.CAMPO_OBBLIGATORIO == "SI" && !selezione) { return(true); } break; case "SelezioneEsclusiva": if (oggCustom.CAMPO_OBBLIGATORIO == "SI" && (oggCustom.VALORE_DATABASE == "" || oggCustom.VALORE_DATABASE == "-1")) { return(true); } break; case "Link": if (oggCustom.CAMPO_OBBLIGATORIO == "SI" && (oggCustom.VALORE_DATABASE == "")) { return(true); } break; default: if (oggCustom.CAMPO_OBBLIGATORIO == "SI" && oggCustom.VALORE_DATABASE == "") { return(true); } break; } } } return(false); }
public static string verificaOkContatoreFasc(SAAdminTool.DocsPaWR.Templates template) { string result = string.Empty; int lunghezza = 254; if (template != null) { for (int i = 0; i < template.ELENCO_OGGETTI.Length; i++) { DocsPaWR.OggettoCustom oggCustom = (SAAdminTool.DocsPaWR.OggettoCustom)template.ELENCO_OGGETTI[i]; if (oggCustom.TIPO.DESCRIZIONE_TIPO.ToUpper().Equals("CONTATORE")) { //Con incremento differito selezionato if (oggCustom.TIPO_CONTATORE.Equals("R") || oggCustom.TIPO_CONTATORE.Equals("A")) { if (oggCustom.CONTATORE_DA_FAR_SCATTARE) { if (oggCustom.ID_AOO_RF.Equals("")) { string tipoAooRf = string.Empty; if (oggCustom.TIPO_CONTATORE.Equals("R")) { tipoAooRf = "RF"; } else { tipoAooRf = "Registro"; } result = "Non è stato selezionato alcun " + tipoAooRf + " per il contatore."; } } } } if (string.IsNullOrEmpty(oggCustom.NUMERO_DI_CARATTERI)) { if (!string.IsNullOrEmpty(ConfigSettings.getKey(ConfigSettings.KeysENUM.LENGTH_CAMPI_PROFILATI))) { lunghezza = int.Parse(ConfigSettings.getKey(ConfigSettings.KeysENUM.LENGTH_CAMPI_PROFILATI)); } else { lunghezza = 254; } } else { lunghezza = int.Parse(oggCustom.NUMERO_DI_CARATTERI); } if (oggCustom.TIPO.DESCRIZIONE_TIPO.ToUpper().Equals("CAMPODITESTO")) { if (oggCustom.VALORE_DATABASE.Length > lunghezza) { result = "il numero massimo di carattere disponibili per il campo: " + oggCustom.DESCRIZIONE + " è stato superato"; break; } } } } return(result); }