コード例 #1
0
        private void AddAgentToLocalDatabase(Agent responseFromServer)
        {
            FormSample.AgentDatabase d = new AgentDatabase();
            var existingAgent          = d.GetAgentByEmail(responseFromServer.Email);

            if (existingAgent == null)
            {
                d.SaveItem(responseFromServer);
            }
        }
コード例 #2
0
ファイル: ProductLocations.cs プロジェクト: iTitus/OWLib
 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 { }
 }
コード例 #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;
            }
        }
コード例 #4
0
 /// <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);;
 }
コード例 #5
0
 public CustomerViewModel()
 {
     db           = new AgentDatabase();
     customerList = new ObservableCollection <Agent>();
     BindCustomer();
 }
コード例 #6
0
        private void UpdateAgent(Agent agentToUpdate)
        {
            AgentDatabase agent = new AgentDatabase();

            agent.SaveItem(agentToUpdate);
        }