예제 #1
0
        /// <summary>
        /// Clear the Incident's ReservedAgent and Disable Agent not taking the call
        /// </summary>
        /// <param name="dtAllPoolAgents"></param>
        /// <returns></returns>
        protected bool checkReservations(PoolDS.PoolDSDataTable dtAllPoolAgents)
        {
            bool result = false;

            PoolDS.PoolDSRow[] rows = (PoolDS.PoolDSRow[])dtAllPoolAgents.Select("is_available=1 and is_busy=0", "");
            if (rows.Length > 0)
            {
                int cancelInterval = UcConfParameters.UcCallForwardingInterval;     // seconds


                foreach (PoolDS.PoolDSRow row in dtAllPoolAgents.Rows)
                {
                    if ((!row.Isincident_idNull()) && (!row.Isdate_reservedNull()))
                    {
                        DateTime now  = DateTime.Now.ToUniversalTime();
                        TimeSpan span = now.Subtract(row.date_reserved);
                        TimeSpan max  = new TimeSpan(0, 0, cancelInterval);

                        if (TimeSpan.Compare(span, max) > 0)
                        {
                            Int32 incidentId = row.incident_id;

                            Int32 incidentStatusId = 0;
                            Int32 incidentAgentId  = 0;

                            IncidentDS.IncidentDSDataTable dtIncident = BllProxyIncident.SelectIncident(incidentId);
                            if (dtIncident.Rows.Count > 0)
                            {
                                incidentStatusId = dtIncident[0].status_id;
                                if (!dtIncident[0].Isagent_idNull())
                                {
                                    incidentAgentId = dtIncident[0].agent_id;
                                }
                            }



                            if (incidentAgentId == 0)
                            {
                                if (incidentStatusId == 1)
                                {
                                    BllProxyIncidentHelper.SetIncidentReservation(incidentId, 0);
                                    BllProxyPool.SetPoolAgentAvailable(row.agent_id, false);
                                    BllProxyPool.SetPoolAgentBusy(row.agent_id, false);
                                }
                                else
                                {
                                    BllProxyPool.SetPoolAgentAvailable(row.agent_id, true);
                                    BllProxyPool.SetPoolAgentBusy(row.agent_id, true);
                                }
                            }

                            result = true;
                        }
                    }
                }
            }

            return(result);
        }
예제 #2
0
        protected void btnDisconnect_Click(object sender, EventArgs e)
        {
            Button btn             = (Button)sender;
            string commandName     = btn.CommandName;
            string commandArgument = btn.CommandArgument;


            pnlDisconnect.Visible        = false;
            pnlDisconnectConfirm.Visible = false;

            if (commandName == "DISCONNECT")
            {
                pnlDisconnectConfirm.Visible = true;
            }
            else if (commandName == "CONFIRM")
            {
                BllProxyIncidentHelper.SetIncidentStatus(this.incidentId, 3);   // 3:Canceled
                BllProxyIncidentState.DeleteIncidentState(this.incidentId);

                UcControlArgs args = new UcControlArgs();
                goNext(args);
            }
            else if (commandName == "CANCEL")
            {
                pnlDisconnect.Visible = true;
            }
            else
            {
                pnlDisconnect.Visible = true;
            }


            //UpdatePanel1.Update();
        }
예제 #3
0
        /// <summary>
        /// Cancel the Obsolete incidents (sitting too long in Queue)
        /// </summary>
        /// <returns></returns>
        protected bool cancelObsoleteIncidents()
        {
            bool result = false;

            //int cleanUpInterval = 300; // SosParameters.SosCallCleanUpInterval;


            //IncidentDS.IncidentDSDataTable dt = BllProxyIncident.GetIncidentQueueList(1, 0);   //1:New; 0:All
            IncidentDS.IncidentDSDataTable dt = BllProxyIncident.GetIncidentsByStatus(1, 0);   //1:New; 0:All

            foreach (IncidentDS.IncidentDSRow rowIncident in dt)
            {
                if (rowIncident.Isdate_openNull())  // Not for transferred incidents
                {
                    DateTime now  = DateTime.Now.ToUniversalTime();
                    TimeSpan span = now.Subtract(rowIncident.date_created);
                    TimeSpan max  = new TimeSpan(0, 0, 15, 0);                       // 15 minutes

                    if (TimeSpan.Compare(span, max) > 0)
                    {
                        Int32 incidentId = rowIncident.incident_id;
                        BllProxyIncidentHelper.SetIncidentSubject(incidentId, 3, "[_CLEARED_]");    // Canceled

                        result = true;
                        break;
                    }
                }
                //---
            }


            return(result);
        }
