public int Delete(string strViewerID, string strInterestedInID) { try { IUnitOfWork objIUnitOfWork = new UnitOfWork(); using (objIUnitOfWork as IDisposable) { Mugurtham.DTO.ProfileInterested.ProfileInterested objProfileInterested = new DTO.ProfileInterested.ProfileInterested(); using (objProfileInterested as IDisposable) { objProfileInterested = objIUnitOfWork.RepositoryProfileInterested.GetAll().ToList(). Where(p => p.ViewerID.Trim().ToLower() == strViewerID.Trim().ToLower() && p.InterestedInID.Trim().ToLower() == strInterestedInID.Trim().ToLower()).FirstOrDefault(); } if (objProfileInterested != null) { IUnitOfWork objIUnitOfWorkAdd = new UnitOfWork(); using (objIUnitOfWorkAdd as IDisposable) { objIUnitOfWorkAdd.RepositoryProfileInterested.Delete(objProfileInterested); objIUnitOfWorkAdd.commit(); } objIUnitOfWorkAdd = null; } objProfileInterested = null; } objIUnitOfWork = null; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return 0; }
public int Delete(string strViewerID, string strInterestedInID) { try { IUnitOfWork objIUnitOfWork = new UnitOfWork(_objLoggedInUser.ConnectionStringAppKey); using (objIUnitOfWork as IDisposable) { Mugurtham.DTO.ProfileInterested.ProfileInterested objProfileInterested = new DTO.ProfileInterested.ProfileInterested(); using (objProfileInterested as IDisposable) { objProfileInterested = objIUnitOfWork.RepositoryProfileInterested.GetAll().ToList(). Where(p => p.ViewerID.Trim().ToLower() == strViewerID.Trim().ToLower() && p.InterestedInID.Trim().ToLower() == strInterestedInID.Trim().ToLower()).FirstOrDefault(); } if (objProfileInterested != null) { IUnitOfWork objIUnitOfWorkAdd = new UnitOfWork(_objLoggedInUser.ConnectionStringAppKey); using (objIUnitOfWorkAdd as IDisposable) { objIUnitOfWorkAdd.RepositoryProfileInterested.Delete(objProfileInterested); objIUnitOfWorkAdd.commit(); } objIUnitOfWorkAdd = null; } objProfileInterested = null; } objIUnitOfWork = null; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return(0); }
public int Add(ref Mugurtham.Core.ProfileInterested.ProfileInterestedCoreEntity objProfileInterestedCoreEntity) { try { string strMappingID = string.Empty; string strViewerID = objProfileInterestedCoreEntity.ViewerID; string strInterestedInID = objProfileInterestedCoreEntity.InterestedInID; IUnitOfWork objIUnitOfWork = new UnitOfWork(); using (objIUnitOfWork as IDisposable) { Mugurtham.DTO.ProfileInterested.ProfileInterested objDTOProfileInterested = new DTO.ProfileInterested.ProfileInterested(); using (objDTOProfileInterested as IDisposable) { objDTOProfileInterested.ID = Helpers.primaryKey; AssignDTOFromEntity(ref objDTOProfileInterested, ref objProfileInterestedCoreEntity); } List<Mugurtham.DTO.ProfileInterested.ProfileInterested> objProfileInterested = new List<DTO.ProfileInterested.ProfileInterested>(); using (objProfileInterested as IDisposable) { objProfileInterested = objIUnitOfWork.RepositoryProfileInterested.GetAll().ToList(). Where(p => p.ViewerID.Trim().ToLower() == strViewerID.Trim().ToLower() && p.InterestedInID.Trim().ToLower() == strInterestedInID.Trim().ToLower()).ToList(); foreach (DTO.ProfileInterested.ProfileInterested objProfiles in objProfileInterested) { strMappingID = objProfiles.ID; } } if (objProfileInterested.Count == 0) { IUnitOfWork objIUnitOfWorkAdd = new UnitOfWork(); using (objIUnitOfWorkAdd as IDisposable) { objIUnitOfWorkAdd.RepositoryProfileInterested.Add(objDTOProfileInterested); objIUnitOfWorkAdd.commit(); objDTOProfileInterested = null; } objIUnitOfWorkAdd = null; } } objIUnitOfWork = null; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return 0; }
public int Add(ref Mugurtham.Core.ProfileInterested.ProfileInterestedCoreEntity objProfileInterestedCoreEntity) { try { string strMappingID = string.Empty; string strViewerID = objProfileInterestedCoreEntity.ViewerID; string strInterestedInID = objProfileInterestedCoreEntity.InterestedInID; IUnitOfWork objIUnitOfWork = new UnitOfWork(_objLoggedInUser.ConnectionStringAppKey); using (objIUnitOfWork as IDisposable) { Mugurtham.DTO.ProfileInterested.ProfileInterested objDTOProfileInterested = new DTO.ProfileInterested.ProfileInterested(); using (objDTOProfileInterested as IDisposable) { objDTOProfileInterested.ID = Helpers.primaryKey; AssignDTOFromEntity(ref objDTOProfileInterested, ref objProfileInterestedCoreEntity); } List <Mugurtham.DTO.ProfileInterested.ProfileInterested> objProfileInterested = new List <DTO.ProfileInterested.ProfileInterested>(); using (objProfileInterested as IDisposable) { objProfileInterested = objIUnitOfWork.RepositoryProfileInterested.GetAll().ToList(). Where(p => p.ViewerID.Trim().ToLower() == strViewerID.Trim().ToLower() && p.InterestedInID.Trim().ToLower() == strInterestedInID.Trim().ToLower()).ToList(); foreach (DTO.ProfileInterested.ProfileInterested objProfiles in objProfileInterested) { strMappingID = objProfiles.ID; } } if (objProfileInterested.Count == 0) { IUnitOfWork objIUnitOfWorkAdd = new UnitOfWork(_objLoggedInUser.ConnectionStringAppKey); using (objIUnitOfWorkAdd as IDisposable) { objIUnitOfWorkAdd.RepositoryProfileInterested.Add(objDTOProfileInterested); objIUnitOfWorkAdd.commit(); objDTOProfileInterested = null; } objIUnitOfWorkAdd = null; } } objIUnitOfWork = null; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return(0); }
public bool isInterestedProfile(string strViewerID, string strInterestedInID) { bool boolInterestedProfile = false; try { IUnitOfWork objIUnitOfWork = new UnitOfWork(); using (objIUnitOfWork as IDisposable) { Mugurtham.DTO.ProfileInterested.ProfileInterested objProfileInterested = new DTO.ProfileInterested.ProfileInterested(); using (objProfileInterested as IDisposable) { objProfileInterested = objIUnitOfWork.RepositoryProfileInterested.GetAll().ToList(). Where(p => p.ViewerID.Trim().ToLower() == strViewerID.Trim().ToLower() && p.InterestedInID.Trim().ToLower() == strInterestedInID.Trim().ToLower()).FirstOrDefault(); } if (objProfileInterested != null) boolInterestedProfile = true; } objIUnitOfWork = null; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return boolInterestedProfile; }