public void Add(Action<OrderDto, Exception> action, OrderDto ent) { var url = string.Format(orderAddressFormatString, string.Empty); WebClientHelper.Post<OrderDto, OrderDto> (new Uri(url, UriKind.Absolute), action, ent, WebClientHelper.MessageFormat.Json,ApiConfig.Headers); }
public OrderDto Add(OrderDto data) { var updatedEnt = _orderAppService.Add(data.Description, data.Owner.Id, data.Transporter != null && data.Transporter.Id != 0 ? data.Transporter.Id : (long?)null, data.Supplier != null && data.Supplier.Id != 0 ? data.Supplier.Id : (long?)null, data.Receiver != null && data.Receiver.Id != 0 ? data.Receiver.Id : (long?)null, (OrderTypes)(int)data.OrderType, data.FromVessel != null && data.FromVessel.Id != 0 ? data.FromVessel.Id : (long?)null, data.ToVessel != null && data.ToVessel.Id != 0 ? data.ToVessel.Id : (long?)null); var result = _orderDtoMapper.MapToModel(updatedEnt); return result; }
public OrderVM(IFuelController mainController, IOrderServiceWrapper serviceWrapper) { Entity = new OrderDto { Id = -1 }; this.mainController = mainController; this.serviceWrapper = serviceWrapper; Suppliers = new List<CompanyDto>(); Receivers = new List<CompanyDto>(); Transporters = new List<CompanyDto>(); DisplayName = "افزودن/اصلاح سفارش "; RequestClose += OrderVM_RequestClose; this.Entity.PropertyChanged += EntityPropertyChanged; }
public void Add(OrderDto order) { var view= ViewManager.ShowInDialog<IOrderItemView>(); (view.ViewModel as OrderItemVM).SetProp(order); }
public void Delete(OrderDto data) { _orderAppService.DeleteById(data.Id); }
public void Load(OrderDto ent, List<CompanyDto> dtos, List<VesselDto> vesselDtos) { SetCollection(dtos, vesselDtos); ShowBusyIndicator("در حال دریافت اطلاعات سفارش ..."); serviceWrapper.GetById ( (res, exp) => mainController.BeginInvokeOnDispatcher ( () => { if (exp == null) { Entity = res; OrderTypeId = (int)res.OrderType; OrderTypeChanging(res.OrderType, true); this.Entity.PropertyChanged += EntityPropertyChanged; } else { mainController.HandleException(exp); } HideBusyIndicator(); }), ent.Id); }
private void UpdatePartnerCompany(OrderDto order) { SupplierId = order.Supplier == null ? (long?)null : order.Supplier.Id; TransporterId = order.Transporter == null ? (long?)null : order.Transporter.Id; }
public void SetProp(OrderDto order) { parentEntity = order; GetGoods(); }
public void Edit(OrderDto dto, List<CompanyDto> dtos,List<VesselDto> vesselDtos) { var view = ViewManager.ShowInDialog<IOrderView>(); (view.ViewModel as OrderVM).Load(dto, dtos, vesselDtos); }