private FamilyCoreEntity GetByProfileID(string strProfileID) { FamilyCoreEntity objFamilyCoreEntity = new FamilyCoreEntity(); try { Mugurtham.DTO.Profile.Family objFamily = new Mugurtham.DTO.Profile.Family(); IUnitOfWork objUOW = new UnitOfWork(_objLoggedInUser.ConnectionStringAppKey); using (objUOW as IDisposable) objFamily = objUOW.RepositoryFamily.GetAll().ToList().Where(p => p.ProfileID.Trim().ToLower() == strProfileID.Trim().ToLower()).FirstOrDefault(); objUOW = null; if (objFamily != null) { using (objFamily as IDisposable) { AssignEntityFromDTO(ref objFamily, ref objFamilyCoreEntity); } } objFamily = null; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return(objFamilyCoreEntity); }
public FamilyCoreEntity GetByProfileID(string strProfileID) { FamilyCoreEntity objFamilyCoreEntity = new FamilyCoreEntity(); try { Mugurtham.DTO.Profile.Family objFamily = new Mugurtham.DTO.Profile.Family(); IUnitOfWork objUOW = new UnitOfWork(); using (objUOW as IDisposable) objFamily = objUOW.RepositoryFamily.GetAll().ToList().Where(p => p.ProfileID.Trim().ToLower() == strProfileID.Trim().ToLower()).FirstOrDefault(); objUOW = null; if (objFamily != null) { using (objFamily as IDisposable) { AssignEntityFromDTO(ref objFamily, ref objFamilyCoreEntity); } } objFamily = null; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return objFamilyCoreEntity; }
private int AssignEntityFromDTO(ref Mugurtham.DTO.Profile.Family objDTOFamily, ref Mugurtham.Core.Family.FamilyCoreEntity objFamilyCoreEntity) { try { objFamilyCoreEntity.AboutFamily = objDTOFamily.AboutFamily; objFamilyCoreEntity.MarriedBrothers = objDTOFamily.BrothersMarried; objFamilyCoreEntity.FamilType = objDTOFamily.FamilType; objFamilyCoreEntity.FamilyOrigin = objDTOFamily.FamilyOrigin; objFamilyCoreEntity.FamilyStatus = objDTOFamily.FamilyStatus; objFamilyCoreEntity.FamilyValue = objDTOFamily.FamilyValue; objFamilyCoreEntity.FathersName = objDTOFamily.FathersName; objFamilyCoreEntity.FathersOccupation = objDTOFamily.FathersOccupation; objFamilyCoreEntity.Mothersname = objDTOFamily.Mothersname; objFamilyCoreEntity.MothersOccupation = objDTOFamily.MothersOccupation; objFamilyCoreEntity.NoOfBrothers = objDTOFamily.NoOfBrothers; objFamilyCoreEntity.NoOfSisters = objDTOFamily.NoOfSisters; objFamilyCoreEntity.MarriedSisters = objDTOFamily.SistersMarried; objFamilyCoreEntity.ProfileID = objDTOFamily.ProfileID; objFamilyCoreEntity.MothersSubSect = objDTOFamily.MothersSubSect; objFamilyCoreEntity.ParentsAlive = objDTOFamily.ParentsAlive; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return(0); }