public string FindExistingMother(MotherDetailsView motherdetails) { try { string ptnPk = ""; using (UnitOfWork unitOfWork = new UnitOfWork(new PsmartContext())) { var motherDetailsView = unitOfWork.MotherDetailsViewRepository.FindBy(x => x.Ptn_pk == motherdetails.Ptn_pk && x.firstName == motherdetails.firstName && x.lastName == motherdetails.lastName).FirstOrDefault(); unitOfWork.Dispose(); if (motherDetailsView != null) { ptnPk = motherDetailsView.Ptn_pk.ToString(); } } return(ptnPk); } catch (Exception e) { Console.WriteLine(e); throw; } }
public string FindExistingMother(MotherDetailsView motherDetailsView) { return(motherDetailsViewManager.FindExistingMother(motherDetailsView)); }