Ejemplo n.º 1
0
        private void AddAgentToLocalDatabase(Agent responseFromServer)
        {
            FormSample.AgentDatabase d = new AgentDatabase();
            var existingAgent          = d.GetAgentByEmail(responseFromServer.Email);

            if (existingAgent == null)
            {
                d.SaveItem(responseFromServer);
            }
        }
Ejemplo n.º 2
0
 public ProductLocations()
 {
     try {
         AgentDatabase pdb = new AgentDatabase();
         foreach (ProductInstall install in pdb.Data.ProductInstalls)
         {
             if (KnownUIDs.ContainsKey(install.Uid) && Directory.Exists(install.Settings.InstallPath))
             {
                 Add(new ProductLocation(KnownUIDs[install.Uid], Path.GetFullPath(install.Settings.InstallPath)));
             }
         }
     } catch { }
 }
Ejemplo n.º 3
0
        private void BindAgent()
        {
            AgentDatabase d             = new AgentDatabase();
            var           agentToUpdate = d.GetAgentByEmail(Settings.GeneralSettings);

            if (agentToUpdate != null)
            {
                id              = agentToUpdate.Id;
                firstName.Text  = agentToUpdate.FirstName;
                lastName.Text   = agentToUpdate.LastName;
                email.Text      = agentToUpdate.Email;
                agencyName.Text = agentToUpdate.AgencyName;
                phone.Text      = agentToUpdate.Phone;
            }
        }
 /// <summary>
 /// The execute submit command.
 /// </summary>
 /// <returns> The <see cref="Task"/>. </returns>
 private void CreateDatabase(Agent responseFromServer)
 {
     FormSample.AgentDatabase d = new AgentDatabase();
     //var t = d.GetAgents();
     d.SaveItem(responseFromServer);;
 }
Ejemplo n.º 5
0
 public CustomerViewModel()
 {
     db           = new AgentDatabase();
     customerList = new ObservableCollection <Agent>();
     BindCustomer();
 }
Ejemplo n.º 6
0
        private void UpdateAgent(Agent agentToUpdate)
        {
            AgentDatabase agent = new AgentDatabase();

            agent.SaveItem(agentToUpdate);
        }