private async void DeleteMethod()
        {
            MessageDialogResult result = await _currentWindow.ShowMessageAsync("تأكيد الحذف", "هل تـريــد حــذف هـذه الفاتورة؟", MessageDialogStyle.AffirmativeAndNegative, new MetroDialogSettings()
            {
                AffirmativeButtonText = "موافق",
                NegativeButtonText    = "الغاء",
                DialogMessageFontSize = 25,
                DialogTitleFontSize   = 30
            });

            if (result == MessageDialogResult.Affirmative)
            {
                _safeServ.DeleteSafe(_selectedSupply.RegistrationDate);
                _clientAccountServ.DeleteAccount(_selectedSupply.RegistrationDate);
                var supplyCategories = _supplyCategoryServ.GetSupplyCategories(_selectedSupply.ID);
                foreach (var item in supplyCategories)
                {
                    Category cat = _categoryServ.GetCategory(item.CategoryID);
                    if (cat.Qty - item.Qty != 0)
                    {
                        cat.Cost = ((cat.Cost * cat.Qty) - item.CostTotalAfterDiscount) / (cat.Qty - item.Qty);
                    }
                    cat.Qty = cat.Qty - item.Qty;
                    _categoryServ.UpdateCategory(cat);
                }
                _supplyServ.DeleteSupply(_selectedSupply);
                Load();
            }
        }
        private async void DeletePremiumMethod()
        {
            MessageDialogResult result = await _currentWindow.ShowMessageAsync("تأكيد الحذف", "هل تـريــد حــذف هـذا القسط؟", MessageDialogStyle.AffirmativeAndNegative, new MetroDialogSettings()
            {
                AffirmativeButtonText = "موافق",
                NegativeButtonText    = "الغاء",
                DialogMessageFontSize = 25,
                DialogTitleFontSize   = 30
            });

            if (result == MessageDialogResult.Affirmative)
            {
                _supplyPremiumServ.DeletePremium(_selectedPremium);
                _clientAccountServ.DeleteAccount(_selectedPremium.RegistrationDate);
                _safeServ.DeleteSafe(_selectedPremium.RegistrationDate);
                var supplyFuture = _supplyFutureServ.GetSupplyFuture(_selectedSupply.ID);
                supplyFuture.Change += _selectedPremium.Amount;
                _supplyFutureServ.UpdateSupplyFuture(supplyFuture);
                SelectedSupply = _supplyServ.GetSupply(_selectedSupply.ID);
                SupplyPremiums = new ObservableCollection <SupplyPremium>(_supplyPremiumServ.GetPremiums(_selectedSupply.ID));
                if (SelectedSupply.SupplyFuture.Change == 0)
                {
                    Visibility = "Collapsed";
                }
                else
                {
                    Visibility = "Visible";
                }
            }
        }
        private async void DeleteMethod()
        {
            MessageDialogResult result = await _currentWindow.ShowMessageAsync("تأكيد الحذف", "هل تـريــد حــذف هـذا السند؟", MessageDialogStyle.AffirmativeAndNegative, new MetroDialogSettings()
            {
                AffirmativeButtonText = "موافق",
                NegativeButtonText    = "الغاء",
                DialogMessageFontSize = 25,
                DialogTitleFontSize   = 30
            });

            if (result == MessageDialogResult.Affirmative)
            {
                _safeServ.DeleteSafe(_selectedSafe);
                Load();
            }
        }
        private async void DeleteMethod()
        {
            MessageDialogResult result = await _currentWindow.ShowMessageAsync("تأكيد الحذف", "هل تـريــد حــذف هـذا البند؟", MessageDialogStyle.AffirmativeAndNegative, new MetroDialogSettings()
            {
                AffirmativeButtonText = "موافق",
                NegativeButtonText    = "الغاء",
                DialogMessageFontSize = 25,
                DialogTitleFontSize   = 30
            });

            if (result == MessageDialogResult.Affirmative)
            {
                _clientAccountServ.DeleteAccount(_selectedClientAccount);
                _safeServ.DeleteSafe(_selectedClientAccount.RegistrationDate);
                clientAccounts.Remove(_selectedClientAccount);
                GetCurrentPage();
            }
        }
