Beispiel #1
0
        private async void UpdateInvoiceStatusAction()
        {
            var selected = MainVM.InvoiceCollections.SelectedItem;
            var item     = new ModelsShared.Models.invoice
            {
                Id             = selected.Id,
                InvoiceStatus  = selected.InvoiceStatus,
                InvoicePayType = selected.InvoicePayType, PaidDate = selected.PaidDate
            };



            var IsUpdate = false;

            if (await MainVM.InvoiceCollections.UpdateInvoiceStatusAction(selected.Id, item))
            {
                IsUpdate = true;
            }

            if (IsUpdate == true)
            {
                ModernDialog.ShowMessage("Status Invoice Is Updated ...!", "Infomration", MessageBoxButton.OK);
            }
            else
            {
                ModernDialog.ShowMessage("Status Invoice Can Not  Update ...!", "Error", MessageBoxButton.OK);
            }
        }
Beispiel #2
0
        private async void UpdateDeliveryDataAction()
        {
            var selected = MainVM.InvoiceCollections.SelectedItem;
            var item     = new ModelsShared.Models.invoice
            {
                Id           = selected.Id,
                DeliveryDate = selected.DeliveryDate,
                IsDelivery   = true,
                ReciveDate   = selected.ReciveDate,
                ReciverBy    = selected.ReciverBy
            };

            var IsUpdate = false;

            if (await MainVM.InvoiceCollections.UpdateDeliveryDataAction(selected.Id, item))
            {
                IsUpdate = true;
            }

            if (IsUpdate == true)
            {
                ModernDialog.ShowMessage("Delivery Invoice Is Updated ...!", "Infomration", MessageBoxButton.OK);
            }
            else
            {
                ModernDialog.ShowMessage("Delivery Invoice Can Not  Update ...!", "Error", MessageBoxButton.OK);
            }
        }
        private async void SaveAction()
        {
            var item = new ModelsShared.Models.invoice
            {
                CustomerId     = this.CustomerId,
                CreateDate     = this.CreateDate,
                CustomerName   = this.CustomerName,
                DeadLine       = this.DeadLine,
                DeliveryDate   = this.DeliveryDate,
                Details        = this.Details.Where(O => O.IsSelected).ToList(),
                Id             = this.Id,
                InvoicePayType = this.InvoicePayType,
                InvoiceStatus  = this.InvoiceStatus,
                IsDelivery     = this.IsDelivery,
                Number         = this.Number,
                ReciveDate     = this.ReciveDate,
                ReciverBy      = this.ReciverBy,
                UserId         = this.UserId
            };
            var result = await MainVM.InvoiceCollections.Add(item);

            if (result == true)
            {
                MainVM.InvoiceCollections.SourceView.Refresh();
                this.Number = MainVM.InvoiceCollections.SelectedItem.Number;
                ModernDialog.ShowMessage("Data Is Saved... !", "Information", MessageBoxButton.OK);
            }
            else
            {
                ModernDialog.ShowMessage("Data Not Saved... !", "Error", MessageBoxButton.OK);
            }
        }