Example #1
0
        ///<returns>A bool indicating if the login credentials were correct or not.</returns>
        /// <param name="dataContext">Provides access to LINQ to SQL.</param>
        private bool AgentLogin(GrangeCallCenterDataClassesDataContext dataContext)
        {
            try
              {
            var gccAgent = (from agent in dataContext.Agents
                        where agent.userName == userNameTextBox.Text
                        select new GCCAgentWithCredentials
                        {
                          Password = agent.password,
                          UserName = agent.userName,
                          HireDate = agent.hireDate,
                          AgentName = agent.agentName
                        }).FirstOrDefault();

            if (gccAgent.Password != passwordTextBox.Text)
            {
              return false;
            }
            else
            {
              callCenterAgent = gccAgent;
              return true;
            }
              }
              catch (NullReferenceException)
              {
            return false;
              }
        }
 // use this initializer when all agents are needed and we haven't pulled any agents
 // from the dataConext yet (ie for comparisons)
 public AgentDataFetcher()
 {
     dataContext = new GrangeCallCenterDataClassesDataContext();
     dataContext.ObjectTrackingEnabled = false;
       allAgents = dataContext.Agents.ToList();
       gccAgents = new List<GCCAgent>();
       foreach (var callCenterAgent in allAgents)
       {
     // Create GCCAgent objects from the agent data pulled from the database.
     // Leave adding values to GCCAHT, GCCAdherence, GCCQualityControl, GCCKnowledgeCheck
     // to the fetch methods.
     var gccAgent = new GCCAgent(callCenterAgent.agentName, callCenterAgent.hireDate);
     // put the GCCAgents in the gccAgents array
     gccAgents.Add(gccAgent);
       }
 }
        private void ManagerMainMenu_Load(object sender, EventArgs e)
        {
            SetNameLabel();
              SetDateLabel();
              listBoxToolTip.SetToolTip(agentListBox, "Press and hold down the Ctrl key to select multiple agents");

              dataContext = new GrangeCallCenterDataClassesDataContext();
              dataContext.ObjectTrackingEnabled = false;

              // get all of the agents from the database and put them in an array
              List<Agent> agents = dataContext.Agents.ToList();
              var gccAgents = new List<GCCAgent>();
              foreach (var callCenterAgent in agents)
              {
            // create GCCAgent objects from the agent data pulled from the database
            // only populate the properties that are needed
            var gccAgent = new GCCAgent(callCenterAgent.agentName, callCenterAgent.hireDate);
            // put the GCCAgents in the gccAgents array
            gccAgents.Add(gccAgent);
              }

              PopulateAgentNameComboBox(gccAgents);
        }
 public GCCAgentRanker(List<GCCAgent> agentsForComparison, GCCAgent selectedAgent)
 {
     this.agentsForComparison = agentsForComparison;
       this.selectedAgent = selectedAgent;
 }
        private void DeleteUsersForm_Load(object sender, EventArgs e)
        {
            dataContext = new GrangeCallCenterDataClassesDataContext();
              dataContext.ObjectTrackingEnabled = true;

              // get all of the agents from the database and put them in an array
              List<Agent> agents = dataContext.Agents.ToList();
              var gccAgents = new List<GCCAgent>();
              foreach (var callCenterAgent in agents)
              {
            // create GCCAgent objects from the agent data pulled from the database
            // only populate the properties that are needed
            var gccAgent = new GCCAgent(callCenterAgent.agentName, callCenterAgent.hireDate);
            // put the GCCAgents in the gccAgents array
            gccAgents.Add(gccAgent);
              }

              PopulateAgentNameComboBox(gccAgents);
        }
Example #6
0
 public GCCAgentScore(GCCAgent agentForEvaluation)
 {
     agent = agentForEvaluation;
 }