Example #5
0
        private async void DeleteMethod()
        {
            MessageDialogResult result = await _currentWindow.ShowMessageAsync("تأكيد الحذف", "هل تـريــد حــذف هـذه الفاتورة؟", MessageDialogStyle.AffirmativeAndNegative, new MetroDialogSettings()
            {
                AffirmativeButtonText = "موافق",
                NegativeButtonText    = "الغاء",
                DialogMessageFontSize = 25,
                DialogTitleFontSize   = 30
            });

            if (result == MessageDialogResult.Affirmative)
            {
                if (_saleServ.IsExistInRecalls(_selectedSale.ID) || !_saleServ.IsLastSale(_selectedSale.ID))
                {
                    await _currentWindow.ShowMessageAsync("فشل الحذف", "لا يمكن حذف هذه الفاتورة", MessageDialogStyle.Affirmative, new MetroDialogSettings()
                    {
                        AffirmativeButtonText = "موافق",
                        DialogMessageFontSize = 25,
                        DialogTitleFontSize   = 30
                    });

                    return;
                }

                _safeServ.DeleteSafe(_selectedSale.RegistrationDate);
                _clientAccountServ.DeleteAccount(_selectedSale.RegistrationDate);
                var saleCategories = _saleCategoryServ.GetSaleCategories(_selectedSale.ID);
                foreach (var item in saleCategories)
                {
                    Category cat = _categoryServ.GetCategory(item.CategoryID);
                    if (cat.Qty + item.Qty != 0)
                    {
                        cat.Cost = (item.CostTotal + (cat.Cost * cat.Qty)) / (cat.Qty + item.Qty);
                    }
                    cat.Qty = cat.Qty + item.Qty;
                    _categoryServ.UpdateCategory(cat);
                }
                _saleServ.DeleteSale(_selectedSale);
                sales.Remove(_selectedSale);
                Load();
            }
        }
