Esempio n. 1
0
        private async void OnAddClicked(object sender, RoutedEventArgs e)
        {
            var person            = mainDatagrid.SelectedItem as PharmacyHajiawa.Models.ItemType;
            ItemTypeEditWindow it = new ItemTypeEditWindow(true, 1)
            {
            };

            it.ShowDialog();
            GetItems(false);
        }
Esempio n. 2
0
        private async void mainDatagrid_GotMouseCapture(object sender, MouseEventArgs e)
        {
            if (_isbuy)
            {
                var p = mainDatagrid.SelectedItem as PharmacyHajiawa.Models.ItemType;
                if (p is null)
                {
                    return;
                }
                ItemPage it = new ItemPage(p.ItemTypeId, true);

                this.NavigationService.Navigate(it);
                return;
            }
            var person = mainDatagrid.SelectedItem as Models.ItemType;

            if (person is null)
            {
                return;
            }
            if (person.Status is true)
            {
                DisplaySheet sh = new DisplaySheet(new List <string> {
                    "گەڕاندنەوە"
                });
                sh.ShowDialog();
                if (DisplaySheet.theResult is "گەڕاندنەوە")
                {
                    QueryInside($"update ItemType set Status=0 where ItemTypeId={person.ItemTypeId}");
                    GetItems(true);
                }
                return;
            }


            DisplaySheet sheet = new DisplaySheet(new List <string> {
                "دەستکاریکردن", "جۆرەکانی"
            });

            sheet.ShowDialog();
            if (DisplaySheet.theResult != null)
            {
                if (DisplaySheet.theResult is "دەستکاریکردن")
                {
                    if (person is null)
                    {
                        return;
                    }
                    ItemTypeEditWindow it = new ItemTypeEditWindow(false, person.ItemTypeId)
                    {
                    };
                    it.ShowDialog();
                    GetItems(false);
                }

                if (DisplaySheet.theResult is "جۆرەکانی")
                {
                    if (person is null)
                    {
                        return;
                    }
                    ItemPage it = new ItemPage(person.ItemTypeId);

                    this.NavigationService.Navigate(it);
                    GetItems(false);
                }
            }
            else
            {
                mainDatagrid.UnselectAllCells();
            }
        }