예제 #1
0
        public static string GetString(int stringType, string inString)
        {
            string outString = String.Empty; // "<span style='color: Orange'>?</span>";

            try
            {
                if (Relationship == null)
                {
                    Initialise();
                }

                if (inString.Length == 0)
                {
                    return(inString);
                }

                switch (stringType)
                {
                case (int)StringType.LocationType:
                {
                    outString = LocationType.FindLast(delegate(Item i) { return(i.Value == inString); }).Text;
                    break;
                }

                case (int)StringType.Direction:
                {
                    outString = Direction.FindLast(delegate(Item i) { return(i.Value == inString); }).Text;
                    break;
                }

                case (int)StringType.Sector:
                {
                    outString = Sector.FindLast(delegate(Item i) { return(i.Value == inString); }).Text;
                    break;
                }

                case (int)StringType.InvoiceStatus:
                {
                    outString = InvoiceStatus.FindLast(delegate(Item i) { return(i.Value == inString); }).Text;
                    break;
                }

                case (int)StringType.SecurityQuestion:
                {
                    outString = SecurityQuestion.FindLast(delegate(Item i) { return(i.Value == inString); }).Text;
                    break;
                }

                case (int)StringType.SubscriberType:
                {
                    outString = SubscriberType.FindLast(delegate(Item i) { return(i.Value == inString); }).Text;
                    break;
                }

                case (int)StringType.Sex:
                {
                    outString = Sex.FindLast(delegate(Item i) { return(i.Value == inString); }).Text;
                    break;
                }

                case (int)StringType.Title:
                {
                    outString = Title.FindLast(delegate(Item i) { return(i.Value == inString); }).Text;
                    break;
                }

                case (int)StringType.Status:
                {
                    outString = Status.FindLast(delegate(Item i) { return(i.Value == inString); }).Text;
                    break;
                }

                case (int)StringType.ContractType:
                {
                    outString = ContractType.FindLast(delegate(Item i) { return(i.Value == inString); }).Text;
                    break;
                }

                case (int)StringType.MaritalStatus:
                {
                    outString = MaritalStatus.FindLast(delegate(Item i) { return(i.Value == inString); }).Text;
                    break;
                }

                case (int)StringType.Relationship:
                {
                    outString = Relationship.FindLast(delegate(Item i) { return(i.Value == inString); }).Text;
                    break;
                }
                }
            }
            catch (Exception ex)
            {
                string s = ex.Message;
            }

            return(outString);
        }