Exemple #1
0
        //-------------------------------------------------------------------------------
        public void SetAgentBusy(Int32 agentId, bool busy)
        {
            PoolDS.PoolDSDataTable dtPool = BllProxyPool.SelectPoolAgent(agentId);
            if (dtPool.Rows.Count != 0)
            {
                bool isBusy = busy;

                if (!isBusy)
                {
                    IncidentDS.IncidentDSDataTable dtIncident = BllProxyIncident.GetIncidentsByStatus(2, agentId);   //2:In-Progress
                    if (dtIncident.Rows.Count != 0)
                    {
                        isBusy = true;
                    }
                }


                if (isBusy)
                {
                    BllProxyPool.SetPoolAgentBusy(agentId, true);
                }
                else
                {
                    BllProxyPool.SetPoolAgentBusy(agentId, busy);
                }

                BllProxyPool.SetPoolAgentIncident(agentId, 0);
            }
        }
Exemple #2
0
 //-------------------------------------------------------------------------------
 public void RegisterAgent(Int32 agentId)
 {
     if (agentId != 0)
     {
         PoolDS.PoolDSDataTable dt = BllProxyPool.SelectPoolAgent(agentId);
         if (dt.Rows.Count == 0)
         {
             BllProxyPool.InsertPoolAgent(agentId);
         }
     }
 }
Exemple #3
0
        //-------------------------------------------------------------------------------
        public Int32 GetAgentIncident(Int32 agentId)
        {
            Int32 incidentId = 0;

            PoolDS.PoolDSDataTable dt = BllProxyPool.SelectPoolAgent(agentId);
            if (dt.Rows.Count != 0)
            {
                if (!dt[0].Isincident_idNull())
                {
                    incidentId = dt[0].incident_id;
                }
            }

            return(incidentId);
        }
Exemple #4
0
        protected enumAgentStatus updateAgentStatus()
        {
            enumAgentStatus agentStatus = enumAgentStatus.NotDefined;



            if (this.active)
            {
                pnlNotRegistered.Visible = false;
                pnlIncomingCall.Visible  = false;
                pnlUnavailable.Visible   = false;
                pnlBusy.Visible          = false;
                pnlConnected.Visible     = false;
                pnlAvailable.Visible     = false;


                btnRegister.Visible     = false;
                btnTakeCall.Visible     = false;
                btnSetAvailable.Visible = false;
                btnReset.Visible        = false;
                btnUnRegister.Visible   = false;



                if (agentId == 0)
                {
                    // Not Defined
                    agentStatus = enumAgentStatus.NotDefined;

                    pnlNotRegistered.Visible = true;
                    ltMessage.Text           = "Not registered";
                    btnRegister.Visible      = true;
                }
                else
                {
                    PoolDS.PoolDSDataTable dt = BllProxyPool.SelectPoolAgent(agentId);
                    if (dt.Rows.Count != 0)
                    {
                        if (dt[0].is_available)
                        {
                            if (dt[0].is_busy)
                            {
                                if (!dt[0].Isincident_idNull())
                                {
                                    // Incoming Call
                                    agentStatus = enumAgentStatus.IncomingCall;

                                    Int32 incidentId = dt[0].incident_id;
                                    IncidentDS.IncidentDSDataTable dtIncident = BllProxyIncident.SelectIncident(incidentId);

                                    string callName = "";
                                    if (!dtIncident[0].Isfacility_nameNull())
                                    {
                                        callName = dtIncident[0].facility_name;
                                    }
                                    else
                                    {
                                        if (!dtIncident[0].Iscontact_full_nameNull())
                                        {
                                            callName = dtIncident[0].contact_full_name;
                                        }
                                        else
                                        {
                                            callName = "UNKNOWN";
                                        }
                                    }


                                    //    Incident Assigned
                                    pnlIncomingCall.Visible = true;
                                    ltMessage.Text          = "You’ve got a call : " + callName;

                                    btnTakeCall.Visible = true;
                                }
                                else
                                {
                                    //  Busy
                                    agentStatus = enumAgentStatus.Busy;


                                    if (this.checkOnline())
                                    {
                                        pnlConnected.Visible = true;
                                        pnlBusy.Visible      = false;
                                        ltMessage.Text       = "Online";
                                    }
                                    else
                                    {
                                        pnlBusy.Visible      = true;
                                        pnlConnected.Visible = false;
                                        ltMessage.Text       = "Offline";
                                        btnReset.Visible     = true;
                                    }
                                }
                            }
                            else
                            {
                                //  Available
                                agentStatus = enumAgentStatus.Available;

                                pnlAvailable.Visible  = true;
                                ltMessage.Text        = "Available";
                                btnUnRegister.Visible = true;
                            }
                        }
                        else
                        {
                            //  Off
                            agentStatus = enumAgentStatus.Unavailable;

                            if (this.checkOnline())
                            {
                                pnlConnected.Visible = true;
                                ltMessage.Text       = "Online";
                            }
                            else
                            {
                                pnlUnavailable.Visible  = true;
                                ltMessage.Text          = "Unavailable";
                                btnSetAvailable.Visible = true;
                            }
                        }
                    }
                    else
                    {
                        //  Not Defined
                        agentStatus = enumAgentStatus.NotDefined;

                        pnlNotRegistered.Visible = true;
                        ltMessage.Text           = "Not registered";
                        btnRegister.Visible      = true;
                    }
                }
            }



            return(agentStatus);
        }