AgentUserId is member of what department

Last post 02-20-2011, 6:07 PM by Eric. 1 replies.
Sort Posts: Previous Next
  •  02-18-2011, 2:01 PM 66294

    AgentUserId is member of what department

    in the livesupport operator code is there a way to associate all the departments the operator is a member of like AgentUserId is member of what departmentID's
  •  02-20-2011, 6:07 PM 66315 in reply to 66294

    Re: AgentUserId is member of what department

    Dear DavidMag,
     
    The following snippet demonstrates how to load departments and opertors from database, you can find this snippet in file "ManageDepartments.aspx" which can be found in download package.
     
    private void DataGrid3_DataBinding(object sender, EventArgs e)
     {
      string deptname=(string)ManageLiveSupport.DataGrid2.DataKeys[Item.ItemIndex];

      CuteChat.SupportDepartment[] departments=CuteChat.ChatWebUtility.LoadDepartments();
      
      foreach(CuteChat.SupportDepartment department in departments)
      {
       if(department.Name==deptname)
       {
        DataTable table=new DataTable();

        table.Columns.Add("LoginName",typeof(string));
        table.Columns.Add("DisplayName",typeof(string));

        foreach(CuteChat.SupportAgent agent in department.Agents)
        {
         string loginName=CuteChat.ChatProvider.Instance.FromUserId(agent.UserId);
         string dispName=null;
         CuteChat.ChatProvider.Instance.GetUserInfo(loginName,ref dispName);
         table.Rows.Add(new object[]{loginName,dispName});
        }
        table.AcceptChanges();
        DataGrid3.DataSource=table.DefaultView;
       }
      }
     }
     
    Thank you for asking
View as RSS news feed in XML