コード例 #1
0
 public bool Guardar(Boolean ShowMessage)
 {
     try
     {
         MView.GetItem();
         FleteNegativo = false;
         if (Item.Validar())
         {
             Boolean        m_isAdded = (Item.Instance == Infrastructure.Aspect.BusinessEntity.InstanceEntity.Added);
             Entities.Flujo _item     = Item;
             if (Client.SaveFlujo(ref _item))
             {
                 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);
     }
 }
コード例 #2
0
 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.Flujo _item = Item;
                 if (Client.SaveFlujo(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);
         //Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeError(Title, Infrastructure.Aspect.Constants.Mensajes.DeletePresenter, ex);
     }
 }