Exemple #1
0
        protected string GetEquipmentImageURL(string model, bool madCalmPic, IDialogContext context)
        {
            bool   planChosen;
            int    planCode = 1;
            string temp;

            if (handSets == null)
            {
                InitializeDataStruct();
            }

            try
            {
                if (planChosen = context.ConversationData.TryGetValue("ChosenPlanName", out temp))
                {
                    foreach (var key in planNamesMapping.Keys)
                    {
                        if (temp.StartsWith(key))
                        {
                            planCode = (int)planNamesMapping[key];
                            break;
                        }
                    }
                }

                return(handSets.GetImageURL(model, madCalmPic, planChosen, planCode));
            }
            catch (Exception xception)
            {
                if (debugMessages)
                {
                    context.PostAsync("DEBUG : error...message = " + xception.Message);
                }
                return(null);
            }
        }