public bool Guardar(Boolean ShowMessage) { try { MView.GetItem(); Entities.CabPerfilAsientos _item = Item; if (Item.Validar()) { if (Client.SaveCabPerfilAsientos(ref _item)) { Item = _item; if (ShowMessage) { Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeSatisfactorio(Title, "Se ha guardado satisfactoriamente"); } return(true); } } else { MView.ShowValidation(); return(false); } return(false); } catch (Exception ex) { Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeError(Title, Infrastructure.Aspect.Constants.Mensajes.SavePresenter, ex); return(false); } }
public CabPerfilAsientos GetOne(String CABP_Ano, String CABP_Codigo) { try { if (CABP_Ano == null || CABP_Codigo == null) { return(null); } Entities.CabPerfilAsientos _item = SelectOne(CABP_Ano, CABP_Codigo); ObservableCollection <Infrastructure.Aspect.DataAccess.DataAccessFilterSQL> _listFilters = new ObservableCollection <Infrastructure.Aspect.DataAccess.DataAccessFilterSQL>(); _listFilters.Add(new Infrastructure.Aspect.DataAccess.DataAccessFilterSQL() { FilterName = "@pchrCABP_Ano", FilterValue = CABP_Ano, FilterType = Infrastructure.Aspect.DataAccess.DataAccessFilterTypes.Char, FilterSize = 4 }); _listFilters.Add(new Infrastructure.Aspect.DataAccess.DataAccessFilterSQL() { FilterName = "@pvchCABP_Codigo", FilterValue = CABP_Codigo, FilterType = Infrastructure.Aspect.DataAccess.DataAccessFilterTypes.Varchar, FilterSize = 3 }); _item.ListDetPerfilAsientos = BL_DetPerfilAsientos.GetAllFilter("CON_DETPSS_TodosPorCabecera", _listFilters); _item.ListDetPerfilAsientosEliminados = new ObservableCollection <DetPerfilAsientos>(); return(_item); } catch (Exception) { throw; } }
public void Eliminar() { try { if (Item != null) { System.Windows.Forms.DialogResult _result = Infrastructure.WinForms.Controls.Dialogos.MostrarMensajePregunta(Title, Infrastructure.Aspect.Constants.Mensajes.PreguntaEliminar, Infrastructure.WinForms.Controls.Dialogos.LabelBoton.Si_No); if (_result == System.Windows.Forms.DialogResult.Yes) { Item.Instance = Infrastructure.Aspect.BusinessEntity.InstanceEntity.Deleted; Entities.CabPerfilAsientos _item = Item; if (Client.SaveCabPerfilAsientos(ref _item)) { Actualizar(); Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeSatisfactorio(Title, "Se ha eliminado el item."); } else { Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeInformacion(Title, "Ha ocurrido un error al guardar el item."); } } } else { Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeInformacion(Title, "Debe seleccionar un elemento de la grilla"); } } catch (Exception ex) { string errorMsg = Delfin.Controls.Utils.getErrorMsg(ex); Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeError(Title, errorMsg, ex); } }