public PrintForm(int id) { this.id = id; InitializeComponent(); Model.AmbulatorRecord record = PostgresConnector.GetRecord(id); Model.AmbulatorCard card = PostgresConnector.GetAmbulatorCard(record.ToCard); DateOfVisit.Text = record.DateVisit.ToString(); Assignment.Text = record.assignments; Clinic.Text = record.anamnesis; Diagnosis.Text = record.epicrisis; Breeder.Text = card.Breeder; TypeAnimal.Text = card.KindOfAnimal; Breed.Text = card.Breed; PetName.Text = card.PetName; DateTime birth = card.DateOfBirth; if (birth == new DateTime(1812, 1, 1)) { DateOfBirth.Text = "Неизвестно"; } else { DateOfBirth.Text = birth.ToLongDateString(); } IsMale.Text = (card.IsMale) ? "Мужская" : "Женская"; }
public RedactRecordForm(int id) { InitializeComponent(); this.id = id; value = PostgresConnector.GetRecord(id); Model.AmbulatorCard card = PostgresConnector.GetAmbulatorCard(value.ToCard); Breeder.Text = card.Breeder; Adress.Text = card.Address; Phone.Text = card.Phone; KindOfAnimal.Text = card.KindOfAnimal; Breed.Text = card.Breed; PetName.Text = card.PetName; DateTime birth = card.DateOfBirth; Birth.Text = birth.ToLongDateString(); TimeSpan AgeSpan = DateTime.Now - birth; Age.Text = String.Format("{0} лет {1} месяцев {2} дней", AgeSpan.Days / 365, (AgeSpan.Days % 365) / 30, (AgeSpan.Days % 365) % 30); IsMale.Text = (card.IsMale) ? "Мужская" : "Женская"; DateOfVisit.Value = value.DateVisit; PayBox.Text = value.Payment.ToString(); Anamnesis.Text = value.anamnesis; Clinic.Text = value.assignments; Epicrisis.Text = value.epicrisis; Debt.Value = value.Debt; }
private void EnterRecord_Click(object sender, EventArgs e) { value.Payment = Int32.Parse(PayBox.Text); value.DateVisit = DateOfVisit.Value; value.anamnesis = Anamnesis.Text; value.assignments = Clinic.Text; value.epicrisis = Epicrisis.Text; value.Debt = (int)Debt.Value; PostgresConnector.UpdateRecord(value, id); DialogResult = DialogResult.OK; Close(); }
private void Add_Click(object sender, EventArgs e) { value.Breeder = BreedName.Text; value.Address = String.Format(Address.Text); value.Phone = Telephone.Text; value.Breed = BreedName.Text; value.KindOfAnimal = TypeAnimal.Text; if (DontHaveBD.Checked) { value.DateOfBirth = Model.AmbulatorCard.getBirthFromString(years.Value, months.Value, days.Value); } else { value.DateOfBirth = dateTimePicker2.Value; } value.PetName = NamePet.Text; PostgresConnector.UpdateCard(value, id); this.DialogResult = DialogResult.OK; }
public RedactCardForm(int id) { InitializeComponent(); this.id = id; value = PostgresConnector.GetAmbulatorCard(id); this.Address.Text = value.Address; this.BreedName.Text = value.Breeder; this.Telephone.Text = value.Phone; this.TypeAnimal.Text = value.KindOfAnimal; this.dateTimePicker2.Value = value.DateOfBirth; this.Breed.Text = value.Breed; this.NamePet.Text = value.PetName; if (value.IsMale) { IsMale.Checked = true; } else { IsFemale.Checked = true; } }
public ApiController(MysqlConnector mysql, PostgresConnector postgres) { _mysql = mysql; _postgres = postgres; }