Пример #1
0
        /// <summary>
        /// Add agent id to calldetail
        /// </summary>
        /// <param name="campaign"></param>
        /// <param name="callDetail"></param>
        /// <returns></returns>
        public static bool AddAgentToCallDetail(Campaign objCampaign, CampaignDetails callDetail, bool isVerification)
        {
            // 03/19/2010 - removed verification agent as 'Transfered To verification' resultcode is removed (Client request)
            callDetail.VerificationAgentID = "";
            DialerEngine.Log.Write("|CA|{0}|{1}|Adding agent '{2}' to call details invoked, verification flag set to {3}.", objCampaign.CampaignID, objCampaign.ShortDescription, callDetail.AgentName, isVerification);
            CampaignService objCampService = null;
            XmlDocument     xDocCallDetail = null;
            XmlDocument     xDocCampaign   = null;

            try
            {
                if (callDetail != null)
                {
                    objCampService = new CampaignService();
                    xDocCampaign   = new XmlDocument();
                    xDocCampaign.LoadXml(Serialize.SerializeObject(objCampaign, "Campaign"));
                    xDocCallDetail = new XmlDocument();
                    xDocCallDetail.LoadXml(Serialize.SerializeObject(callDetail, "CampaignDetails"));
                    objCampService.AddAgentToCallDetail(xDocCampaign, xDocCallDetail, isVerification);
                    return(true);
                }
            }
            catch (Exception ex)
            {
                DialerEngine.Log.WriteException(ex, "Error in AddAgentToCallDetail");
            }
            finally
            {
                objCampService = null;
                xDocCampaign   = null;
            }
            return(false);
        }
        protected void lbtnTest_Click(object sender, EventArgs e)
        {
            Campaign        objCampaign = new Campaign();
            CampaignDetails callDetail  = new CampaignDetails();

            objCampaign.CampaignDBConnString = @"Data Source=RAINMAKER\SQLEXPRESS;User ID=sa;Pwd=jetblue;Initial Catalog=Anime1";
            callDetail.AgentID   = "35";
            callDetail.AgentName = "Bowzer";
            callDetail.UniqueKey = 1;
            CampaignService objCampService = new CampaignService();
            XmlDocument     xDocCampaign   = new XmlDocument();

            xDocCampaign.LoadXml(Serialize.SerializeObject(objCampaign, "Campaign"));
            XmlDocument xDocCallDetail = new XmlDocument();

            xDocCallDetail.LoadXml(Serialize.SerializeObject(callDetail, "CampaignDetails"));
            objCampService.AddAgentToCallDetail(xDocCampaign, xDocCallDetail, false);
            return;
        }