private void bw_DoWork(object sender, DoWorkEventArgs e)
        {
            var bal = new Balance();
            var dtBal = new DataTable();

            int[] arr = (int[])e.Argument;

            int storeId = arr[0], month = arr[1], year = arr[2], programID = arr[3], commodityTypeID = arr[4];

            switch (VisibilitySetting.HandleUnits)
            {
                case 1:
                    if (filter == "Stock Out" && ckExclude.Checked)
                    {
                        dtBal = bal.BalanceOfAllItemsForStockStatus(storeId, year, month, SelectedType, programID, commodityTypeID, dtCur, bw);
                    }
                    else if (filter == "Stock Out" && !ckExclude.Checked)
                    {
                        dtBal = bal.BalanceOfAllItemsForStockStatus(storeId, year, month, SelectedType, programID, commodityTypeID, dtCur, bw);
                    }
                    else if (filter == "Over Stocked" && ckExclude.Checked)
                    {
                        dtBal = bal.BalanceOfAllItemsForStockStatus(storeId, year, month, SelectedType, programID, commodityTypeID, dtCur, bw);
                    }
                    else if (filter == "Over Stocked" && !ckExclude.Checked)
                    {
                        dtBal = bal.BalanceOfAllItemsForStockStatus(storeId, year, month, SelectedType, programID, commodityTypeID, dtCur, bw);
                    }

                    e.Result = dtBal;
                    break;
                case 2:
                    dtBal = (DataTable)bal.BalanceOfAllItemsUsingUnit(storeId, year, month, SelectedType, programID, commodityTypeID, dtCur, bw);
                    e.Result = dtBal;
                   break;
                default:
                    dtBal = (DataTable)bal.BalanceOfAllItemsUsingUnit(storeId, year, month, SelectedType, programID, commodityTypeID, dtCur, bw);
                    e.Result = dtBal;
                   break;
            }
            //  e.Result = dtBal;
        }
        /// <summary>
        /// Gets the balance of all items
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bw_DoWork(object sender, DoWorkEventArgs e)
        {
            Balance bal = new Balance();

            int[] arr = (int[])e.Argument;

            int storeId = arr[0], month = arr[1], year = arr[2], programID = arr[3], commodityTypeID = arr[4];

            switch (VisibilitySetting.HandleUnits)
            {
                case 1:
                    {
                        var dtBal = bal.BalanceOfAllItemsForStockStatus(storeId, year, month, _selectedType, programID, commodityTypeID,
                                                          _dtCur, bw);
                        e.Result = dtBal;
                    }
                    break;
                case 2:
                    {
                        var dtBal = bal.BalanceOfAllItemsUsingUnit(storeId, year, month, _selectedType, programID, commodityTypeID,
                                                          _dtCur, bw);
                        e.Result = dtBal;
                    }
                    break;
                case 3:
                    {
                        var dtBal = bal.BalanceOfAllItemsUsingUnit(storeId, year, month, _selectedType, programID, commodityTypeID,
                                                          _dtCur, bw);
                        e.Result = dtBal;
                    }
                    break;
            }
        }