public void PassportInfoModelTest() { var photoName = "1.jpg"; var code = new Code("5013", "455999"); var issueInfo = new PassportIssueInfo("ОУФМС РФ по НСО в Ленинском районе", "540-007", new DateTime(2016, 1, 1)); var fullName = new FullName("Иванов", "Иван", "Иванович"); var birthInfo = new BirthInfo(new DateTime(1995, 1, 1), "НСО, г. Новосибирск"); var personInfo = new PersonInfo(fullName, birthInfo); var registerLocation = new Address("НСО, г. Новосибирск, ул. Валдайская, д. 19/1"); var actuallyLocation = new Address("НСО, г. Новосибирск, ул. Балдуйс, д. 1"); var locality = "г. Новосибирск"; var locationInfo = new PassportLocationInfo(registerLocation, actuallyLocation, locality); var passportFamilyInfo = new PassportFamilyInfo(familyStatus: FamilyStatus.Single, isHaveBaby: true); var passportInfo = new PassportInfo(photoName, code, issueInfo, personInfo, locationInfo, passportFamilyInfo); Assert.AreEqual(photoName, passportInfo.PhotoName); Assert.AreEqual(code, passportInfo.Code); Assert.AreEqual(issueInfo, passportInfo.IssueInfo); Assert.AreEqual(personInfo, passportInfo.PersonInfo); Assert.AreEqual(locationInfo, passportInfo.LocationInfo); Assert.AreEqual(passportFamilyInfo, passportInfo.FamilyInfo); }
private FamilyInfo BuildFamilyInfo() { var parentFamilyStatus = ParentFamilyStatus.Full; var motherRelativeStatus = RelativeStatus.Mother; var motherFullName = new FullName("Евдокимова", "Евгения", "Вадимовна"); var motherBirthInfo = new BirthInfo(new DateTime(1980, 1, 1), "г. Барнаул"); var motherPersonInfo = new PersonInfo(motherFullName, motherBirthInfo); var motherWorkPlace = "Магазин игрушек"; var motherInfo = new RelativeInfo(motherRelativeStatus, motherPersonInfo, motherWorkPlace); var fatherRelativeStatus = RelativeStatus.Father; var fatherFullName = new FullName("Евдокимов", "Евгений", "Сергеевич"); var fatherBirthInfo = new BirthInfo(new DateTime(1981, 1, 1), "г. Барнаул"); var fatherPersonInfo = new PersonInfo(fatherFullName, fatherBirthInfo); var fatherWorkPlace = "Завод"; var fatherInfo = new RelativeInfo(fatherRelativeStatus, fatherPersonInfo, fatherWorkPlace); var relatives = new List <RelativeInfo>() { motherInfo, fatherInfo }; return(new FamilyInfo(parentFamilyStatus, relatives)); }
private FamilyInfo BuildFamilyInfo() { var parentFamilyStatus = _thirdCardGroup.FamilyCard.ParentFamilyStatus.ToParentFamilyStatusEnum(); var relatives = new List <RelativeInfo>(); foreach (var relativeUIModel in _thirdCardGroup.FamilyCard.RelativeInfoUIModels) { var relativeStatus = relativeUIModel.RelativeStatus.ToRelativeStatusEnum(); var fullName = new FullName(relativeUIModel.FullName); if (!relativeUIModel.BirthDate.HasValue) { throw new NullReferenceException(nameof(relativeUIModel.BirthDate)); } var birthInfo = new BirthInfo(relativeUIModel.BirthDate.Value, relativeUIModel.BirthPlace); var personInfo = new PersonInfo(fullName, birthInfo); var workPlace = relativeUIModel.WorkPlace; var relativeInfo = new RelativeInfo(relativeStatus, personInfo, workPlace); relatives.Add(relativeInfo); } return(new FamilyInfo(parentFamilyStatus, relatives)); }
public void FamilyInfoTest() { var parentFamilyStatus = ParentFamilyStatus.Full; var motherRelativeStatus = RelativeStatus.Mother; var motherFullName = new FullName("Евдокимова", "Евгения", "Вадимовна"); var motherBirthInfo = new BirthInfo(new DateTime(1980, 1, 1), "г. Барнаул"); var motherPersonInfo = new PersonInfo(motherFullName, motherBirthInfo); var motherWorkPlace = "Магазин игрушек"; var motherInfo = new RelativeInfo(motherRelativeStatus, motherPersonInfo, motherWorkPlace); var fatherRelativeStatus = RelativeStatus.Father; var fatherFullName = new FullName("Евдокимов", "Евгений", "Сергеевич"); var fatherBirthInfo = new BirthInfo(new DateTime(1981, 1, 1), "г. Барнаул"); var fatherPersonInfo = new PersonInfo(fatherFullName, fatherBirthInfo); var fatherWorkPlace = "Завод"; var fatherInfo = new RelativeInfo(fatherRelativeStatus, fatherPersonInfo, fatherWorkPlace); var relatives = new List <RelativeInfo>() { motherInfo, fatherInfo }; var familyInfo = new FamilyInfo(parentFamilyStatus, relatives); Assert.AreEqual(parentFamilyStatus, familyInfo.ParentFamilyStatus); Assert.AreEqual(motherInfo, familyInfo.GetRelative(0)); Assert.AreEqual(fatherInfo, familyInfo.GetRelative(1)); }
public void RelativeInfoTest() { var motherRelativeStatus = RelativeStatus.Mother; var motherSurname = "Евдокимова"; var motherName = "Евгения"; var motherPatronymic = "Вадимовна"; var motherFullName = new FullName(motherSurname, motherName, motherPatronymic); var motherBirthDate = new DateTime(1980, 1, 1); var motherBirthPlace = "г. Барнаул"; var motherBirthInfo = new BirthInfo(motherBirthDate, motherBirthPlace); var motherPersonInfo = new PersonInfo(motherFullName, motherBirthInfo); var motherWorkPlace = "Магазин игрушек"; var motherInfo = new RelativeInfo(motherRelativeStatus, motherPersonInfo, motherWorkPlace); Assert.AreEqual(motherRelativeStatus, motherInfo.RelativeStatus); Assert.AreEqual(motherSurname, motherInfo.PersonInfo.FullName.Surname); Assert.AreEqual(motherName, motherInfo.PersonInfo.FullName.Name); Assert.AreEqual(motherPatronymic, motherInfo.PersonInfo.FullName.Patronymic); Assert.AreEqual(motherBirthDate, motherInfo.PersonInfo.BirthInfo.Date); Assert.AreEqual(motherBirthPlace, motherInfo.PersonInfo.BirthInfo.Place); Assert.AreEqual(motherWorkPlace, motherInfo.WorkPlace); }
public int SaveBirthInfo(BirthInfo aBirthInfo) { Query = "INSERT INTO BirthInfo(BirthRegNo,Name,IssueDate,FathersName,MothersName,FathersNationality," + "MothersNationality,PresentAddress,PermanentAddress,DateOfBirth,BirthTime,Weight,Height,Gender,Nationality," + "UserId,OPID,CabinBed,TypeOfDelivery)VALUES(@BirthRegNo,@Name,@IssueDate,@FathersName,@MothersName," + "@FathersNationality,@MothersNationality,@PresentAddress,@PermanentAddress,@DateOfBirth," + "@BirthTime,@Weight,@Height,@Gender,@Nationality,@UserId,@OPID,@CabinBed,@TypeOfDelivery)"; Command = new SqlCommand(Query, Connection); Command.Parameters.AddWithValue("@BirthRegNo", aBirthInfo.BirthRegNo ?? ""); Command.Parameters.AddWithValue("@Name", aBirthInfo.Name ?? ""); Command.Parameters.AddWithValue("@IssueDate", aBirthInfo.IssueDate); Command.Parameters.AddWithValue("@FathersName", aBirthInfo.FathersName ?? ""); Command.Parameters.AddWithValue("@MothersName", aBirthInfo.MothersName); Command.Parameters.AddWithValue("@FathersNationality", aBirthInfo.FathersNationality ?? ""); Command.Parameters.AddWithValue("@MothersNationality", aBirthInfo.MothersNationality ?? ""); Command.Parameters.AddWithValue("@PresentAddress", aBirthInfo.PresentAddress ?? ""); Command.Parameters.AddWithValue("@PermanentAddress", aBirthInfo.PermanentAddress ?? ""); Command.Parameters.AddWithValue("@DateOfBirth", aBirthInfo.DateOfBirth); Command.Parameters.AddWithValue("@BirthTime", aBirthInfo.BirthTime); Command.Parameters.AddWithValue("@Weight", aBirthInfo.Weight ?? ""); Command.Parameters.AddWithValue("@Height", aBirthInfo.Height ?? ""); Command.Parameters.AddWithValue("@Gender", aBirthInfo.Gender ?? ""); Command.Parameters.AddWithValue("@Nationality", aBirthInfo.Nationality ?? ""); Command.Parameters.AddWithValue("@UserId", aBirthInfo.UserId ?? ""); Command.Parameters.AddWithValue("@OPID", aBirthInfo.OPID ?? ""); Command.Parameters.AddWithValue("@CabinBed", aBirthInfo.CabinBed ?? ""); Command.Parameters.AddWithValue("@TypeOfDelivery", aBirthInfo.TypeOfDelivery ?? ""); int rowAffect = Command.ExecuteNonQuery(); return(rowAffect); }
public int UpdateBirthInfo(BirthInfo aBirthInfo) { Query = "UPDATE BirthInfo SET BirthRegNo=@BirthRegNo,Name=@Name,IssueDate=@IssueDate,FathersName=@FathersName," + "MothersName=@MothersName,FathersNationality=@FathersNationality,MothersNationality=@MothersNationality," + "PresentAddress=@PresentAddress,PermanentAddress=@PermanentAddress,DateOfBirth=@DateOfBirth," + "BirthTime=@BirthTime,Gender=@Gender,Nationality=@Nationality,UpdateDate=@UpdateDate," + "UserId=@UserId,CabinBed=@CabinBed,TypeOfDelivery=@TypeOfDelivery WHERE OPID=@OPID"; Command = new SqlCommand(Query, Connection); Command.Parameters.AddWithValue("@BirthRegNo", aBirthInfo.BirthRegNo ?? ""); Command.Parameters.AddWithValue("@Name", aBirthInfo.Name ?? ""); Command.Parameters.AddWithValue("@IssueDate", aBirthInfo.IssueDate); Command.Parameters.AddWithValue("@FathersName", aBirthInfo.FathersName ?? ""); Command.Parameters.AddWithValue("@MothersName", aBirthInfo.MothersName); Command.Parameters.AddWithValue("@FathersNationality", aBirthInfo.FathersNationality ?? ""); Command.Parameters.AddWithValue("@MothersNationality", aBirthInfo.MothersNationality ?? ""); Command.Parameters.AddWithValue("@PresentAddress", aBirthInfo.PresentAddress ?? ""); Command.Parameters.AddWithValue("@PermanentAddress", aBirthInfo.PermanentAddress ?? ""); Command.Parameters.AddWithValue("@DateOfBirth", aBirthInfo.DateOfBirth); Command.Parameters.AddWithValue("@BirthTime", aBirthInfo.BirthTime); Command.Parameters.AddWithValue("@Gender", aBirthInfo.Gender ?? ""); Command.Parameters.AddWithValue("@Nationality", aBirthInfo.Nationality ?? ""); Command.Parameters.AddWithValue("@UpdateDate", aBirthInfo.UpdateDate); Command.Parameters.AddWithValue("@UserId", aBirthInfo.UserId); Command.Parameters.AddWithValue("@OPID", aBirthInfo.OPID); Command.Parameters.AddWithValue("@CabinBed", aBirthInfo.CabinBed ?? ""); Command.Parameters.AddWithValue("@TypeOfDelivery", aBirthInfo.TypeOfDelivery ?? ""); int rowAffect = Command.ExecuteNonQuery(); return(rowAffect); }
private static FamilyInfo BuildFamilyInfo() { var parentFamilyStatus = ParentFamilyStatus.Full; var fatherRelativeStatus = RelativeStatus.Father; var fatherFullName = new FullName("Грибко", "Иван", "Викторович"); var fatherBirthInfo = new BirthInfo(new DateTime(1960, 1, 1), "Новосибирская обл., г. Новосибирск"); var fatherPersonInfo = new PersonInfo(fatherFullName, fatherBirthInfo); var fatherWorkPlace = "Пекарь"; var fatherInfo = new RelativeInfo(fatherRelativeStatus, fatherPersonInfo, fatherWorkPlace); var motherRelativeStatus = RelativeStatus.Mother; var motherFullName = new FullName("Грибко", "Юлия", "Вадимовна"); var motherBirthInfo = new BirthInfo(new DateTime(1965, 1, 1), "Новосибирская обл., г. Новосибирск"); var motherPersonInfo = new PersonInfo(motherFullName, motherBirthInfo); var motherWorkPlace = "Повар"; var motherInfo = new RelativeInfo(motherRelativeStatus, motherPersonInfo, motherWorkPlace); var sisterRelativeStatus = RelativeStatus.Sister; var sisterFullName = new FullName("Грибко", "Валерия", "Ивановна"); var sisterBirthInfo = new BirthInfo(new DateTime(1990, 1, 1), "Новосибирская обл., г. Новосибирск"); var sisterPersonInfo = new PersonInfo(sisterFullName, sisterBirthInfo); var sisterWorkPlace = "Художник"; var sisterInfo = new RelativeInfo(sisterRelativeStatus, sisterPersonInfo, sisterWorkPlace); var relatives = new List <RelativeInfo>() { fatherInfo, motherInfo, sisterInfo }; return(new FamilyInfo(parentFamilyStatus, relatives)); }
public int DeleteBirthInfo(BirthInfo aBirthInfo) { Query = "DELETE FROM BirthInfo WHERE Id='" + aBirthInfo.Id + "'"; Command = new SqlCommand(Query, Connection); int rowAffect = Command.ExecuteNonQuery(); return(rowAffect); }
public void BirthInfoTest() { var date = new DateTime(1995, 1, 1); var place = "НСО, г. Новосибирск"; var birthInfo = new BirthInfo(date, place); Assert.AreEqual(date, birthInfo.Date); Assert.AreEqual(place, birthInfo.Place); }
protected Person(PersonId id, PersonName name, Gender gender, BirthInfo birthInfo, params Country[] nationalities) { CheckRule(new BusinessRules.PersonMustHaveTwoNationalitiesMaximum(nationalities)); Id = id; Name = name; Gender = gender; BirthInfo = birthInfo; _nationalities.AddRange(nationalities); }
public MessageModel DeleteBirthInfo(BirthInfo aBirthInfo) { MessageModel aMessageModel = new MessageModel(); if (aBirthInfoGatway.DeleteBirthInfo(aBirthInfo) > 0) { aMessageModel.MessageTitle = "Successfull"; aMessageModel.MessageBody = "Birth info deleted successfully."; } return(aMessageModel); }
public void SetBirthPoint() { BirthInfo info = new BirthInfo(); info.x = curSelectPosX; info.y = curSelectPosY; if (mapInfo.birthInfoList.Contains(info)) { mapInfo.birthInfoList.Remove(info); } else { mapInfo.birthInfoList.Add(info); } }
public void FamilyInfoGettingExceptionTest() { var parentFamilyStatus = ParentFamilyStatus.Full; var motherRelativeStatus = RelativeStatus.Mother; var motherFullName = new FullName("Евдокимова", "Евгения", "Вадимовна"); var motherBirthInfo = new BirthInfo(new DateTime(1980, 1, 1), "г. Барнаул"); var motherPersonInfo = new PersonInfo(motherFullName, motherBirthInfo); var motherWorkPlace = "Магазин игрушек"; var motherInfo = new RelativeInfo(motherRelativeStatus, motherPersonInfo, motherWorkPlace); var familyInfo = new FamilyInfo(parentFamilyStatus); familyInfo.AddRelative(motherInfo); Assert.IsNull(familyInfo.GetRelative(1)); }
public StudentDto(Student student, BirthInfo birthInfo, ContactInfo contactInfo, Department department) { Id = student.Id; FirstName = student.UserInfo.FirstName; LastName = student.UserInfo.LastName; IdentityNumber = student.IdentificationNumber; DateOfBirth = birthInfo.DateOfBirth; Sex = birthInfo.Sex; PhoneNumber = contactInfo.PhoneNumber; Email = contactInfo.Email; Address = contactInfo.Address; ClassId = student.ClassId; ClassName = student.Class.Name; DepartmentId = department.Id; DepartmentName = department.Name; ProgramId = department.ProgramId; ProgramName = department.Program.Name; }
public MessageModel SaveBirthInfo(BirthInfo aBirthInfo) { MessageModel aMessageModel = new MessageModel(); string message = IsChecked(aBirthInfo); if (message != "Checked") { aMessageModel.MessageTitle = "Warning"; aMessageModel.MessageBody = message; return(aMessageModel); } if (aBirthInfoGatway.SaveBirthInfo(aBirthInfo) > 0) { aMessageModel.MessageTitle = "Successfull"; aMessageModel.MessageBody = "Birth info saved successfully."; } return(aMessageModel); }
public string IsChecked(BirthInfo aBirthInfo) { string message = ""; if (aBirthInfo.OPID == string.Empty) { return("Please Select Patient"); } if (aBirthInfo.Weight == string.Empty) { return("Weight can't empty. Please insert weight."); } if (aBirthInfo.Height == string.Empty) { return("Height can't empty. Please insert Height."); } message = "Checked"; return(message); }
private Player ( PersonId id, PersonName name, Gender gender, BirthInfo birthInfo, Foot favouriteFoot, BodyMassIndex bmi, Percentile percentile, PhysicalFeatureSet physicalFeatureSet, PlayerPosition playerPosition, params Country[] nationalities ) : base(id, name, gender, birthInfo, nationalities) { FavouriteFoot = favouriteFoot; Bmi = bmi; Percentile = percentile; PhysicalFeatureSet = physicalFeatureSet; PlayerPosition = playerPosition; }
private static PassportInfo BuildPassportInfo(priz priz) { DateTime?passportIssueDate = priz.d_pass.GetDateTime(); if (!passportIssueDate.HasValue) { throw new ArgumentException(nameof(priz)); } DateTime?birthdate = priz.born_date.GetDateTime(); if (!birthdate.HasValue) { throw new ArgumentException(nameof(priz)); } var photoName = priz.photo; var passportCode = new Code(priz.pass); var issueInfo = new PassportIssueInfo(issueBy: priz.g_pass, devisionCode: priz.kod_g_pass, issueDate: passportIssueDate.Value); var fullName = new FullName(priz.surname, priz.name, priz.patr_name); var birthInfo = new BirthInfo(date: birthdate.Value, place: priz.born_place); var personInfo = new PersonInfo(fullName, birthInfo); var registerLocation = new Address(priz.register_location); var actuallyLocation = new Address(priz.actually_location); var locality = priz.locality; var locationInfo = new PassportLocationInfo(registerLocation, actuallyLocation, locality); var passportFamilyInfo = new PassportFamilyInfo(familyStatus: priz.family_status.ToFamilyStatusEnum(), isHaveBaby: priz.baby == PassportFamilyInfo.HaveBaby); return(new PassportInfo(photoName, passportCode, issueInfo, personInfo, locationInfo, passportFamilyInfo)); }
private void DrawBirthPoint() { lineMat.SetPass(0); GL.Begin(GL.LINES); GL.Color(Color.yellow); int tarX = (int)focusTrm.position.x; int tarY = (int)focusTrm.position.z; for (int i = 0; i < mapInfo.birthInfoList.Count; i++) { BirthInfo info = mapInfo.birthInfoList[i]; if (info.x > tarX - visibleSize && info.x < tarX + visibleSize && info.y > tarY - visibleSize && info.y < tarY + visibleSize) { DrawOneGrid(info.x, info.y); } } GL.End(); }
private PassportInfo BuildPassportInfo() { var photoName = _firstCardGroup.PassportPersonInfoCard.PhotoName; var code = new Code(_firstCardGroup.PassportInfoCard.Code); if (!_firstCardGroup.PassportInfoCard.IssueDate.HasValue) { throw new NullReferenceException(nameof(_firstCardGroup.PassportInfoCard.IssueDate)); } var issueInfo = new PassportIssueInfo(_firstCardGroup.PassportInfoCard.IssueBy, _firstCardGroup.PassportInfoCard.DevisionCode, _firstCardGroup.PassportInfoCard.IssueDate.Value); var fullName = new FullName(_firstCardGroup.PassportPersonInfoCard.Surname, _firstCardGroup.PassportPersonInfoCard.Name, _firstCardGroup.PassportPersonInfoCard.Patronymic); if (!_firstCardGroup.PassportPersonInfoCard.BirthDate.HasValue) { throw new NullReferenceException(nameof(_firstCardGroup.PassportPersonInfoCard.BirthDate)); } var birthInfo = new BirthInfo(_firstCardGroup.PassportPersonInfoCard.BirthDate.Value, _firstCardGroup.PassportPersonInfoCard.BirthPlace); var personInfo = new PersonInfo(fullName, birthInfo); var registerLocation = new Address(_firstCardGroup.PassportAccommodationCard.RegisterLocation); var actuallyLocation = new Address(_firstCardGroup.PassportAccommodationCard.ActuallyLocation); var locality = _firstCardGroup.PassportAccommodationCard.Locality; var locationInfo = new PassportLocationInfo(registerLocation, actuallyLocation, locality); var passportFamilyInfo = new PassportFamilyInfo(_firstCardGroup.PassportFamilyInfoCard.FamilyStatus.ToFamilyStatusEnum(), _firstCardGroup.PassportFamilyInfoCard.IsHaveBaby); return(new PassportInfo(photoName, code, issueInfo, personInfo, locationInfo, passportFamilyInfo)); }
public void PersonInfoTest() { var surname = "Иванов"; var name = "Иван"; var patronymic = "Иванович"; var fullNameValue = $"{surname} {name} {patronymic}"; var fullName = new FullName(surname, name, patronymic); var date = new DateTime(1995, 1, 1); var place = "НСО, г. Новосибирск"; var birthInfo = new BirthInfo(date, place); var personInfo = new PersonInfo(fullName, birthInfo); Assert.AreEqual(surname, personInfo.FullName.Surname); Assert.AreEqual(name, personInfo.FullName.Name); Assert.AreEqual(patronymic, personInfo.FullName.Patronymic); Assert.AreEqual(fullNameValue, personInfo.FullName.Value); Assert.AreEqual(date, personInfo.BirthInfo.Date); Assert.AreEqual(place, personInfo.BirthInfo.Place); }
private static PassportInfo BuildPassportInfo(int sqliteId, string photoExtension) { var photoName = $"{sqliteId}{photoExtension}"; var code = new Code("5013", "055467"); var issueInfo = new PassportIssueInfo("ОУФМС РФ по НСО в Ленинском районе", "540007", new DateTime(2016, 1, 1)); var fullName = new FullName("Иванов" + sqliteId, "Иван" + sqliteId, "Иванович" + sqliteId); var birthInfo = new BirthInfo(new DateTime(1999, 1, 1), "НСО, г. Новосибирск"); var personInfo = new PersonInfo(fullName, birthInfo); var registerLocation = new Address("Новосибирская обл., г. Новосибирск, ул. Валдайская, д. 19/1"); var actuallyLocation = new Address("Новосибирская обл., г. Новосибирск, ул. Валдайская, д. 19/1"); var locality = "г. Новосибирск"; var locationInfo = new PassportLocationInfo(registerLocation, actuallyLocation, locality); var passportFamilyInfo = new PassportFamilyInfo(familyStatus: FamilyStatus.Single, isHaveBaby: false); return(new PassportInfo(photoName, code, issueInfo, personInfo, locationInfo, passportFamilyInfo)); }
private void btnDelete_Click(object sender, EventArgs e) { if (xtraTabControl1.SelectedTabPage == TabBirthInfo) { DialogResult dr = MessageBox.Show("Are you sure to delete row?", "Confirmation Message", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { BirthInfo aBirthInfo = new BirthInfo(); aBirthInfo.Id = Convert.ToInt32(lblId.Text); MessageModel aMessageModel = new MessageModel(); aMessageModel = aBirthInfoManager.DeleteBirthInfo(aBirthInfo); if (aMessageModel.MessageTitle == "Successfull") { MessageBox.Show(aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); RefreshBirthInfo(); } } } else { DialogResult dr = MessageBox.Show("Are you sure to delete row?", "Confirmation Message", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { DeathInfo aDeathInfo = new DeathInfo(); aDeathInfo.Opid = txtDeathPatientID.Text; MessageModel aMessageModel = new MessageModel(); aMessageModel = aDeathInfoManager.DeleteDeathInfo(aDeathInfo); if (aMessageModel.MessageTitle == "Successfull") { MessageBox.Show(aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); RefreshDeathInfo(); } } } }
public static Player CreatePlayer ( PersonName name, Gender gender, BirthInfo birthInfo, Foot favouriteFoot, BodyMassIndex bmi, Percentile percentile, PhysicalFeatureSet physicalFeatureSet, PlayerPosition playerPosition, params Country[] nationalities ) => new Player ( PersonId.CreateNew(), name, gender, birthInfo, favouriteFoot, bmi, percentile, physicalFeatureSet, playerPosition, nationalities );
private static FamilyInfo BuildFamilyInfo(priz priz) { var parentFamilyStatus = priz.parents.ToParentFamilyStatusEnum(); var familyInfo = new FamilyInfo(parentFamilyStatus); if (!string.IsNullOrWhiteSpace(priz.relation)) { DateTime?birthdate = priz.relative_birth_date.GetDateTime(); if (!birthdate.HasValue) { throw new ArgumentException(nameof(priz)); } var fullName = new FullName(priz.relative_name); var birthInfo = new BirthInfo(date: birthdate.Value, place: priz.relative_birth_place); var personInfo = new PersonInfo(fullName, birthInfo); var relative = new RelativeInfo(relativeStatus: priz.relation.ToRelativeStatusEnum(), personInfo: personInfo, workPlace: priz.relative_work_place); familyInfo.AddRelative(relative); } if (!string.IsNullOrWhiteSpace(priz.relation2)) { DateTime?birthdate = priz.relative_birth_date2.GetDateTime(); if (!birthdate.HasValue) { throw new ArgumentException(nameof(priz)); } var fullName = new FullName(priz.relative_name2); var birthInfo = new BirthInfo(date: birthdate.Value, place: priz.relative_birth_place2); var personInfo = new PersonInfo(fullName, birthInfo); var relative = new RelativeInfo(relativeStatus: priz.relation2.ToRelativeStatusEnum(), personInfo: personInfo, workPlace: priz.relative_work_place2); familyInfo.AddRelative(relative); } if (!string.IsNullOrWhiteSpace(priz.relation3)) { DateTime?birthdate = priz.relative_birth_date3.GetDateTime(); if (!birthdate.HasValue) { throw new ArgumentException(nameof(priz)); } var fullName = new FullName(priz.relative_name3); var birthInfo = new BirthInfo(date: birthdate.Value, place: priz.relative_birth_place3); var personInfo = new PersonInfo(fullName, birthInfo); var relative = new RelativeInfo(relativeStatus: priz.relation3.ToRelativeStatusEnum(), personInfo: personInfo, workPlace: priz.relative_work_place3); familyInfo.AddRelative(relative); } return(familyInfo); }
public PlayerBuilder WithBirthInfo(BirthInfo birthInfo) { _birthInfo = birthInfo; return(this); }
public void SaveAndUpdateBirthInfo() { if (xtraTabControl1.SelectedTabPage == TabBirthInfo) { MessageModel aMessageModel = new MessageModel(); BirthInfo aBirthInfo = new BirthInfo(); if (!string.IsNullOrEmpty(lblId.Text)) { aBirthInfo.Id = Convert.ToInt32(lblId.Text); } aBirthInfo.OPID = txtOpId.Text; aBirthInfo.Name = txtName.Text; aBirthInfo.DateOfBirth = dateTimeDateOfBirth.Value; aBirthInfo.BirthTime = dateTimeBirthTime.Text; aBirthInfo.Weight = txtWeight.Text; aBirthInfo.Height = txtHeight.Text; aBirthInfo.IssueDate = dateTimeIssueDate.Value; aBirthInfo.BirthRegNo = txtBirthRegNo.Text; aBirthInfo.Gender = cmbGender.SelectedText; aBirthInfo.Nationality = txtNationality.Text; aBirthInfo.FathersName = txtFathersName.Text; aBirthInfo.MothersName = txtMothersName.Text; aBirthInfo.FathersNationality = txtFathersNationality.Text; aBirthInfo.MothersNationality = txtMothersNationality.Text; aBirthInfo.PresentAddress = txtPresentAddress.Text; aBirthInfo.PermanentAddress = txtPermanentAddress.Text; aBirthInfo.UserId = lblUserId.Text; aBirthInfo.CabinBed = txtCabinBed.Text; aBirthInfo.TypeOfDelivery = txtTypeOfDelivery.Text; if (btnBirthInfoSave.Text == "Save") { aBirthInfo.CreateDate = DateTime.Now; aMessageModel = aBirthInfoManager.SaveBirthInfo(aBirthInfo); if (aMessageModel.MessageTitle == "Successfull") { MessageBox.Show(aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); RefreshBirthInfo(); } MessageBox.Show(aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); } else { aBirthInfo.UpdateDate = DateTime.Now; aMessageModel = aBirthInfoManager.UpdateBirthInfo(aBirthInfo); if (aMessageModel.MessageTitle == "Successfull") { MessageBox.Show(aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); RefreshBirthInfo(); } } } else if (xtraTabControl1.SelectedTabPage == TabDeathInfo) { DeathInfo aDeathInfo = new DeathInfo(); aDeathInfo.DeathRegNo = txtDeathRegNo.Text; aDeathInfo.Name = txtDeathName.Text; aDeathInfo.IssueDate = dateTimeDeathIssueDate.Value; aDeathInfo.FathersName = txtDeathFathersName.Text; aDeathInfo.MothersName = txtDeathMothersName.Text; aDeathInfo.DateOfDeath = dateTimeDateOfDeath.Value; aDeathInfo.DeathTime = dateTimeDeathTime.Text; aDeathInfo.Gender = cmbGender.Text; aDeathInfo.MaritalStatus = cmbDeathMaritalStatus.Text; aDeathInfo.SpouseName = txtDeathSpouseName.Text; aDeathInfo.PresentAddress = txtDeathPresentAddress.Text; aDeathInfo.PermanentAddress = txtDeathPermanentAddress.Text; aDeathInfo.Nationality = txtNationality.Text; aDeathInfo.UserId = lblUserId.Text; aDeathInfo.Opid = txtDeathPatientID.Text; aDeathInfo.Age = txtDeathAge.Text; aDeathInfo.Floor = txtFloor.Text; aDeathInfo.Cabin = txtCabinBed.Text; aDeathInfo.Bed = txtBed.Text; aDeathInfo.Religion = txtReligion.Text; aDeathInfo.DateOfAdmission = dateOfAdmission.Value; aDeathInfo.IntervalBetween = txtIntervalBetween.Text; aDeathInfoManager = new DeathInfoManager(); MessageModel aMessageModel = new MessageModel(); if (btnBirthInfoSave.Text == "Save") { aDeathInfo.CreateDate = DateTime.Now; aMessageModel = aDeathInfoManager.SaveDeathInfo(aDeathInfo); if (aMessageModel.MessageTitle == "Successfull") { MessageBox.Show(aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); RefreshDeathInfo(); } } else { aDeathInfo.UpdateDate = DateTime.Now; aMessageModel = aDeathInfoManager.UpdateDeathInfo(aDeathInfo); if (aMessageModel.MessageTitle == "Successfull") { MessageBox.Show(aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); RefreshDeathInfo(); } } } }
public static Person CreateNew(PersonName name, Gender gender, BirthInfo birthInfo, params Country[] nationalities) { return(new Person(PersonId.CreateNew(), name, gender, birthInfo, nationalities)); }