Beispiel #1
0
 /// <summary>
 /// Create a new instance of the form given a client.
 /// </summary>
 /// <param name="c"></param>
 public Form1(Client c)
 {
     client = c;
     InitializeComponent();
     DM.Text = "Click on a Spreadsheet to open it or Click \"New\" to create a new one";
     this.ControlBox = false;
 }
 public ClientEditViewModel(Client client)
 {
     Id = client.Id;
     FirstName = client.FirstName;
     LastName = client.LastName;
     Country = client.Country;
 }
 public void AddClient(Client client)
 {
     using (var session = _clientsDocumentStore.OpenSession())
     {
         session.Store(client);
         session.SaveChanges();
     }
 }
 public void AddClient(string name, string lastName, string country)
 {
     string region;
     if (!_countriesRegions.TryGetValue(country, out region))
     {
         region = "Rest";
     }
     var newClient = new Client(name, lastName, country, region);
     _ravenDbConnection.AddClient(newClient);
 }
Beispiel #5
0
 /// <summary>
 /// Uses the spreadsheet'ss client.
 /// </summary>
 /// <param name="c"></param>
 public void setClient(Client c)
 {
     this.client = c;
 }
 public void AddClient(string name, string lastName, string country)
 {
     var region = getRegion(country);
     var newClient = new Client(name, lastName, country, region);
     _ravenDbConnection.AddClient(newClient);
 }
Beispiel #7
0
        public static List<Client> RandomClients(int nrClients)
        {
            var result = new List<Client>();
            DateTime time = _start.AddDays(gen.Next(range));
            List<string> name;
            List<string> lastName;
            for (int i = 0; i < nrClients; ++i)
            {
                var country = _countries.Keys.ToArray()[gen.Next(_countries.Keys.Count)];

                string region;
                if (!_names.TryGetValue(country, out name))
                    name = new List<string> { "unknown" };
                if (!_lastNames.TryGetValue(country, out lastName))
                    lastName = new List<string> { "unknown" };
                if (!_countries.TryGetValue(country, out region))
                    region = "unknown";
                var client = new Client(name[gen.Next(name.Count)], lastName[gen.Next(lastName.Count)], country, region);
                client.ModificationDateTime = _start.AddDays(gen.Next(range));
                result.Add(client);
            }
            return result;
        }