troubleshooting Question

IsRequiredDateSold = requiredFields[9] == 'T', What does the 9 really mean. Index Value?

Avatar of Stacie
StacieFlag for United States of America asked on
.NET MVCC#
3 Comments2 Solutions124 ViewsLast Modified:
I have the following method below and I'm having a hard time understanding what does the following notation mean... The following code is reading from a table and converting it to a variable just not sure why the 9?

requiredFields[9] == 'T',  why a 9?

public static GeneralSetupProgramJobParameter GetProgramJobParameters(
            GeneralSetupProgramJobParameter item,
            string reqdfields,
            string prodparam,
            string chngparam,
            string estutilfld,
            bool defaultStatus0For2ndPrgm
            )
        {
                var requiredFields = reqdfields.ToCharArray();
                var productionDefaults = prodparam.ToCharArray();
                var changeParams = chngparam.ToCharArray();
                var estUtilFields = estutilfld.ToCharArray();

                item.DefaultToStatus0For2ndProgram = defaultStatus0For2ndPrgm;

                item.ProgramJobRequiredFields = new ProgramJobRequiredFields
                {
                    IsRequiredDateSold = requiredFields[9] == 'T',
                    IsRequiredSalesPerson = requiredFields[11] == 'T',
                    IsRequiredSource = requiredFields[10] == 'T',
                    IsRequiredSize = requiredFields[16] == 'T',
                    IsRequiredRoute = requiredFields[14] == 'T',
                    IsRequiredCancelDate = requiredFields[12] == 'T',
                    IsRequiredCancelReason = requiredFields[13] == 'T',
                    IsRequiredRejectReason = requiredFields[15] == 'T',
                    IsRequiredEstimatedBy = requiredFields[26] == 'T',
                };

                item.ProductionDefaults = new ProductionDefaults
                {
                    ProductAmounts = productionDefaults[0] == 'T',
                    StartTime = productionDefaults[1] == 'T',
                    EndTime = productionDefaults[2] == 'T',
                    WindSpeedAndDirection = productionDefaults[4] == 'T',
                    Temperature = productionDefaults[5] == 'T',
                    pH = productionDefaults[6] == 'T',
                    ConditionCodes = productionDefaults[8] == 'T',
                    Rating = productionDefaults[9] == 'T',
                    SaveAssociatedConditions = productionDefaults[7] == 'T',
                    Size = productionDefaults[10] == 'T',
                    Price = productionDefaults[11] == 'T',
                };
ASKER CERTIFIED SOLUTION
Chinmay Patel
Chief Technology Ninja
Join our community to see this answer!
Unlock 2 Answers and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros