public ActionResult GestioneRinunciaMABPartenza(decimal idTrasferimento) { MABModel mabm = new MABModel(); bool soloLettura = false; try { using (ModelDBISE db = new ModelDBISE()) { using (dtMaggiorazioneAbitazione dtmab = new dtMaggiorazioneAbitazione()) { using (dtTrasferimento dtt = new dtTrasferimento()) { var t = dtt.GetTrasferimentoById(idTrasferimento); mabm = dtmab.GetMABModelPartenza(idTrasferimento, db); var amm = dtmab.GetAttivazionePartenzaMAB(idTrasferimento); EnumStatoTraferimento statoTrasferimento = 0; statoTrasferimento = t.idStatoTrasferimento; if (statoTrasferimento == EnumStatoTraferimento.Annullato || statoTrasferimento == EnumStatoTraferimento.Attivo) { soloLettura = true; } if (mabm.rinunciaMAB && amm.notificaRichiesta) { soloLettura = true; } if (amm.notificaRichiesta) { soloLettura = true; } ViewData.Add("soloLettura", soloLettura); } } } } catch (Exception ex) { return(PartialView("ErrorPartial", new MsgErr() { msg = ex.Message })); } return(PartialView(mabm)); }