// // This method is designed to load prompts for type "O" - optional data for fleet cards // type "F" - fuel prompts are loaded along with the profile in Loadprofile method (card profile class) /// <summary> /// Method to load prompts /// </summary> /// <param name="cardPrompts">Card prompts</param> /// <param name="cc">Credit card</param> /// <param name="profileId">Profile Id</param> public void Load_Prompts(ref CardPrompts cardPrompts, Credit_Card cc, string profileId) { //2013 11 08 - Reji - Wex Fleet Card Integration var profPromptLinkClause = " And 1=2 "; if (cc != null) { if (!string.IsNullOrEmpty(cc.Crd_Type)) { profPromptLinkClause = ""; } if (cc.Crd_Type == "F" && cc.GiftType.ToUpper() == "W") { // profPromptLinkClause = ProfPromptLinkList(cc, profileId); } } var prompts = _cardService.LoadCardPrompts(profileId); //2013 11 08 - Reji - Wex Fleet Card Integration - End foreach (var prompt in prompts) { cardPrompts.Add(prompt.MaxLength, prompt.MinLength, prompt.PromptMessage, prompt.PromptSeq, prompt.PromptID, "", prompt.PromptID.ToString()); } }
/// <summary> /// method to get the card profile prompts /// </summary> /// <param name="prompts"></param> /// <param name="cc"></param> /// <param name="profileId"></param> public void GetProfilePrompts(ref CardPrompts prompts, Credit_Card cc, string profileId) { var promptCodeString = cc.Track2?.Replace(";" + cc.Cardnumber + "=", "").Replace("?", ""); promptCodeString = promptCodeString?.Substring(4, 1) + promptCodeString?.Substring(promptCodeString.Length - 1, 1); if (promptCodeString == "00") { return; } if (string.IsNullOrEmpty(promptCodeString)) { prompts.Add(20, 3, "Enter Card Data ", 1, 5009, "", ""); return; } _wexService.GetCardProfilePrompts(ref prompts, promptCodeString, profileId); }
/// <summary> /// method to get the prompts associated with the cards /// </summary> /// <param name="prompts"></param> /// <param name="promptString"></param> /// <param name="profileId"></param> public void GetCardProfilePrompts(ref CardPrompts prompts, string promptString, string profileId) { var query = "SELECT MaxLength, MinLength, PromptMessage, PromptSeq, A.PromptID FROM CardProfilePrompts AS A INNER JOIN CardFuelPrompts AS B ON A.PromptID = B.PromptID AND A.Type=B.Type WHERE A.Type =\'O\' AND ProfileID = \'" + profileId + "\' " + "AND A.PromptID in ( Select PromptID from CardProfilePrompts " + " where PromptID in (select[PromptID] from " + " CardProfilePromptLink where CardPromptID =\'" + promptString + "\' " + " and ProfileID = \'" + profileId + "\') " + " and ProfileID = \'" + profileId + "\')" + "ORDER BY PromptSeq "; var dt = GetRecords(query, DataSource.CSCMaster); var cardPrompts = new List <CardPrompt>(); foreach (DataRow dr in dt.Rows) { cardPrompts.Add(new CardPrompt { MaxLength = CommonUtility.GetShortValue(dr["MaxLength"]), MinLength = CommonUtility.GetShortValue(dr["MinLength"]), PromptMessage = CommonUtility.GetStringValue(dr["PromptMessage"]), PromptSeq = CommonUtility.GetByteValue(dr["PromptSeq"]), PromptID = CommonUtility.GetShortValue(dr["PromptID"]) }); } prompts = cardPrompts; }