예제 #1
0
        public PropertyDialog(Contractor contractor)
        {
            this.ImageHint = "HHH";

            this.InitializeComponent();

            this.mResetValidationMap = DataTypeFactory.Current.GetNotifications(typeof(Contractor));

            this.ClearTextBox = new CommandBridge()
            {
                To = this.OnClearTextBox
            };

            this.DataContext = this.iContractor = contractor;

            this.BuildTextBoxesMap();

            this.SetImagesToolTip();
        }
예제 #2
0
        private async void AddContractor()
        {
            Contractor contractor = ContractorsContext.Current.CreateForEdit();

            PropertyDialog dialog = ContentDialogFactory.Create(contractor, new Grid[] { this.Overlay });

            if (await dialog.ShowAsync() == ContentDialogResult.Primary)
            {
                var pointer = Window.Current.CoreWindow.PointerCursor;

                Window.Current.CoreWindow.PointerCursor =
                    new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Wait, 1);

                await ContractorsContext.Current.Add(contractor);

                ContractorsContext.Current.Collapse(contractor);

                Window.Current.CoreWindow.PointerCursor = pointer;
            }
        }
예제 #3
0
        private async void OpenPopUp(Contractor contractor)
        {
            Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated += this.AcceleratorKeyActivated;

            this.Overlay.Visibility = Visibility.Visible;

            var pointer = Window.Current.CoreWindow.PointerCursor;

            Window.Current.CoreWindow.PointerCursor =
                new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Wait, 1);

            await ContractorsContext.Current.Expand(contractor);

            this.popUp.DataContext = contractor;

            this.SetPopUpSize();

            Window.Current.CoreWindow.SizeChanged += this.CoreWindow_SizeChanged;

            Window.Current.CoreWindow.PointerCursor = pointer;

            this.popUp.IsOpen = true;
        }
예제 #4
0
        private async void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new MessageDialog(
                "Действительно удалить ?");

            dialog.Commands.Add(new UICommand("Да")
            {
                Id = (int)0
            });
            dialog.Commands.Add(new UICommand("Нет")
            {
                Id = (int)1
            });

            dialog.DefaultCommandIndex = 0;
            dialog.CancelCommandIndex  = 1;

            var result = await dialog.ShowAsync();

            if ((int)result.Id != 0)
            {
                return;
            }

            var pointer = Window.Current.CoreWindow.PointerCursor;

            Window.Current.CoreWindow.PointerCursor =
                new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Wait, 1);

            Contractor contractor = (Contractor)this.popUp.DataContext;

            await ContractorsContext.Current.Delete(contractor);

            this.popUp.IsOpen = false;

            Window.Current.CoreWindow.PointerCursor = pointer;
        }
예제 #5
0
파일: Client.cs 프로젝트: jusmak1/PVM
 public double CalculateVAT(Contractor contractor)
 {
     throw new System.NotImplementedException();
 }
예제 #6
0
        public async Task Delete(Contractor contractor)
        {
            await ContractorsRepository.Current.Delete(contractor);

            this.Items.Remove(contractor);
        }
예제 #7
0
        public void Collapse(Contractor contractor)
        {
            contractor.PhotoRaw = null;

            contractor.Photo = null;
        }
예제 #8
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            this.DataContext = this.Contractor = (Contractor)e.Parameter;
        }