/// <summary> /// Salvataggio dati della chiave /// </summary> private void Save() { DocsPaWR.ChiaveConfigurazione chiaveConfig = new SAAdminTool.DocsPaWR.ChiaveConfigurazione(); this.RefreshChiaveConfigFromUI(chiaveConfig); DocsPaWR.ValidationResultInfo result = null; result = this.UpdateChiaveConfig(ref chiaveConfig); if (!result.Value) { this.ShowValidationMessage(result); } else { // Inserimento this.lbl_tit.Visible = true; // Pulizia della cache //pulizia della cache sul backend e sul frontend this.Clear(chiaveConfig.IDAmministrazione); //ricalcolo delle chiavi this.FillListChiaviConfig(); } }
/// <summary> /// Salvataggio dati del mezzo spedizione corrente /// </summary> private void Save() { DocsPaWR.MezzoSpedizione m_sped = new SAAdminTool.DocsPaWR.MezzoSpedizione(); DocsPaWR.ValidationResultInfo result = null; bool insertMode = this.OnInsertMode(); if (!this.txt_descrizione.Text.Equals("")) { m_sped.Descrizione = this.txt_descrizione.Text; // m_sped.chaTipoCanale = this.txt_chatipocanale.Text; m_sped.chaTipoCanale = this.txt_descrizione.Text.Substring(0, 1).ToUpper(); } else { this.RegisterClientScript("AlertDescrizione", "alert('Inserire una descrizione per il mezzo di spedizione');"); return; } if (insertMode) { result = this.InsertMezzoSpedizione(ref m_sped); if (!result.Value) { this.RegisterClientScript("alert", "alert(\"Descrizione già presente\");"); } else { this.FillListMezziSpedizione(); this.lbl_tit.Visible = true; // Predisposizione per un nuovo inserimento this.SetInsertMode(); } } else { string idMezzo = this.dg_mezzi.SelectedItem.Cells[0].Text.ToString(); m_sped = this.GetMezzoSpedizione(idMezzo); m_sped.Descrizione = this.txt_descrizione.Text; // m_sped.chaTipoCanale = this.txt_chatipocanale.Text; m_sped.chaTipoCanale = this.txt_descrizione.Text.Substring(0, 1).ToUpper(); result = this.UpdateMezzoSpedizione(ref m_sped); if (!result.Value) { this.RegisterClientScript("alert", "alert(\"Modifica non effettuata\");"); } else { // Aggiornamento this.RefreshGridItem(m_sped); this.ClearData(); this.pnl_info.Visible = false; this.lbl_tit.Visible = true; this.dg_mezzi.SelectedIndex = -1; } } }
/// <summary> /// Visualizzazione messaggi di validazione /// </summary> /// <param name="validationResult"></param> private void ShowValidationMessage(SAAdminTool.DocsPaWR.ValidationResultInfo validationResult) { // Visualizzazione delle regole di business non valide bool warningMessage; Control firstInvalidControl; string validationMessage = this.GetValidationMessage(validationResult, out firstInvalidControl, out warningMessage); this.RegisterClientScript("ShowValidationMessage", "ShowValidationMessage('" + validationMessage + "'," + warningMessage.ToString().ToLower() + ");"); if (firstInvalidControl != null) { this.SetFocus(firstInvalidControl); } }
/// <summary> /// Salvataggio dati del tipo ruolo corrente /// </summary> private void Save() { DocsPaWR.OrgTipoRuolo tipoRuolo = new SAAdminTool.DocsPaWR.OrgTipoRuolo(); this.RefreshTipoRuoloFromUI(tipoRuolo); DocsPaWR.ValidationResultInfo result = null; this.SetIdAmministrazione(tipoRuolo); bool insertMode = this.OnInsertMode(); if (insertMode) { result = this.InsertTipoRuolo(ref tipoRuolo); } else { result = this.UpdateTipoRuolo(ref tipoRuolo); } if (!result.Value) { this.ShowValidationMessage(result); } else if (!insertMode) { // Aggiornamento this.RefreshGridItem(tipoRuolo); this.ClearData(); this.pnl_info.Visible = false; this.lbl_tit.Visible = true; this.dg_ruoli.SelectedIndex = -1; } else { // Inserimento this.lbl_tit.Visible = true; // Refresh lista registri this.FillListTipiRuolo(); // Predisposizione per un nuovo inserimento this.SetInsertMode(); } }
private string GetValidationMessage(SAAdminTool.DocsPaWR.ValidationResultInfo validationResult, out Control firstInvalidControl, out bool warningMessage) { string retValue = string.Empty; bool errorMessage = false; firstInvalidControl = null; foreach (SAAdminTool.DocsPaWR.BrokenRule rule in validationResult.BrokenRules) { if (!errorMessage && rule.Level == SAAdminTool.DocsPaWR.BrokenRuleLevelEnum.Error) { errorMessage = true; } if (retValue != string.Empty) { retValue += "\\n"; } retValue += " - " + rule.Description; if (firstInvalidControl == null) { firstInvalidControl = this.GetBusinessRuleControl(rule.ID); } } if (errorMessage) { retValue = "Sono state riscontrate le seguenti anomalie:\\n\\n" + retValue; } else { retValue = "Attenzione:\\n\\n" + retValue; } warningMessage = !errorMessage; return(retValue.Replace("'", "\\'")); }
private void Save() { bool insertMode = this.OnInsertMode(); SAAdminTool.DocsPaWR.ValidationResultInfo result = null; SAAdminTool.DocsPaWR.OrgRagioneTrasmissione ragione = new SAAdminTool.DocsPaWR.OrgRagioneTrasmissione(); this.RefreshRagioneTrasmissioneFromUI(ragione); if (insertMode) { result = this.InsertRagioneTrasmissione(ref ragione); } else { result = this.UpdateRagioneTrasmissione(ref ragione); } if (!result.Value) { this.ShowValidationMessage(result); } else if (!insertMode) { // Aggiornamento this.RefreshGridItem(ragione); this.ClearData(); this.pnl_info.Visible = false; this.lbl_cod.Visible = true; this.impostaBlocchiRispettoCessione(false); } else { // Refresh lista ragioni trasmissione this.FillGridRagioniTrasmissione(); // Predisposizione per un nuovo inserimento this.SetInsertMode(); } }
/// <summary> /// Cancellazione ragione trasmissione /// </summary> private void Delete() { SAAdminTool.DocsPaWR.OrgRagioneTrasmissione ragione = new SAAdminTool.DocsPaWR.OrgRagioneTrasmissione(); this.RefreshRagioneTrasmissioneFromUI(ragione); SAAdminTool.DocsPaWR.ValidationResultInfo result = this.DeleteRagioneTrasmissione(ref ragione); if (result.Value) { this.FillGridRagioniTrasmissione(); pnl_info.Visible = false; this.ClearData(); this.impostaBlocchiRispettoCessione(false); } else { this.ShowValidationMessage(result); } }
/// <summary> /// Cancellazione mezzo di spedizione /// </summary> private void Delete() { if (!this.dg_mezzi.SelectedItem.Cells[GRID_COL_ID].Text.Equals("")) { DocsPaWR.MezzoSpedizione m_sped = new SAAdminTool.DocsPaWR.MezzoSpedizione(); m_sped = this.GetMezzoSpedizione(this.dg_mezzi.SelectedItem.Cells[GRID_COL_ID].Text.ToString()); DocsPaWR.ValidationResultInfo result = this.DeleteMezzoSpedizione(ref m_sped); if (result.Value) { this.FillListMezziSpedizione(); pnl_info.Visible = false; this.ClearData(); dg_mezzi.SelectedIndex = -1; } else { this.RegisterClientScript("alert2", "alert('La cancellazione mezzo di spedizione non è avvenuta correttamente');"); } } }
/// <summary> /// Cancellazione registro /// </summary> private void Delete() { DocsPaWR.OrgTipoRuolo tipoRuolo = new SAAdminTool.DocsPaWR.OrgTipoRuolo(); this.RefreshTipoRuoloFromUI(tipoRuolo); DocsPaWR.ValidationResultInfo result = this.DeleteTipoRuolo(ref tipoRuolo); if (result.Value) { this.FillListTipiRuolo(); pnl_info.Visible = false; this.ClearData(); dg_ruoli.SelectedIndex = -1; } else { this.ShowValidationMessage(result); } }
public static SAAdminTool.DocsPaWR.ValidationResultInfo ExtAppAddUte(String idApplicazione, String idUtente) { AmmUtils.WebServiceLink ws = new AmmUtils.WebServiceLink(); SAAdminTool.DocsPaWR.ValidationResultInfo retValue = docsPaWS.ExtAppAddUte(idApplicazione, idUtente); return(retValue); }