Пример #1
0
        public void Add(Action<InvoiceDto, Exception> action, InvoiceDto ent)
        {
            var url = string.Format(invoiceAddressFormatString, string.Empty);

            WebClientHelper.Post<InvoiceDto, InvoiceDto>(new Uri(url, UriKind.Absolute),
                                                         action, ent,
                                                         WebClientHelper.MessageFormat.Json,ApiConfig.Headers);
        }
        public void Load(CompanyDto selectedCompany, InvoiceDto invoice)
        {
            CurrentCompany = selectedCompany;

            CurrentInvoice = invoice;
            ToDateFilter = invoice.InvoiceDate;
            FromDateFilter = invoice.InvoiceDate.AddMonths(-3);
            var uid = Guid.NewGuid();
        }
Пример #3
0
 //TODO Sholde Check Type
 public InvoiceDto Update(InvoiceDto data)
 {
     var invoice = invoiceDtoMapper.MapModelToCommandWithAllIncludes(data);
     var updatedEnt = invoiceAppService.Update(invoice);
     var result = invoiceDtoMapper.MapToModel(updatedEnt);
     return result;
 }
Пример #4
0
 public void Delete(InvoiceDto data)
 {
     invoiceAppService.DeleteById(data.Id);
 }
Пример #5
0
 public InvoiceDto CalculateAdditionalPrice(InvoiceDto data)
 {
     var invoice = invoiceDtoMapper.MapModelToCommandWithAllIncludes(data);
     var updatedEnt = invoiceAppService.CalculateAdditionalPrice(invoice);
     var result = invoiceDtoMapper.MapToModelWithAllIncludes(updatedEnt);
     return result;
 }
Пример #6
0
        public InvoiceDto Add(InvoiceDto data)
        {
            var invoice = invoiceDtoMapper.MapModelToCommandWithAllIncludes(data);
            var added = invoiceAppService.Add(invoice);
            //                (
            //                    data.InvoiceNumber, data.OwnerId, data.InvoiceDate, (DivisionMethods) data.DivisionMethodId, (AccountingTypes) data.AccountTypeId,
            //                    data.InvoiceRefrence==null?(long?) null:data.InvoiceRefrence.Id, data.OrderRefrences.Select(c => c.Id).ToList(), data.CurrencyId,
            //                    data.TransporterId, data.SupplierId, (InvoiceTypes) (int) data.InvoiceType, data.Description,data.InvoiceItems.ToList());

            var result = invoiceDtoMapper.MapToModel(added);

            return result;
        }
Пример #7
0
 public void SetProp(InvoiceDto invoice)
 {
 }
        public void Load(CompanyDto selectedCompany, InvoiceDto invoice)
        {
            CurrentCompany = selectedCompany;
            OrderListVM.Load();
            var uid = Guid.NewGuid();

            UpperDate = invoice.InvoiceDate;
            UpdatePartnerCompany(invoice.SupplierId, invoice.TransporterId);
            ToDateFilter = invoice.InvoiceDate;
            FromDateFilter = invoice.InvoiceDate.AddMonths(-3);

            invoiceType = invoice.InvoiceType;
            if (invoice.OrderRefrences == null)
                invoice.OrderRefrences = new ObservableCollection<OrderDto>();
            else
            {
                foreach (var order in invoice.OrderRefrences)
                    SelectedOrders.Add(order);
                LoadOrdersByFilters2();
            }
            changed = false;
        }
Пример #9
0
 public void ShowOrderReference(CompanyDto selectedCompany, InvoiceDto invoice)
 {
     var view = this.ViewManager.ShowInDialog<IOrderReferenceLookUp>();
     (view.ViewModel as OrderReferenceLookUpVM).Load(selectedCompany, invoice);
 }
Пример #10
0
 public void ManageAdditionalPrice(InvoiceDto invoice, decimal currencyToMainCurrencyRate, Guid uniqId)
 {
     var view = ViewManager.ShowInDialog<IInvoiceAdditionalPriceListView>();
     (view.ViewModel as InvoiceAdditionalPriceListVM).Load(invoice, currencyToMainCurrencyRate,uniqId);
 }
Пример #11
0
 public void Edit(InvoiceDto dto,List<CompanyDto> companies)
 {
     var view = ViewManager.ShowInDialog<IInvoiceView>();
     (view.ViewModel as InvoiceVM).Load(dto, companies);
 }
        public void CalculateAdditionalPrice(Action<InvoiceDto, Exception> action, InvoiceDto ent)
        {
            var url = string.Format(invoiceAdditionalPriceAddressFormatString, ent.Id, string.Empty);

            WebClientHelper.Put(new Uri(url, UriKind.Absolute), action, ent, WebClientHelper.MessageFormat.Json,ApiConfig.Headers);
        }