Exemplo n.º 1
0
        private void cboSelectLocation_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int intCounter;
            int intNumberOfRecords;
            int intSelectedIndex;

            try
            {
                cboSelectAssetLocation.Items.Clear();
                cboSelectAssetLocation.Items.Add("Select Location");

                intSelectedIndex = cboSelectLocation.SelectedIndex - 1;

                if (intSelectedIndex > -1)
                {
                    gstrSite = TheFindWarehousesDataSet.FindWarehouses[intSelectedIndex].FirstName;

                    if (gstrSite == "CBUS-GROVEPORT")
                    {
                        gstrSite = "GROVEPORT";
                    }

                    TheFindWaspAssetLocationBySiteDataSet = TheAssetClass.FindWaspAssetLocationBySite(gstrSite);

                    intNumberOfRecords = TheFindWaspAssetLocationBySiteDataSet.FindWaspAssetLocationBySite.Rows.Count;

                    if (intNumberOfRecords > 0)
                    {
                        MainWindow.gintWarehouseID = TheFindWarehousesDataSet.FindWarehouses[intSelectedIndex].EmployeeID;

                        for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++)
                        {
                            cboSelectAssetLocation.Items.Add(TheFindWaspAssetLocationBySiteDataSet.FindWaspAssetLocationBySite[intCounter].AssetLocation);
                        }
                    }

                    cboSelectAssetLocation.SelectedIndex = 0;
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Import Assets // Site Combo Box Selection " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }