public void CargarProducto_Presentaciones(bool isExceptionManaged = false) { try { producto_Presentaciones = new ObservableCollection <PRODUCTO_PRESENTACION>(new cProducto_Presentacion().Seleccionar("S").ToList()); var dummy = new PRODUCTO_PRESENTACION() { ID_PRESENTACION = -1, DESCR = "Seleccione una presentación", ACTIVO = "S" }; producto_Presentaciones.Insert(0, dummy); RaisePropertyChanged("Producto_Presentaciones"); } catch (Exception ex) { if (!isExceptionManaged) { _dialogCoordinator.ShowMessageAsync(this, "Error", "Hubo un error al cargar las presentaciones. Favor de contactar al administrador"); } else { throw ex; } } }
private void GuardarProductoTipo() { try { var _producto_presentacion = new PRODUCTO_PRESENTACION { ACTIVO = (Activo) ? "S" : "N", DESCR = Descripcion }; if (RealizarAccion == AccionSalvar.Salvar) { new cProducto_Presentacion().Insertar(_producto_presentacion); _dialogCoordinator.ShowMessageAsync(this, "Notificacion", "Se inserto la presentación de producto con exito"); } else if (RealizarAccion == AccionSalvar.Actualizar) { _producto_presentacion.ID_PRESENTACION = ID.Value; new cProducto_Presentacion().Actualizar(_producto_presentacion); _dialogCoordinator.ShowMessageAsync(this, "Notificacion", string.Format("Se actualizo la presentación de producto {0} con exito", _producto_presentacion.DESCR)); } } catch (Exception ex) { _dialogCoordinator.ShowMessageAsync(this, "Error", "Ocurrió un error en la operacion. Favor de notificar al administrador"); } }