Beispiel #1
0
        public static ActiveAgent Create(string uName, string Camapign_Id, string Group_Name, string Phone_No, string Status, string color, string CallDuration)
        {
            ActiveAgent ai = new ActiveAgent();

            ai.uName            = uName;
            ai.Campaign_Id      = Camapign_Id;
            ai.Group_Name       = Group_Name;
            ai.Phone_No         = Phone_No;
            ai.Status           = Status;
            ai.Color            = color;
            ai.CallDuration     = CallDuration;
            ai.BtnBargeContent  = "Barge";
            ai.BtnHangUpContent = "HangUp";
            ai.Tag = uName + "," + Phone_No;

            if (string.Compare(Status.ToLower(), "connected") == 0)
            {
                ai.Enable = true;
            }
            else if (string.Compare(Status.ToLower(), "hold") == 0)
            {
                ai.Enable = true;
            }
            else
            {
                ai.Enable = false;
            }
            return(ai);
        }
        public static ActiveAgent Create(string uName, string Camapign_Id, string Group_Name, string Phone_No, string Status, string color, string CallDuration)
        {
            ActiveAgent ai = new ActiveAgent();
            
            ai.uName = uName;
            ai.Campaign_Id = Camapign_Id;            
            ai.Group_Name = Group_Name;
            ai.Phone_No=Phone_No;
            ai.Status = Status;
            ai.Color = color;
            ai.CallDuration = CallDuration;
            ai.BtnBargeContent = "Barge";
            ai.BtnHangUpContent = "HangUp";
            ai.Tag = uName + "," + Phone_No;

            if (string.Compare(Status.ToLower(), "connected") == 0)
            {
                ai.Enable = true;
            }
            else if (string.Compare(Status.ToLower(), "hold") == 0)
            {
                ai.Enable = true;
            }
            else
            {
                ai.Enable = false;
            }
            return ai;
        }
Beispiel #3
0
        public void objdelRefreshReport(DataSet ds)
        {
            try
            {
                List <ActiveAgent> objActiveAgent1 = new List <ActiveAgent>(); //first list
                List <ActiveAgent> objActiveAgent2 = new List <ActiveAgent>(); //second list


                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    //DataSet dsCampName = new DataSet();
                    //System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(ConnectionString);
                    //System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand("Select Name from Campaign where ID='" + ds.Tables[0].Rows[i]["Campaign_Id"].ToString() + "'", conn);
                    //System.Data.SqlClient.SqlDataAdapter daCampName = new System.Data.SqlClient.SqlDataAdapter(cmd);
                    //daCampName.Fill(dsCampName);
                    string status = ds.Tables[0].Rows[i]["Status"].ToString();
                    string Color  = string.Empty;
                    switch (status)
                    {
                    case "ready":
                        Color = "White";
                        break;

                    case "InProgress":
                        Color = "Blue";
                        break;

                    case "Connected":
                        Color = "Green";
                        break;

                    case "Disconnected":
                        Color = "Red";
                        break;

                    case "Incoming":
                        Color = "Yellow";
                        break;

                    case "Hold":
                        Color = "Brown";
                        break;

                    case "Stopped":
                        Color = "Orange";
                        break;
                    }


                    if (objActiveAgent1.Count < 26)
                    {
                        objActiveAgent1.Add(ActiveAgent.Create(ds.Tables[0].Rows[i]["uName"].ToString(), ds.Tables[0].Rows[i]["Campaign_Id"].ToString(), ds.Tables[0].Rows[i]["Group_Name"].ToString(), ds.Tables[0].Rows[i]["Phone_No"].ToString(), ds.Tables[0].Rows[i]["Status"].ToString(), Color, ds.Tables[0].Rows[i]["callDuration"].ToString()));
                    }
                    else
                    {
                        objActiveAgent2.Add(ActiveAgent.Create(ds.Tables[0].Rows[i]["uName"].ToString(), ds.Tables[0].Rows[i]["Campaign_Id"].ToString(), ds.Tables[0].Rows[i]["Group_Name"].ToString(), ds.Tables[0].Rows[i]["Phone_No"].ToString(), ds.Tables[0].Rows[i]["Status"].ToString(), Color, ds.Tables[0].Rows[i]["callDuration"].ToString()));
                    }
                }

                AgentItems.ItemsSource  = objActiveAgent1;
                AgentItems1.ItemsSource = objActiveAgent2;
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "objdelRefreshReport()", "ctlrptActiveAgent.xaml.cs");
            }
        }