Esempio n. 1
0
        public void TestClaimCsrId()
        {
            const string csrs = "AKINLS1 AKINLEYE, STEPHENSON ;WILKINS1 WILKINS, SUSAN ;ARAUJB1 ARAUJO, BARBARA ;BALDWP1 BALDWIN, PCLA, PATRICIA ;BROWNJ3 BROWN, JOY ;BULLOC1 BULLOCK, CASSANDRA ;COKERM1 COKER, MARY ;COLLIB1 COLLINS, BRIANNE ;DICKSJ1 DICKSON, JESSICA ;FRANKK1 FRANKLIN, KRYSTAL ;GREENS2 GREEN, SHUKRIYYAH ;GUADAA1 GUADAMUZ, ANGELA ;HENRIR1 HENRIQUEZ, IRENE ;INGRAR1 INGRAM, ROBERT ;KENDEB1 KENDUS, BRIAN ;LITTEM1 LITTELL, MELISSA ;MORGAJ1 MARTIN, JAMIE L. ;MITCHS1 MITCHELL, SAFONIA ;CSCAUTOQ QUEUE, AUTO_CLAIMS ;CSCPROP QUEUE, PROPERTY_CLAIMS ;SAFELITE QUEUE, SAFELITE_EDI ;RIOSRS1 RIOS, ROSA ;ROLANC1 ROLAND, CHEKESHA ;SPIERB1 SPIERS, BETTY ;SWERTL1 SWERTFEGER, LISBETH ;VOORHC1 VOORHEES, CHRISTINE ;WILLIJ4 WILLIAMS, JAMES F.";

            Assert.IsTrue(ClaimCsrId.ProcessDelimitedCsrString("12345678", csrs), "ProcessDelimitedCsrString failed!");
            Console.WriteLine("ProcessDelimitedCsrString returned true.");
        }
Esempio n. 2
0
        /// <summary>
        /// Processes the delimited CSR string.
        /// </summary>
        /// <param name="callId">The call id.</param>
        /// <param name="csrIds">The CSR ids.</param>
        /// <returns></returns>
        static public bool ProcessDelimitedCsrString(string callId, string csrIds)
        {
            bool results;

            try
            {
                var reset = new ResetClaimCms {
                    CallId = callId
                };

                reset.Execute();

                var test = new ClaimCsrId();

                var names = csrIds.Split(';');

                foreach (var t in names)
                {
                    var namesId = t.Split(',');
                    if (namesId.Length < 2)
                    {
                        continue;
                    }
                    var csrIdname = namesId[0].Split(' ');
                    if (csrIdname.Length <= 1)
                    {
                        continue;
                    }
                    test.Reset();
                    test.CallId    = callId;
                    test.CsrId     = csrIdname[0].Trim();
                    test.LastName  = csrIdname[csrIdname.Length - 1].Trim();
                    test.FirstName = namesId[1].Trim();
                    if (namesId.Length == 3)
                    {
                        test.FirstName = namesId[2].Trim();
                        test.LastName += " " + namesId[1].Trim();
                    }
                    if (!test.Execute())
                    {
                        throw new ApplicationException(test.LastError);
                    }
                }
                results = true;
            }
            catch (Exception ex)
            {
                GeneralUtility.DebugLog(ex.Message, "ProcessDelimitedCsrString");
                results = false;
            }
            return(results);
        }