예제 #4
0
        protected void checkReservations()
        {
            Hashtable tableToClear = new Hashtable();


            foreach (AgentAccount agent in table.Values)
            {
                if (agent.HasIncident)
                {
                    TimeSpan max = new TimeSpan(0, 0, 15);

                    if (TimeSpan.Compare(agent.Reserved, max) > 0)
                    {
                        Int32 incidentId       = agent.IncidentId;
                        Int32 incidentStatusId = BllProxyIncidentHelper.GetIncidentStatus(incidentId);

                        if (incidentStatusId == 1)
                        {
                            BllProxyIncidentHelper.SetIncidentReservation(incidentId, 0);
                            agent.IsBusy = false;

                            tableToClear.Add(agent.AgentId, null);
                        }
                    }
                }
            }



            foreach (Int32 agentId in tableToClear.Keys)
            {
                //this.UnRegisterAgent(agentId);
                this.SetAgentAvailable(agentId, false);
            }
        }
예제 #5
0
        protected void btnTransfer_Click(object sender, EventArgs e)
        {
            if (this.selectedAgentId != 0)
            {
                if (this.agentId != this.selectedAgentId)
                {
                    if (statusId == 5)   // Follow-Up
                    {
                        BllProxyIncidentHelper.TransferIncident(this.UcAppPage.UserId, this.incidentId, 5, this.agentId, this.selectedAgentId);
                    }
                    else
                    {
                        BllProxyIncidentHelper.TransferIncident(this.UcAppPage.UserId, this.incidentId, 1, this.agentId, this.selectedAgentId);
                    }



                    UcControlArgs args = new UcControlArgs();
                    args.Id      = this.agentId;
                    args.Message = "The profile has been transferred.";
                    this.goNext(args);
                }
                else
                {
                    this.showErrorMessage("The target agent cannot be the same as the current agent!");
                }
            }
            else
            {
                this.showErrorMessage("The target agent is not selected!");
            }
        }
예제 #6
0
        protected void btnYes_Click(object sender, EventArgs e)
        {
            ltTimeSpan.Text = this.getTimeLeftText(0);

            startTime             = DateTime.Now;
            pnlWait.Visible       = true;
            pnlAgentsBusy.Visible = false;
            mode = 0;

            BllProxyIncidentHelper.SetIncidentConnectCount(incidentId);

            upWork.Update();
        }
        protected void btnDisconnect_Click(object sender, EventArgs e)
        {
            Button btn             = (Button)sender;
            string commandName     = btn.CommandName;
            string commandArgument = btn.CommandArgument;

            if (commandName == "DISCONNECT")
            {
                BllProxyIncidentHelper.SetIncidentStatus(this.incidentId, 3);   // 3:Canceled
                BllProxyIncidentState.DeleteIncidentState(this.incidentId);

                FinishConference();
            }
        }
예제 #8
0
        protected void handleIncidentQueue()
        {
            IncidentDS.IncidentDSDataTable dt;

            DataTable dt0 = convertToDataset(table);

            DataRow[] rows = dt0.Select("", "rating");

            foreach (DataRow agentRow in rows)
            {
                int rating = Convert.ToInt32(agentRow["rating"]);

                Int32        agentId      = Convert.ToInt32(agentRow["agent_id"]);
                AgentAccount agentAccount = this.GetAgent(agentId);


                if ((agentAccount.IsAvailable) && (!agentAccount.IsBusy))
                {
                    dt = BllProxyIncident.GetIncidentQueueList(1, agentAccount.AgentId);   //1:New

                    foreach (IncidentDS.IncidentDSRow rowIncident in dt)
                    {
                        if (rowIncident.Isreserved_agent_idNull())
                        {
                            Int32 incidentId = rowIncident.incident_id;
                            BllProxyIncidentHelper.SetIncidentReservation(incidentId, agentAccount.AgentId);

                            agentAccount.Reserve();
                            agentAccount.IsBusy     = true;
                            agentAccount.IncidentId = incidentId;

                            break;
                        }

                        //---
                    }
                }
            }
        }
