Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
 public void Add(OrderDto order)
 {
     var view=  ViewManager.ShowInDialog<IOrderItemView>();
       (view.ViewModel as OrderItemVM).SetProp(order);
 }
Exemplo n.º 5
0
 public void Delete(OrderDto data)
 {
     _orderAppService.DeleteById(data.Id);
 }
Exemplo n.º 6
0
        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;
 }
Exemplo n.º 8
0
 public void SetProp(OrderDto order)
 {
     parentEntity = order;
     GetGoods();
 }
Exemplo n.º 9
0
 public void Edit(OrderDto dto, List<CompanyDto> dtos,List<VesselDto> vesselDtos)
 {
     var view = ViewManager.ShowInDialog<IOrderView>();
     (view.ViewModel as OrderVM).Load(dto, dtos, vesselDtos);
 }