Esempio n. 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);
            }
        }
Esempio n. 2
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);
        }
Esempio n. 3
0
        //-------------------------------------------------------------------------------
        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;
            }
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string pathRedirect = "CallQueue.aspx";

            if (agentId == 0)
            {
                pathRedirect = "profile.aspx";
            }
            else
            {
                IncidentDS.IncidentDSDataTable dt = BllProxyIncident.GetIncidentsByStatus(1, agentId);  // New
                if (dt.Rows.Count != 0)
                {
                    pathRedirect = "CallQueue.aspx";
                }
                else
                {
                    dt = BllProxyIncident.GetIncidentsByStatus(2, agentId);  // In-Progress
                    if (dt.Rows.Count != 0)
                    {
                        pathRedirect = "myCalls.aspx";
                    }
                    else
                    {
                        dt = BllProxyIncident.GetIncidentsByStatus(5, agentId);  // Follow-Up
                        if (dt.Rows.Count != 0)
                        {
                            pathRedirect = "followupcalls.aspx";
                        }

                        pathRedirect = "CallQueue.aspx";
                    }
                }
            }


            Response.Redirect(pathRedirect);
        }
Esempio n. 5
0
        protected void showMenu()
        {
            UcAppBasePage page = this.UcAppPage;

            string siteMapProviderName = "DefaultSiteMapProvider";

            switch (page.UserRoleId)
            {
            case 1:             //ADMIN
                siteMapProviderName = "RoleAdminSiteMapProvider";
                break;

            case 2:             //AGENT
                siteMapProviderName = "RoleAgentSiteMapProvider";
                break;

            case 5:             //SUPERVISOR
                siteMapProviderName = "RoleSupervisorSiteMapProvider";
                break;
            }

            SiteMapDataSource smds = new SiteMapDataSource();

            smds.SiteMapProvider  = siteMapProviderName;
            smds.ShowStartingNode = false;

            ucSideMenu.DataSource = smds;
            ucSideMenu.DataBind();

            SiteMapNode currentSiteMapNode = SiteMap.Providers[siteMapProviderName].CurrentNode;

            for (int i = 0; i < ucSideMenu.Items.Count; i++)
            {
                MenuItem menu_item = ucSideMenu.Items[i];

                if (currentSiteMapNode == null)
                {
                    menu_item.ChildItems.Clear();
                    continue;
                }

                string menu_item_text = menu_item.Text;

                if (currentSiteMapNode.ToString().CompareTo(menu_item_text) == 0)
                {
                    menu_item.Selected = true;
                    continue;
                }

                if (currentSiteMapNode.ParentNode == null)
                {
                    menu_item.ChildItems.Clear();
                    continue;
                }

                if (currentSiteMapNode.ParentNode.ToString().CompareTo(menu_item_text) != 0)
                {
                    menu_item.ChildItems.Clear();
                    continue;
                }

                menu_item.Text = "<b>" + menu_item_text + "</b>";

                for (int j = 0; j < menu_item.ChildItems.Count; j++)
                {
                    MenuItem menu_item_child      = menu_item.ChildItems[j];
                    string   menu_item_child_text = menu_item_child.Text;
                    if (currentSiteMapNode.ToString().CompareTo(menu_item_child_text) == 0)
                    {
                        menu_item_child.Selected = true;
                    }

                    //---------------------------------------------------------------------------

                    if (page.UserRoleId == 2)                         //Agent
                    {
                        Int32 agentId = ProxyHelper.GetUserAgentId(this.UcPage.UserId);

                        //==================================================================
                        //IncidentDS.IncidentDSDataTable dt = BllProxyIncident.GetIncidentsByStatus(0, agentId);  // ALL
                        //DataRow[] rows = dt.Select("status_id=0");  //None
                        //if (menu_item_child_Text == "Call Queue")
                        //    rows = dt.Select("status_id=1");  // New
                        //else if (menu_item_child_Text == "My Calls")
                        //    rows = dt.Select("status_id=2");  // In-Progress
                        //else if (menu_item_child_Text == "Follow-Up")
                        //    rows = dt.Select("status_id=5");  // Follow-Up
                        //cnt = rows.Length;
                        //if (cnt != 0)
                        //    menu_item_child_Text = menu_item_child_Text + " [" + cnt.ToString() + "]";
                        //==================================================================

                        IncidentDS.IncidentDSDataTable dt = null;
                        if (menu_item_child_text == "Call Queue")
                        {
                            dt = BllProxyIncident.GetIncidentQueueList(1, agentId);                                // New
                        }
                        else if (menu_item_child_text == "My Calls")
                        {
                            dt = BllProxyIncident.GetIncidentsByStatus(2, agentId);                                // In-Progress
                        }
                        else if (menu_item_child_text == "Follow-Up")
                        {
                            dt = BllProxyIncident.GetIncidentFollowUpList(5, agentId);                                // Follow-Up
                        }
                        if (dt != null)
                        {
                            int cnt = dt.Rows.Count;
                            if (cnt != 0)
                            {
                                menu_item_child_text += " [" + cnt.ToString() + "]";
                            }
                        }
                    }
                    //---------------------------------------------------------------------------

                    menu_item_child.Text = "&nbsp;&nbsp;&nbsp;" + menu_item_child_text;
                }
            }

            //////---------------------------------------------------------
            //for( int i = 0; i < ucSideMenu.Items.Count; i++ )
            //{
            //    if( currentSiteMapNode != null )
            //    {
            //        string menuItemText = ucSideMenu.Items[ i ].Text;
            //        if( currentSiteMapNode.ToString().CompareTo( menuItemText ) != 0 )
            //        {
            //            if( currentSiteMapNode.ParentNode != null )
            //            {
            //                if( currentSiteMapNode.ParentNode.ToString().CompareTo( menuItemText ) != 0 )
            //                {
            //                    ucSideMenu.Items[ i ].ChildItems.Clear();
            //                }
            //                else
            //                {
            //                    ucSideMenu.Items[ i ].Text = "<b>" + menuItemText + "</b>";

            //                    for( int j = 0; j < ucSideMenu.Items[ i ].ChildItems.Count; j++ )
            //                    {
            //                        string childMenuItemText = ucSideMenu.Items[ i ].ChildItems[ j ].Text;
            //                        if( currentSiteMapNode.ToString().CompareTo( childMenuItemText ) == 0 )
            //                        {
            //                            ucSideMenu.Items[ i ].ChildItems[ j ].Selected = true;
            //                        }

            //                        //---------------------------------------------------------------------------

            //                        if( page.UserRoleId == 2 )    //Agent
            //                        {
            //                            Int32 agentId = ProxyHelper.GetUserAgentId( this.UcPage.UserId );
            //                            Int32 cnt = 0;

            //                            //==================================================================
            //                            //IncidentDS.IncidentDSDataTable dt = BllProxyIncident.GetIncidentsByStatus(0, agentId);  // ALL
            //                            //DataRow[] rows = dt.Select("status_id=0");  //None
            //                            //if (childMenuItemText == "Call Queue")
            //                            //    rows = dt.Select("status_id=1");  // New
            //                            //else if (childMenuItemText == "My Calls")
            //                            //    rows = dt.Select("status_id=2");  // In-Progress
            //                            //else if (childMenuItemText == "Follow-Up")
            //                            //    rows = dt.Select("status_id=5");  // Follow-Up
            //                            //cnt = rows.Length;
            //                            //if (cnt != 0)
            //                            //    childMenuItemText = childMenuItemText + " [" + cnt.ToString() + "]";
            //                            //==================================================================

            //                            IncidentDS.IncidentDSDataTable dt = null;
            //                            if( childMenuItemText == "Call Queue" )
            //                                dt = BllProxyIncident.GetIncidentQueueList( 1, agentId );  // New
            //                            else if( childMenuItemText == "My Calls" )
            //                                dt = BllProxyIncident.GetIncidentsByStatus( 2, agentId );  // In-Progress
            //                            else if( childMenuItemText == "Follow-Up" )
            //                                dt = BllProxyIncident.GetIncidentFollowUpList( 5, agentId );  // Follow-Up

            //                            if( dt != null )
            //                            {
            //                                cnt = dt.Rows.Count;
            //                                if( cnt != 0 )
            //                                    childMenuItemText = childMenuItemText + " [" + cnt.ToString() + "]";
            //                            }

            //                        }
            //                        //---------------------------------------------------------------------------

            //                        ucSideMenu.Items[ i ].ChildItems[ j ].Text = "&nbsp;&nbsp;&nbsp;" + childMenuItemText;
            //                    }
            //                }
            //            }
            //            else
            //            {
            //                ucSideMenu.Items[ i ].ChildItems.Clear();
            //            }
            //        }
            //        else
            //        {
            //            ucSideMenu.Items[ i ].Selected = true;
            //        }
            //    }
            //    else
            //    {
            //        ucSideMenu.Items[ i ].ChildItems.Clear();
            //    }
            //}
        }