Beispiel #1
0
        private void cboSelectSite_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            //stting up for getting the info
            int    intCounter;
            int    intNumberOfRecords;
            string strSite;
            int    intSelectedIndex;

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

                intSelectedIndex = cboSelectSite.SelectedIndex - 1;

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

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

                    TheFindSortedWaspAssetLocationsBySiteDataSet = TheAssetClass.FindSortedAssetLocationsBySite(strSite);

                    intNumberOfRecords = TheFindSortedWaspAssetLocationsBySiteDataSet.FindSortedWaspAssetLoctionsBySite.Rows.Count;

                    if (intNumberOfRecords > 0)
                    {
                        for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++)
                        {
                            cboSelectLocation.Items.Add(TheFindSortedWaspAssetLocationsBySiteDataSet.FindSortedWaspAssetLoctionsBySite[intCounter].AssetLocation);
                        }
                    }
                }

                cboSelectLocation.SelectedIndex = 0;
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Select Wasp Asset // CBO Site Select " + Ex.Message);

                TheMessageClass.ErrorMessage(Ex.ToString());
            }
        }
Beispiel #2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            int    intCounter;
            int    intNumberOfRecords;
            int    intSelectedIndex = 0;
            string strSite;
            string strLocation;

            try
            {
                cboSelectLocation.Items.Clear();
                cboSelectLocation.Items.Add("Select Location");
                cboSelectLocation.SelectedIndex = 0;

                cboSelectSite.Items.Clear();
                cboSelectSite.Items.Add("Select Site");

                TheFindWarehousesDataSet = TheEmployeeClass.FindWarehouses();

                intNumberOfRecords = TheFindWarehousesDataSet.FindWarehouses.Rows.Count;

                for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++)
                {
                    cboSelectSite.Items.Add(TheFindWarehousesDataSet.FindWarehouses[intCounter].FirstName);
                }

                cboSelectSite.SelectedIndex = 0;

                TheFindWaspAssetByAssetIDDataSet = TheAssetClass.FindWaspAssetByAssetID(MainWindow.gintAssetID);

                txtAssetID.Text = Convert.ToString(MainWindow.gintAssetID);

                strSite  = TheFindWaspAssetByAssetIDDataSet.FindWaspAssetByAssetID[0].AssetSite;
                gstrSite = strSite;

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

                strLocation = TheFindWaspAssetByAssetIDDataSet.FindWaspAssetByAssetID[0].AssetLocation;

                intNumberOfRecords = TheFindWarehousesDataSet.FindWarehouses.Rows.Count;

                for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++)
                {
                    if (strSite == TheFindWarehousesDataSet.FindWarehouses[intCounter].FirstName)
                    {
                        intSelectedIndex = intCounter + 1;
                    }
                }

                cboSelectSite.SelectedIndex = intSelectedIndex;

                TheFindSortedAssetLocationsBySiteDataSet = TheAssetClass.FindSortedAssetLocationsBySite(gstrSite);

                intNumberOfRecords = TheFindSortedAssetLocationsBySiteDataSet.FindSortedWaspAssetLoctionsBySite.Rows.Count;
                intSelectedIndex   = 0;

                if (intNumberOfRecords > 0)
                {
                    for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++)
                    {
                        if (strLocation == TheFindSortedAssetLocationsBySiteDataSet.FindSortedWaspAssetLoctionsBySite[intCounter].AssetLocation)
                        {
                            intSelectedIndex = intCounter + 1;
                        }
                    }
                }

                cboSelectLocation.SelectedIndex = intSelectedIndex;
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Change Wasp Location // Window Loaded Event " + Ex.Message);

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