Exemplo n.º 1
0
        private void Save()
        {
            AppJournal.Write("Lot", "Save", true);

            try {
                if (Lot.filelistid == null)
                {
                    Lot.filelistid = DataBaseClient.CreateFileList(new FilesListEF()
                    {
                        description = "Файлы лота"
                    });
                }

                if (Lot.id != 0)
                {
                    DataBaseClient.UpdateLot(Lot);
                }
                else
                {
                    UpdateView(DataBaseClient.CreateLot(Lot));
                }

                auctionViewModel.UpdateLotList();
                MessagesService.Show("Сохранение лота", "Лот успешно сохранен");
                Workspace.This.Panels.Remove(Workspace.This.ActiveDocument);
            } catch (Exception ex) {
                MessagesService.Show("Сохранение лота", "Произошла ошибка во время сохранения");
                AppJournal.Write("Lot", "Saving error :" + ex.ToString(), true);
            }
        }