Ejemplo n.º 1
0
        public static Models.Production.Patient New()
        {
#pragma warning disable IDE0042 // Deconstruct variable declaration
            var name = NameGenerator.Random();
            var city = CityGenerator.Random();
#pragma warning restore IDE0042 // Deconstruct variable declaration
            var patient = new Models.Production.Patient
            {
                ContactPerson = new Models.Production.ContactPerson
                {
                    Name            = $"{name.FirstName} {name.LastName}",
                    Email           = $"{name.FirstName}.{name.LastName}@generatedpatient.com",
                    TelephoneNumber = $"{city.AreCode}/{s_random.Next(10, 9999999)}"
                },
                DateOfBirth           = BirthdayGenerator.RandomBirthday().ToString("s"),
                BedNumber             = $"Bed {s_random.Next(1, 3)}",
                RoomNumber            = $"Room {s_random.Next(1000, 999)}",
                WardName              = WardGenerator.Random(),
                Gender                = Models.Production.Gender.Undefined,
                ExternalPatientNumber = $"{name.FirstName.Substring(0, 1)}{name.LastName.Substring(0, 1)}_{s_random.Next(10000, 99999)}",
                ContactAddress        = new Models.Production.ContactAddress
                {
                    NameLine1    = $"{name.FirstName} {name.LastName}",
                    Addressline1 = "Generated Patient Street 1",
                    State        = city.State,
                    City         = city.Name,
                    Postalcode   = city.Cip,
                    Country      = city.Country
                }
            };
            return(patient);
        }
Ejemplo n.º 2
0
        //занесение данных из объекта данных в контролы
        public void Build(Client data)
        {
            Data = data;

            updating++; //включаем режим обновления

            if (string.IsNullOrWhiteSpace(data.Surname))
            {
                var namesGenerator = new NamesGenerator();
                var name           = namesGenerator.GetFullName();
                tbSurname.Text  = name.Item1;
                tbName.Text     = name.Item2;
                tbLastName.Text = name.Item3;
                var phoneGenerator = new PhoneNumberGenerator();
                tbPhoneNumber.Text = phoneGenerator.GetNumber();
                var dateGenerator = new BirthdayGenerator();
                dtpBirthday.Value = dateGenerator.GetDate();
                tbCity.Text       = "Москва";
                var pasportGenerator = new PassportNumberGenerator();
                tbPassport.Text      = pasportGenerator.GetNumber();
                nudNumberChild.Value = 0;
            }
            else
            {
                tbSurname.Text       = data.Surname;
                tbName.Text          = data.Name;
                tbLastName.Text      = data.LastName;
                tbPhoneNumber.Text   = data.PhoneNumber;
                dtpBirthday.Value    = data.Birthday;
                tbCity.Text          = data.City;
                tbPassport.Text      = data.Passport;
                nudNumberChild.Value = data.NumberChild;
            }

            updating--; //выключаем режим обновления
        }