public async Task <Unit> OnEdit(object oRow) { await Task.Run(() => { try { var clInfo = oRow as AddressInfoGrid; if (clInfo == null) { return; } UpsertAddress.Fill(clInfo, _orderModel().Franchise); UpsertAddress.IsOpen = true; } catch (Exception ex) { InternalLogger.WriteException(ex); MessageBus.Current.SendMessage(new MessageBoxSettings { Message = ex.Message, Title = "Editar dirección", }, SharedMessageConstants.MSG_SHOW_ERRQST); } }); return(new Unit()); }
public async Task <Unit> OnAdd() { await Task.Run(() => { try { var response = ValidateModel(ClientFlags.ValidateOrder.Phone | ClientFlags.ValidateOrder.Franchise); if (response.IsSuccess == false) { MessageBus.Current.SendMessage(new MessageBoxSettings { Message = response.Message, Title = "Información faltante", }, SharedMessageConstants.MSG_SHOW_ERRQST); return; } UpsertAddress.Clean(_orderModel().Franchise); UpsertAddress.IsOpen = true; } catch (Exception ex) { InternalLogger.WriteException(ex); MessageBus.Current.SendMessage(new MessageBoxSettings { Message = ex.Message, Title = "Agregar dirección", }, SharedMessageConstants.MSG_SHOW_ERRQST); } }); return(new Unit()); }