コード例 #1
0
        public void TestMethod1()
        {
            EngagementEngine.Initialize(@"D:\Vz.AgentEngagement\Vz.AgentEngagement\XML\");
            EngagementResult objEngagementResult = EngagementEngine.GetEngagement(new EngagementRequest {
                AgentId = "Agent1"
            });

            Assert.AreEqual(0, objEngagementResult.FreeMinutes);
        }
コード例 #2
0
        public void TestMethod1()
        {
            //EngagementEngine.Initialize(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Content" @"D:\Vz.AgentEngagement\Vz.AgentEngagement\XML\");
            EngagementEngine.Initialize(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "XML"));
            EngagementResult objEngagementResult = EngagementEngine.GetEngagement(new EngagementRequest {
                AgentId = "Agent1"
            });

            Assert.AreEqual(0, objEngagementResult.FreeMinutes);
        }
コード例 #3
0
        public EngagementResult getAgentStatus(string strAgentID)
        {
            EngagementResult objEngagementResult = EngagementEngine.GetEngagement(new EngagementRequest {
                AgentId = strAgentID
            });

            return(objEngagementResult);
            //EngagementResult objEngagementResult = new EngagementResult();

            //List<EngagementItem> lstEngagementItem = new List<EngagementItem>();
            //lstEngagementItem.Add(new EngagementItem{ ItemDuration = 10, ItemUrl="http://in.msn.com", ItemType = EngagementItemType.Training, ItemTitle = "Mobile Coach"});
            //lstEngagementItem.Add(new EngagementItem { ItemDuration = 10, ItemUrl = "http://in.msn.com", ItemType = EngagementItemType.Training, ItemTitle = "Support Info" });
            //lstEngagementItem.Add(new EngagementItem { ItemDuration = 10, ItemUrl = "http://in.msn.com", ItemType = EngagementItemType.Training, ItemTitle = "IPACD" });

            //lstEngagementItem.Add(new EngagementItem { ItemDuration = 10, ItemUrl = "http://in.msn.com", ItemType = EngagementItemType.Followup, ItemTitle = "Past Due: 10" });
            //lstEngagementItem.Add(new EngagementItem { ItemDuration = 10, ItemUrl = "http://in.msn.com", ItemType = EngagementItemType.Followup, ItemTitle = "Past Due: 20" });
            //lstEngagementItem.Add(new EngagementItem { ItemDuration = 10, ItemUrl = "http://in.msn.com", ItemType = EngagementItemType.Followup, ItemTitle = "Past Due: 30" });
            //objEngagementResult.FreeMinutes = 1;
            //objEngagementResult.Items = lstEngagementItem;
            //return objEngagementResult;
        }
コード例 #4
0
        public static string GetInfo(string agentid)
        {
            EngagementRequest objEngagementRequest = null;
            AgentModel        objAgentModel        = null;
            EngagementResult  objEngagementResult  = null;
            StringBuilder     sb = null;

            try
            {
                //Form Request
                objEngagementRequest         = new EngagementRequest();
                objEngagementRequest.AgentId = agentid;

                objAgentModel = new AgentModel();

                objEngagementResult = objAgentModel.getAgentStatus(agentid);

                if (objEngagementResult != null)
                {
                    if (objEngagementResult.FreeMinutes == 0)
                    {
                        return(string.Empty);
                    }

                    sb = new StringBuilder();
                    sb.Append("<div style='font-size: 20px; padding-bottom:10px'> You have <span id='divFreeMin'>" + objEngagementResult.FreeMinutes.ToString() + "</span> free minutes left. What would you like to do?</div>");
                    var lstTrainingEngagement = objEngagementResult.Items.Where(x => x.ItemType == EngagementItemType.Training);
                    if (lstTrainingEngagement != null)
                    {
                        //sb.Append("<div class='left-div'><b>Training<b><ul>");
                        sb.Append("<div class='col-xs-6'><h5>Training<h5><ul class='list-group'>");
                        foreach (EngagementItem obj in lstTrainingEngagement)
                        {
                            if (!string.IsNullOrEmpty(obj.Url))
                            {
                                sb.Append("<li class='list-group-item'><a data-dismiss='modal' onclick=\"startTraining('" + obj.Url + "','TRAINING');\">" + obj.Title + " - " + obj.Duration + "</a></li>");
                            }
                            else
                            {
                                sb.Append("<li class='list-group-item'>" + obj.Title + " - " + obj.Duration + "</li>");
                            }
                        }
                        sb.Append("</ul></div>");
                    }


                    var lstFollowupEngagement = objEngagementResult.Items.Where(x => x.ItemType == EngagementItemType.Followup);
                    if (lstFollowupEngagement != null)
                    {
                        sb.Append("<div class='col-xs-6'><h5>Followup</h5><ul class='list-group'>");
                        foreach (EngagementItem obj in lstFollowupEngagement)
                        {
                            if (!string.IsNullOrEmpty(obj.Url))
                            {
                                sb.Append("<li class='list-group-item'><a data-dismiss='modal' onclick=\"startTraining('" + obj.Url + "','FOLLOWUP');\">" + obj.Title + "</a></li>");
                            }
                            else
                            {
                                sb.Append("<li class='list-group-item'>" + obj.Title + "</li>");
                            }
                        }
                        sb.Append("</ul></div>");
                    }
                    return(sb.ToString());
                }
                return(string.Empty);
            }
            catch (Exception exp)
            {
                return(exp.Message.ToString());
            }
            finally
            {
            }


            /*
             * try
             *  {
             *
             *  sb.Append("<div class='left-div'>Training<ul>");
             *  sb.Append("<li>sdfsdf</li>");
             *  sb.Append("<li>sdfsdf</li>");
             *  sb.Append("<li>sdfsdf</li>");
             *  sb.Append("</div>");
             *  sb.Append("<div class='right-div'>Follow up<ul>");
             *  sb.Append("<li>sdfsdf</li>");
             *  sb.Append("<li>sdfsdf</li>");
             *  sb.Append("<li>sdfsdf</li>");
             *  sb.Append("</div>");
             *  }
             * catch(Exception exp)
             * {
             *  return exp.Message.ToString();
             * }
             * return sb.ToString();
             */
        }