private void ExecuteCancelOrder(MessageDialogResult result, TrackOrderDto order) { if (result != MessageDialogResult.Affirmative) { return; } _client.ExecutionProxy.ExecuteRequest <long, long, ResponseMessageData <ResponseMessage>, ResponseMessageData <ResponseMessage> > (order.OrderToStoreId, TransferDto.SameType, SharedConstants.Server.STORE_HUB, SharedConstants.Server.CANCEL_ORDER_STORE_HUB_METHOD, TransferDto.SameType) .Subscribe(e => OnResultCancelOrderOk(e, order), OnResultCancelOrderError); }
protected virtual void OnCancelOrder(TrackOrderDto order) { MessageBus.Current.SendMessage(new MessageBoxSettings { Message = "¿Desea cancelar la orden seleccionada?", Title = "Cancelar la orden", Settings = new MetroDialogSettings { AffirmativeButtonText = "Si", NegativeButtonText = "No" }, Style = MessageDialogStyle.AffirmativeAndNegative, Callback = (x => ExecuteCancelOrder(x, order)) }, SharedMessageConstants.MSG_SHOW_ERRQST); }
private void OnResultCancelOrderOk(IStale <ResponseMessageData <ResponseMessage> > obj, TrackOrderDto order) { if (obj.IsStale) { OnResultCancelOrderError(Resources.Network.ResNetwork.ERROR_NETWORK_DOWN); return; } if (obj.Data.IsSuccess == false) { OnResultCancelOrderError(obj.Data.Message); return; } var response = obj.Data.Data; if (response.IsSuccess == false) { OnResultCancelOrderError(response.Message); return; } order.LastStatus = SettingsData.Constants.TrackConst.CANCELED; order.ChangeCancel = true; MessageBus.Current.SendMessage(new MessageBoxSettings { Message = response.Message, Title = "Cancelar la orden" //, Callback = (_ => EndOrder()) }, SharedMessageConstants.MSG_SHOW_SUCCESS); }