예제 #1
0
        /// <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;
            }
        }
예제 #2
0
        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")
                {
                    dtBal = bal.BalanceOfAllItemsForStockStatus(storeId, year, month, SelectedType, programID, commodityTypeID, dtCur, bw);
                }
                else if (filter == "Over Stocked")
                {
                    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;
        }