예제 #9
0
        /// <summary>
        /// Assign the Incident to the available Agent
        /// </summary>
        /// <param name="dtAllPoolAgents"></param>
        /// <returns></returns>
        protected bool handleIncidentQueue(PoolDS.PoolDSDataTable dtAllPoolAgents)
        {
            bool result = false;

            IncidentDS.IncidentDSDataTable dt;

            PoolDS.PoolDSRow[] rows = (PoolDS.PoolDSRow[])dtAllPoolAgents.Select("", "last_call_time");

            foreach (PoolDS.PoolDSRow row in rows)
            {
                Int32 agentId = row.agent_id;

                if ((row.is_available) && (!row.is_busy))
                {
                    dt = BllProxyIncident.GetIncidentQueueList(1, agentId);   //1:New

                    foreach (IncidentDS.IncidentDSRow rowIncident in dt)
                    {
                        if (rowIncident.Isreserved_agent_idNull())
                        {
                            Int32 incidentId = rowIncident.incident_id;
                            BllProxyIncidentHelper.SetIncidentReservation(incidentId, agentId);

                            BllProxyPool.SetPoolAgentBusy(agentId, true);
                            BllProxyPool.SetPoolAgentIncident(agentId, incidentId);

                            result = true;
                            break;
                        }

                        //---
                    }
                }
            }


            return(result);
        }
예제 #10
0
        protected void timerRefresh_Tick(object sender, EventArgs e)
        {
            DateTime t    = DateTime.Now;
            DateTime last = new DateTime(t.Subtract(startTime).Ticks);
            TimeSpan span = t.Subtract(startTime);

//            //ltTimeSpan.Text = string.Format("{0:00}:{1:00}:{2:00}", (int)span.TotalHours, span.Minutes, span.Seconds);

            ltTimeSpan.Text = this.getTimeLeftText(span.Seconds);

            //======================================================================
            bool  isSessionFinished = false;
            Int32 currentStatusId   = BllProxyIncidentHelper.GetIncidentStatus(incidentId);

            if (currentStatusId != statusId)
            {
                UcControlArgs args = new UcControlArgs();
                switch (currentStatusId)
                {
                case 1:     //New
                    break;

                case 2:     //In-Progress
                    goNext(args);
                    break;

                case 3:     //Canceled
                    isSessionFinished = true;
                    goBack(args);
                    break;

                case 4:     //Closed
                    isSessionFinished = true;
                    goBack(args);
                    break;
                }

                statusId = currentStatusId;
            }
            //======================================================================

            TimeSpan max0 = new TimeSpan(0, 0, timeOut);
            TimeSpan max1 = new TimeSpan(0, 1, 0);

            if (TimeSpan.Compare(span, max0) > 0)
            {
                if (mode == 0)
                {
                    pnlWait.Visible       = false;
                    pnlAgentsBusy.Visible = true;

                    upWork.Update();
                    mode = 1;
                }
            }

            if (TimeSpan.Compare(span, max1) > 0)
            {
                BllProxyIncidentHelper.SetIncidentStatus(incidentId, 3);

                isSessionFinished = true;
            }

            if (isSessionFinished)
            {
                BllProxyIncident.UpdateIncident(incidentId, 0, 0, 3, "[_EXPIRED_]");
                UcControlArgs args = new UcControlArgs();
                goBack(args);
            }
        }
예제 #11
0
        protected void btnDisconnect_Click(object sender, EventArgs e)
        {
            BllProxyIncidentHelper.SetIncidentStatus(this.incidentId, 3);   // 3:Canceled

            Response.Redirect("default.aspx");
        }