public void CountIncrease(Int32 agentId) { if (table.Contains(agentId)) { AgentAccount agentAccount = (AgentAccount)table[agentId]; agentAccount.LoadBalanceRating++; } }
//------------------------------------------------------------------------------- public void RegisterAgent(Int32 agentId) { if (!table.Contains(agentId)) { Int32 averageLoadBalanceRating = this.getAverageLoadBalanceRate(); AgentAccount agentAccount = new AgentAccount(agentId, averageLoadBalanceRating); table.Add(agentId, agentAccount); } }
public Int32 GetAgentIncident(Int32 agentId) { Int32 incidentId = 0; if (table.Contains(agentId)) { AgentAccount agentAccount = (AgentAccount)table[agentId]; incidentId = agentAccount.IncidentId; } return(incidentId); }
public AgentAccount GetAgent(Int32 agentId) { AgentAccount agentAccount = null; if (table.Contains(agentId)) { agentAccount = (AgentAccount)table[agentId]; } return(agentAccount); }
//------------------------------------------------------------------------------- public void SetAgentAvailable(Int32 agentId, bool available) { if (table.Contains(agentId)) { AgentAccount agentAccount = (AgentAccount)table[agentId]; if (available) { Int32 averageLoadBalanceRating = this.getAverageLoadBalanceRate(); agentAccount.LoadBalanceRating = averageLoadBalanceRating; } agentAccount.IsAvailable = available; } }
//------------------------------------------------------------------------------- public void SetAgentBusy(Int32 agentId, bool busy) { if (table.Contains(agentId)) { AgentAccount agentAccount = (AgentAccount)table[agentId]; //if (agentAccount.IsAvailable) //{ bool isOccupied = false; if (!busy) { IncidentDS.IncidentDSDataTable dt = BllProxyIncident.GetIncidentsByStatus(2, agentId); //2:In-Progress if (dt.Rows.Count != 0) { isOccupied = true; } } // if (isOccupied) // { // agentAccount.IsBusy = false; // } // else // { // agentAccount.IsBusy = true; // } // agentAccount.IncidentId = 0; //} if (isOccupied) { agentAccount.IsBusy = true; } else { agentAccount.IsBusy = busy; } agentAccount.IncidentId = 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; } //--- } } } }