Example #6
0
        private void ExecuteSave()
        {
            try
            {
                Mouse.OverrideCursor      = Cursors.Wait;
                _selectedSale.Salesperson = SelectedSalesperson;
                _saleServ.UpdateSale(_selectedSale);
                _safeServ.DeleteSafe(_selectedSale.RegistrationDate);
                _clientAccountServ.DeleteAccount(_selectedSale.RegistrationDate);
                var saleCategories = _saleCategoryServ.GetSaleCategories(_selectedSale.ID);
                foreach (var item in saleCategories)
                {
                    Category cat = _categoryServ.GetCategory(item.CategoryID);
                    if (cat.Qty + item.Qty != 0)
                    {
                        cat.Cost = (item.CostTotal + (cat.Cost * cat.Qty)) / (cat.Qty + item.Qty);
                    }
                    cat.Qty = cat.Qty + item.Qty;
                    _categoryServ.UpdateCategory(cat);
                }
                _saleCategoryServ.DeleteSaleCategories(ID);
                foreach (var item in _saleCategories)
                {
                    SaleCategory _saleCategory = new SaleCategory
                    {
                        CategoryID = item.CategoryID,
                        Cost       = item.Cost,
                        CostTotal  = item.CostTotal,
                        Price      = item.Price,
                        PriceTotal = item.PriceTotal,
                        SaleID     = ID,
                        Qty        = item.Qty
                    };
                    _saleCategoryServ.AddSaleCategory(_saleCategory);
                    Category cat = _categoryServ.GetCategory(item.CategoryID);
                    cat.Qty = cat.Qty - item.Qty;
                    _categoryServ.UpdateCategory(cat);
                }

                ClientAccount _account = new ClientAccount
                {
                    ClientID         = _selectedSale.ClientID,
                    Date             = _selectedSale.Date,
                    RegistrationDate = _selectedSale.RegistrationDate,
                    Statement        = "فاتورة مبيعات رقم " + ID,
                    Credit           = _selectedSale.CashPaid + _selectedSale.DiscountPaid,
                    Debit            = _selectedSale.Price
                };
                _clientAccountServ.AddAccount(_account);

                if (_selectedSale.CashPaid > 0)
                {
                    Safe _safe = new Safe
                    {
                        Date             = _selectedSale.Date,
                        RegistrationDate = _selectedSale.RegistrationDate,
                        Statement        = "فاتورة مبيعات رقم " + ID + " للعميل: " + _selectedSale.Client.Name,
                        Amount           = _selectedSale.CashPaid,
                        Source           = 4
                    };
                    _safeServ.AddSafe(_safe);
                }
                Mouse.OverrideCursor = null;
                _currentWindow.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
        private void ExecuteSave()
        {
            try
            {
                _supplyServ.UpdateSupply(_selectedSupply);
                _safeServ.DeleteSafe(_selectedSupply.RegistrationDate);
                _clientAccountServ.DeleteAccount(_selectedSupply.RegistrationDate);
                var supplyCategories = _supplyCategoryServ.GetSupplyCategories(_selectedSupply.ID);
                foreach (var item in supplyCategories)
                {
                    Category cat = _categoryServ.GetCategory(item.CategoryID);
                    if (cat.Qty - item.Qty != 0)
                    {
                        cat.Cost = ((cat.Cost * cat.Qty) - item.CostTotal) / (cat.Qty - item.Qty);
                    }
                    if (cat.Cost < 0)
                    {
                        cat.Cost = 0;
                    }
                    cat.Qty = cat.Qty - item.Qty;
                    _categoryServ.UpdateCategory(cat);
                }
                _supplyCategoryServ.DeleteSupplyCategories(ID);

                foreach (var item in _supplyCategories)
                {
                    SupplyCategory _supplyCategory = new SupplyCategory
                    {
                        CategoryID = item.CategoryID,
                        Cost       = item.Cost,
                        CostTotal  = item.CostTotal,
                        SupplyID   = ID,
                        Qty        = item.Qty,
                        Price      = item.Price
                    };
                    _supplyCategoryServ.AddSupplyCategory(_supplyCategory);

                    Category cat = _categoryServ.GetCategory(item.CategoryID);
                    if (cat.Qty + item.Qty != 0)
                    {
                        cat.Cost = (item.CostTotal + (cat.Cost * cat.Qty)) / (cat.Qty + item.Qty);
                    }
                    cat.Qty   = cat.Qty + item.Qty;
                    cat.Price = item.Price;
                    _categoryServ.UpdateCategory(cat);
                }


                ClientAccount _account = new ClientAccount
                {
                    ClientID         = _selectedSupply.ClientID,
                    Date             = _selectedSupply.Date,
                    RegistrationDate = _selectedSupply.RegistrationDate,
                    Statement        = "فاتورة مشتريات رقم " + ID,
                    Credit           = _selectedSupply.Cost,
                    Debit            = _selectedSupply.CashPaid + _selectedSupply.DiscountPaid
                };
                _clientAccountServ.AddAccount(_account);

                if (_selectedSupply.CashPaid > 0)
                {
                    Safe _safe = new Safe
                    {
                        Date             = _selectedSupply.Date,
                        RegistrationDate = _selectedSupply.RegistrationDate,
                        Statement        = "فاتورة مشتريات رقم " + ID + " من العميل : " + _selectedSupply.Client.Name,
                        Amount           = -_selectedSupply.CashPaid,
                        Source           = 3
                    };
                    _safeServ.AddSafe(_safe);
                }
                _currentWindow.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
        private void ExecuteSave()
        {
            Mouse.OverrideCursor      = Cursors.Wait;
            _selectedSale.Salesperson = SelectedSalesperson;
            _saleServ.UpdateSale(_selectedSale);
            _safeServ.DeleteSafe(_selectedSale.RegistrationDate);
            _clientAccountServ.DeleteAccount(_selectedSale.RegistrationDate);
            var saleCategories = _saleCategoryServ.GetSaleCategories(_selectedSale.ID);

            foreach (var item in saleCategories)
            {
                Category cat = _categoryServ.GetCategory(item.CategoryID);
                if (cat.Qty + item.Qty != 0)
                {
                    cat.Cost = (item.CostTotal + (cat.Cost * cat.Qty)) / (cat.Qty + item.Qty);
                }
                cat.Qty = cat.Qty + item.Qty;
                _categoryServ.UpdateCategory(cat);
            }
            _saleCategoryServ.DeleteSaleCategories(ID);
            foreach (var item in _saleCategories)
            {
                SaleCategory _saleCategory = new SaleCategory
                {
                    CategoryID              = item.CategoryID,
                    Cost                    = item.Cost,
                    PriceAfterDiscount      = item.PriceAfterDiscount,
                    PriceTotalAfterDiscount = item.PriceTotalAfterDiscount,
                    CostTotal               = item.CostTotal,
                    Price                   = item.Price,
                    PriceTotal              = item.PriceTotal,
                    Discount                = item.Discount,
                    DiscountValue           = item.DiscountValue,
                    DiscountValueTotal      = item.DiscountValueTotal,
                    SaleID                  = ID,
                    Qty = item.Qty
                };
                _saleCategoryServ.AddSaleCategory(_saleCategory);
                Category cat = _categoryServ.GetCategory(item.CategoryID);
                cat.Qty = cat.Qty - item.Qty;
                _categoryServ.UpdateCategory(cat);
            }

            ClientAccount _account = new ClientAccount
            {
                ClientID         = _selectedSale.ClientID,
                Date             = _selectedSale.Date,
                RegistrationDate = _selectedSale.RegistrationDate,
                Statement        = "فاتورة مبيعات رقم " + ID,
                Credit           = _selectedSale.Paid,
                Debit            = _selectedSale.PriceAfterDiscount + _selectedSale.TransportCost
            };

            _clientAccountServ.AddAccount(_account);

            if (_selectedSale.Paid > 0)
            {
                Safe _safe = new Safe
                {
                    Date             = _selectedSale.Date,
                    RegistrationDate = _selectedSale.RegistrationDate,
                    Statement        = "فاتورة مبيعات رقم " + ID + " للعميل: " + _selectedSale.Client.Name,
                    Amount           = _selectedSale.Paid,
                    Source           = 4
                };
                _safeServ.AddSafe(_safe);
            }


            DS ds = new DS();

            ds.Sale.Rows.Clear();
            int i = 0;

            foreach (var item in _saleCategories)
            {
                ds.Sale.Rows.Add();
                ds.Sale[i]["ID"]            = ID;
                ds.Sale[i]["Date"]          = _selectedSale.Date;
                ds.Sale[i]["Client"]        = _selectedSale.Client.Name;
                ds.Sale[i]["Serial"]        = i + 1;
                ds.Sale[i]["Category"]      = item.Category + " " + item.Company;
                ds.Sale[i]["Qty"]           = item.Qty;
                ds.Sale[i]["Price"]         = Math.Round(Convert.ToDecimal(item.PriceAfterDiscount), 2);
                ds.Sale[i]["TotalPrice"]    = Math.Round(Convert.ToDecimal(item.PriceTotalAfterDiscount), 2);
                ds.Sale[i]["BillPrice"]     = Math.Round(Convert.ToDecimal(_selectedSale.PriceAfterDiscount), 2);
                ds.Sale[i]["OldDebt"]       = Math.Abs(Convert.ToDecimal(_selectedSale.OldDebt));
                ds.Sale[i]["TransportCost"] = _selectedSale.TransportCost;
                ds.Sale[i]["BillTotal"]     = Math.Abs(Math.Round(Convert.ToDecimal(_selectedSale.PriceTotal), 2));
                ds.Sale[i]["Paid"]          = _selectedSale.Paid;
                ds.Sale[i]["NewDebt"]       = Math.Abs(Math.Round(Convert.ToDecimal(_selectedSale.NewDebt), 2));
                if (_selectedSale.NewDebt > 0)
                {
                    ds.Sale[i]["Type"] = "له";
                }
                else if (_selectedSale.NewDebt < 0)
                {
                    ds.Sale[i]["Type"] = "عليه";
                }
                ds.Sale[i]["Salesperson"] = _selectedSalesperson.Name;
                ds.Sale[i]["PrintingMan"] = _selectedSale.PrintingMan;

                if (_selectedSale.OldDebt > 0)
                {
                    ds.Sale[i]["Type2"] = "له";
                }
                else if (_selectedSale.OldDebt < 0)
                {
                    ds.Sale[i]["Type2"] = "عليه";
                }
                ds.Sale[i]["Address"] = _selectedSale.Client.Address;
                try
                {
                    ToWord toWord = new ToWord(Math.Abs(Convert.ToDecimal(_selectedSale.NewDebt)), currencies[0]);
                    ds.Sale[i]["NewDebtAR"] = toWord.ConvertToArabic();
                }
                catch
                {
                    ds.Sale[i]["NewDebtAR"] = string.Empty;
                }

                i++;
            }
            ReportWindow rpt     = new ReportWindow();
            SaleReport   saleRPT = new SaleReport();

            saleRPT.SetDataSource(ds.Tables["Sale"]);
            rpt.crv.ViewerCore.ReportSource = saleRPT;
            Mouse.OverrideCursor            = null;
            _currentWindow.Hide();
            rpt.ShowDialog();
            _currentWindow.Close();
        }
Example #9
0
        private async void ExecuteSaveAsync()
        {
            if (SelectedSupply.Future == true && SelectedSupplyFuture.Place == null)
            {
                await _currentWindow.ShowMessageAsync("فشل الإضافة", "يجب كتابة مكان الدفع", MessageDialogStyle.Affirmative, new MetroDialogSettings()
                {
                    AffirmativeButtonText = "موافق",
                    DialogMessageFontSize = 25,
                    DialogTitleFontSize   = 30
                });

                return;
            }
            Mouse.OverrideCursor = Cursors.Wait;
            _supplyServ.UpdateSupply(_selectedSupply);
            _safeServ.DeleteSafe(_selectedSupply.RegistrationDate);
            _clientAccountServ.DeleteAccount(_selectedSupply.RegistrationDate);
            _supplyFutureServ.DeleteSupplyFuture(ID);
            var supplyCategories = _supplyCategoryServ.GetSupplyCategories(_selectedSupply.ID);

            foreach (var item in supplyCategories)
            {
                Category cat = _categoryServ.GetCategory(item.CategoryID);
                if (cat.Qty - item.Qty != 0)
                {
                    cat.Cost = ((cat.Cost * cat.Qty) - item.CostTotalAfterDiscount) / (cat.Qty - item.Qty);
                }
                cat.Qty = cat.Qty - item.Qty;
                _categoryServ.UpdateCategory(cat);
            }
            _supplyCategoryServ.DeleteSupplyCategories(ID);

            foreach (var item in _supplyCategories)
            {
                SupplyCategory _supplyCategory = new SupplyCategory
                {
                    CategoryID             = item.CategoryID,
                    Cost                   = item.Cost,
                    CostAfterDiscount      = item.CostAfterDiscount,
                    CostAfterTax           = item.CostAfterTax,
                    CostTotal              = item.CostTotal,
                    CostTotalAfterDiscount = item.CostTotalAfterDiscount,
                    CostTotalAfterTax      = item.CostTotalAfterTax,
                    Discount               = item.Discount,
                    DiscountValue          = item.DiscountValue,
                    DiscountValueTotal     = item.DiscountValueTotal,
                    SupplyID               = ID,
                    Qty           = item.Qty,
                    Tax           = item.Tax,
                    TaxValue      = item.TaxValue,
                    TaxValueTotal = item.TaxValueTotal,
                    Price         = item.Price
                };
                _supplyCategoryServ.AddSupplyCategory(_supplyCategory);

                Category cat = _categoryServ.GetCategory(item.CategoryID);
                if (cat.Qty + item.Qty != 0)
                {
                    cat.Cost = (item.CostTotalAfterDiscount + (cat.Cost * cat.Qty)) / (cat.Qty + item.Qty);
                }
                cat.Qty   = cat.Qty + item.Qty;
                cat.Price = item.Price;
                _categoryServ.UpdateCategory(cat);
            }

            if (_selectedSupply.Future == true)
            {
                _selectedSupplyFuture.Change   = _selectedSupply.Change;
                _selectedSupplyFuture.SupplyID = ID;
                if (_selectedSupplyFuture.Cheque == false)
                {
                    _selectedSupplyFuture.ChequeNumber = null;
                }
                _supplyFutureServ.AddSupplyFuture(_selectedSupplyFuture);
            }
            ClientAccount _account = new ClientAccount
            {
                ClientID         = _selectedSupply.ClientID,
                Date             = _selectedSupply.Date,
                RegistrationDate = _selectedSupply.RegistrationDate,
                Statement        = "فاتورة مشتريات رقم " + ID,
                Credit           = _selectedSupply.CostAfterTax,
                Debit            = _selectedSupply.CashPaid
            };

            _clientAccountServ.AddAccount(_account);
            if (_selectedSupply.DiscountPaid != 0 || _selectedSupply.TotalDiscount != 0)
            {
                _account = new ClientAccount
                {
                    ClientID         = _selectedSupply.ClientID,
                    Date             = _selectedSupply.Date,
                    RegistrationDate = _selectedSupply.RegistrationDate,
                    Statement        = "خصومات فاتورة مشتريات رقم " + ID,
                    Credit           = _selectedSupply.DiscountPaid,
                    Debit            = _selectedSupply.TotalDiscount
                };
                _clientAccountServ.AddAccount(_account);
            }
            if (_selectedSupply.CashPaid > 0)
            {
                Safe _safe = new Safe
                {
                    Date             = _selectedSupply.Date,
                    RegistrationDate = _selectedSupply.RegistrationDate,
                    Statement        = "فاتورة مشتريات رقم " + ID + " من العميل : " + _selectedSupply.Client.Name,
                    Amount           = -_selectedSupply.CashPaid,
                    Source           = 3
                };
                _safeServ.AddSafe(_safe);
            }
            DS ds = new DS();

            ds.Sale.Rows.Clear();
            int i = 0;

            foreach (var item in _supplyCategories)
            {
                ds.Sale.Rows.Add();
                ds.Sale[i]["ID"]         = ID;
                ds.Sale[i]["Date"]       = _selectedSupply.Date;
                ds.Sale[i]["Client"]     = _selectedSupply.Client.Name;
                ds.Sale[i]["Serial"]     = i + 1;
                ds.Sale[i]["Category"]   = item.Category + " " + item.Company;
                ds.Sale[i]["Qty"]        = item.Qty;
                ds.Sale[i]["Price"]      = Math.Round(Convert.ToDecimal(item.CostAfterTax), 2);
                ds.Sale[i]["TotalPrice"] = Math.Round(Convert.ToDecimal(item.CostTotalAfterTax), 2);
                ds.Sale[i]["BillPrice"]  = Math.Round(Convert.ToDecimal(_selectedSupply.CostAfterTax), 2);
                ds.Sale[i]["OldDebt"]    = Math.Abs(Math.Round(Convert.ToDecimal(_selectedSupply.OldDebt), 2));

                ds.Sale[i]["Paid"]    = Math.Abs(Math.Round(Convert.ToDecimal(_selectedSupply.CashPaid + _selectedSupply.DiscountPaid), 2));
                ds.Sale[i]["NewDebt"] = Math.Abs(Math.Round(Convert.ToDecimal(_selectedSupply.NewDebt), 2));
                if (_selectedSupply.NewDebt > 0)
                {
                    ds.Sale[i]["PrintingMan"] = "له";
                }
                else if (_selectedSupply.NewDebt < 0)
                {
                    ds.Sale[i]["PrintingMan"] = "عليه";
                }

                if (_selectedSupply.OldDebt > 0)
                {
                    ds.Sale[i]["Type"] = "له";
                }
                else if (_selectedSupply.OldDebt < 0)
                {
                    ds.Sale[i]["Type"] = "عليه";
                }
                ds.Sale[i]["BillTotal"] = Math.Abs(Math.Round(Convert.ToDecimal(_selectedSupply.OldDebt), 2) + Math.Round(Convert.ToDecimal(_selectedSupply.CostAfterTax), 2));
                if (Math.Round(Convert.ToDecimal(_selectedSupply.OldDebt), 2) + Math.Round(Convert.ToDecimal(_selectedSupply.CostAfterTax), 2) > 0)
                {
                    ds.Sale[i]["Type2"] = "له";
                }
                else if (Math.Round(Convert.ToDecimal(_selectedSupply.OldDebt), 2) + Math.Round(Convert.ToDecimal(_selectedSupply.CostAfterTax), 2) < 0)
                {
                    ds.Sale[i]["Type2"] = "عليه";
                }
                i++;
            }
            ReportWindow rpt       = new ReportWindow();
            SupplyReport supplyRPT = new SupplyReport();

            supplyRPT.SetDataSource(ds.Tables["Sale"]);
            rpt.crv.ViewerCore.ReportSource = supplyRPT;
            Mouse.OverrideCursor            = null;
            _currentWindow.Hide();
            rpt.ShowDialog();
            _currentWindow.Close();
        }