private void AddNewMedic() { var newMedic = new Medic(); var medicCollection = ServerConnection.GetCollection<Medic>(); FillMedicObjectWithInfo(newMedic); medicCollection.Save<Medic>(newMedic); //TODO: get rid of this disaster var medicArgs = new MedicIdentityEventArgs(newMedic.Id.ToString(), newMedic.Surname, newMedic.Name, newMedic.Patronymic, newMedic.Profession, newMedic.Category, newMedic.Degree, newMedic.Department); MedicAddEvent(this, medicArgs); }
private void AddNewMedic() { var newMedic = new Medic(); var medicCollection = ServerConnection.GetCollection <Medic>(); FillMedicObjectWithInfo(newMedic); medicCollection.Save <Medic>(newMedic); //TODO: get rid of this disaster var medicArgs = new MedicIdentityEventArgs(newMedic.Id.ToString(), newMedic.Surname, newMedic.Name, newMedic.Patronymic, newMedic.Profession, newMedic.Category, newMedic.Degree, newMedic.Department); MedicAddEvent(this, medicArgs); }
private void FillMedicObjectWithInfo(Medic medic) { medic.Surname = tbSurname.Text; medic.Name = tbName.Text; medic.Patronymic = tbPatronymic.Text; medic.DateOfBirth = dtpBirthDate.GetNullOrValue(); medic.Profession = cbProfessions.Text; medic.Category = cbCategory.Text; medic.Degree = cbDegree.Text; medic.Department = cbDepartment.Text; if (String.IsNullOrWhiteSpace(tbCabinet.Text)) { medic.Cabinet = null; } else { medic.Cabinet = int.Parse(tbCabinet.Text); } medic.IsWorking = chbIsWorking.Checked; }
private void FillMedicObjectWithInfo(Medic medic) { medic.Surname = tbSurname.Text; medic.Name = tbName.Text; medic.Patronymic = tbPatronymic.Text; medic.DateOfBirth = dtpBirthDate.GetNullOrValue(); medic.Profession = cbProfessions.Text; medic.Category = cbCategory.Text; medic.Degree = cbDegree.Text; medic.Department = cbDepartment.Text; if(String.IsNullOrWhiteSpace(tbCabinet.Text)) { medic.Cabinet = null; } else { medic.Cabinet = int.Parse(tbCabinet.Text); } medic.IsWorking = chbIsWorking.Checked; }