public StatisticsView(string animationName)
 {
     InitializeComponent();
     _purchaseClient = new PurchaseClient();
     _orderClient = new OrderClient();
     _productClient = new ProductManger();
     _suppliersManager = new SuppliersManager();
     _customersManager = new CustomersManager();
     if (string.IsNullOrEmpty(animationName)) return;
     Storyboard animation = (Storyboard)Application.Current.Resources[animationName];
     LayoutRoot.BeginStoryboard(animation);
 }
        private void CustomersDataTable_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (PurchaseGridControl.VisibleRowCount == 0) return;
            int rowHandle = PurchaseGridControl.View.FocusedRowHandle;
            if (rowHandle < 0) return;
            _purchaseClient = new PurchaseClient();
            int purchaseId = Convert.ToInt32(PurchaseGridControl.GetCellValue(rowHandle, "PurchaseID").ToString());
            _getPurchase = _purchaseClient.GetPurchaseById(purchaseId);

            if (_getPurchase == null) return;
            LoadPurchaseStoreGridControl(_getPurchase);
               // OrderDateDateEdit.Text = order.OrderDate.ToString();
        }
        public ListPurchasesView(string animationName, TabHelper hlp)
        {
            InitializeComponent();
            _tabHlp = hlp;
            if (!string.IsNullOrEmpty(animationName))
            {
                Storyboard animation = (Storyboard)Application.Current.Resources[animationName];
                LayoutRoot.BeginStoryboard(animation);
            }

            _suppliersManager = new SuppliersManager();
            _purchaseClient=new PurchaseClient();
            _CategorysClient=new CategorysClient();
        }
        public ListSalesView(string animationName, TabHelper hlp)
        {
            InitializeComponent();
            _tabHlp = hlp;

            _supplierClient = new SuppliersManager();
            _purchaseClient = new PurchaseClient();
            EditPurchaseBtn.Visibility = Visibility.Collapsed;
            CancelPurchaseBtn.Visibility = Visibility.Collapsed;
            image1.Visibility = Visibility.Collapsed;
            image2.Visibility = Visibility.Collapsed;

            _purchaseDetailsManager = new PurchaseDetailsManager();
            cc = new CategorysClient();

            mc = new CategorysManager();
            if (string.IsNullOrEmpty(animationName)) return;
            Storyboard animation = (Storyboard)Application.Current.Resources[animationName];
            LayoutRoot.BeginStoryboard(animation);
        }
 private void SuppliersDataTable_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
 {
     if (PurchasesDataGrid.VisibleRowCount == 0) return;
     int rowHandle = PurchasesDataGrid.View.FocusedRowHandle;
     if (rowHandle < 0) return;
     PurchaseClient purchaseClient = new PurchaseClient();
     int purchaseId = (int) PurchasesDataGrid.GetCellValue(rowHandle, "PurchaseID");
     Purchase getPurchase = purchaseClient.GetPurchaseById(purchaseId);
     if (getPurchase == null) return;
     LoadGridProducts(getPurchase);
 }
 private void GetPurchaseStoresFromPurchaseOnDoWork(object sender, DoWorkEventArgs e)
 {
     Purchase thePurchase = (Purchase) e.Argument;
     _purchaseClient = new PurchaseClient();
     var getPurchaseStores = _purchaseClient.GetPurchaseStoresList(thePurchase);
     e.Result = getPurchaseStores;
 }
 private void GetPurchasesOfProviderOnDoWork(object sender, DoWorkEventArgs e)
 {
     _purchaseClient=new PurchaseClient();
     Provider receiveProvider = (Provider) e.Argument;
     _listPurchases = _purchaseClient.GetPurchasesByProvider(receiveProvider);
     e.Result = _listPurchases;
 }