コード例 #1
0
        void RefreshProgress()
        {
            try
            {
                Exception ex;

                PutAwayAisle = uxCBAisle.Text;
                PutAwayShelf = Int32.Parse(uxCBShelf.Text);
                if (!(PutAwayShelf > 0))
                {
                    ex = new Exception("Shelf not selected.");
                    uxCBShelf.Focus();
                    throw ex;
                }
                PutAwaySubshelf = Int32.Parse(uxCBSubshelf.Text);
                if (!(PutAwaySubshelf > 0))
                {
                    ex = new Exception("Subshelf not selected.");
                    uxCBSubshelf.Focus();
                    throw ex;
                }

                taPhysicalProgress.Fill(dsPhysicalInventory.PhysicalProgress, PutAwayAisle, PutAwayShelf, PutAwaySubshelf);
                uxGridProgress.DataSource = taPhysicalProgress.GetPhysicalProgressByAddress(PutAwayAisle, PutAwayShelf, PutAwaySubshelf);

                taPhysicalProgressSummary.Fill(dsPhysicalInventory.PhysicalProgressSummary, PutAwayAisle, PutAwayShelf, PutAwaySubshelf);
                switch (dsPhysicalInventory.PhysicalProgressSummary.Rows.Count)
                {
                case 1:
                    uxLabelProgress.Text = dsPhysicalInventory.PhysicalProgressSummary[0].FoundCount.ToString() + " Found, " +
                                           dsPhysicalInventory.PhysicalProgressSummary[0].MissingCount.ToString() + " Missing, " +
                                           dsPhysicalInventory.PhysicalProgressSummary[0].TotalCount.ToString() + " Total";
                    break;

                default:
                    ex = new Exception("Unable to retrieve summary.");
                    throw ex;
                }
            }
            catch (SqlException ex)
            {
                foreach (SqlError SQLErr in ex.Errors)
                {
                    MessageBox.Show(SQLErr.Message);
                }
            }
        }