Example #1
0
        private async void SaveOrderAsync()
        {
            if (SelectedClient == null)
            {
                ErrorMessage = "Не выбран клиент!";
                return;
            }
            if (OrderedBooks.IsNullOrEmpty())
            {
                ErrorMessage = "Необходимо добавить хотя бы одну книгу.";
                return;
            }
            using (StartOperation())
            {
                var saveOrderModel = new SaveOrderModel
                {
                    OrderedBooks = OrderedBooks,
                    BranchId     = _currentEmployee.BranchId,
                    ClientId     = SelectedClient.Id,
                    EmployeeId   = _currentEmployee.Id,
                    OrderDate    = DateTime.Now
                };

                await SaveOrderOperation.ExecuteAsync(saveOrderModel);
                await Close(true);
            }
        }
Example #2
0
        private async void SaveOrderAsync()
        {
            if (SelectedClient == null)
            {
                ErrorMessage = "Выберите клиента";
                return;
            }

            if (OrderedBooks.IsNullOrEmpty())
            {
                ErrorMessage = "Выберите книги";
                return;
            }

            using (StartOperation())
            {
                var saveOrderModel = new SaveOrderModel
                {
                    BranchId     = _currentEmployee.BranchId,
                    ClientId     = SelectedClient.Id,
                    EmployeeId   = _currentEmployee.Id,
                    OrderDate    = DateTime.Now,
                    OrderedBooks = OrderedBooks
                };

                await SaveOrderOperation.ExecuteAsync(saveOrderModel);
                await Close(true);
            }
        }