public int AssignEntityFromDTO(BasicInfoCoreEntity objBasicInfoCoreEntity, Mugurtham.DTO.Profile.BasicInfo objBasicInfo) { try { objBasicInfoCoreEntity.ProfileID = objBasicInfo.ProfileID; objBasicInfoCoreEntity.SangamProfileID = objBasicInfo.SangamProfileID; objBasicInfoCoreEntity.AboutMe = objBasicInfo.AboutMe; objBasicInfoCoreEntity.Age = objBasicInfo.Age; objBasicInfoCoreEntity.AnyDhosham = objBasicInfo.AnyDosham; objBasicInfoCoreEntity.BloodGroup = objBasicInfo.BloodGroup; objBasicInfoCoreEntity.BodyType = objBasicInfo.BodyType; objBasicInfoCoreEntity.Caste = objBasicInfo.Caste; objBasicInfoCoreEntity.ChildrenLivingStatus = objBasicInfo.ChildrenLivingStatus; objBasicInfoCoreEntity.Complexion = objBasicInfo.Complexion; objBasicInfoCoreEntity.DOB = objBasicInfo.DateOfBirth; objBasicInfoCoreEntity.Drinking = objBasicInfo.Drinking; objBasicInfoCoreEntity.Eating = objBasicInfo.Eating; objBasicInfoCoreEntity.ElanUserID = objBasicInfo.ElanUserID; objBasicInfoCoreEntity.Gender = objBasicInfo.Gender; objBasicInfoCoreEntity.Gothram = objBasicInfo.Gothram; objBasicInfoCoreEntity.Height = objBasicInfo.Height; objBasicInfoCoreEntity.HoroscopeMatch = objBasicInfo.HoroscopeMatch; objBasicInfoCoreEntity.MaritalStatus = objBasicInfo.MaritalStatus; objBasicInfoCoreEntity.MotherTongue = objBasicInfo.MotherTongue; objBasicInfoCoreEntity.Name = objBasicInfo.Name; objBasicInfoCoreEntity.NoOfChildren = objBasicInfo.NoOfChildren; objBasicInfoCoreEntity.PartnerExpectation = objBasicInfo.PartnerExpectations; objBasicInfoCoreEntity.PhysicalStatus = objBasicInfo.PhysicalStatus; objBasicInfoCoreEntity.PlaceOfBirth = objBasicInfo.PlaceOfBirth; objBasicInfoCoreEntity.ProfileCreatedBy = objBasicInfo.ProfileCreatedBy; objBasicInfoCoreEntity.Raasi = objBasicInfo.Raasi; objBasicInfoCoreEntity.Religion = objBasicInfo.Religion; objBasicInfoCoreEntity.SangamID = objBasicInfo.SangamID; objBasicInfoCoreEntity.Smoking = objBasicInfo.Smoking; objBasicInfoCoreEntity.Star = objBasicInfo.Star; objBasicInfoCoreEntity.SubCaste = objBasicInfo.SubCaste; objBasicInfoCoreEntity.TamilDOB = objBasicInfo.TamilDOB; objBasicInfoCoreEntity.TOB = objBasicInfo.TimeOfBirth; objBasicInfoCoreEntity.Weight = objBasicInfo.Weight; objBasicInfoCoreEntity.Zodiac = objBasicInfo.Zodiac; objBasicInfoCoreEntity.ZodiacDay = objBasicInfo.ZodiacDay; objBasicInfoCoreEntity.ZodiacMonth = objBasicInfo.ZodiacMonth; objBasicInfoCoreEntity.ZodiacYear = objBasicInfo.ZodiacYear; objBasicInfoCoreEntity.PhotoPath = objBasicInfo.PhotoPath; objBasicInfoCoreEntity.CreatedDate = objBasicInfo.CreatedDate; objBasicInfoCoreEntity.Paadham = objBasicInfo.Paadham; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return 0; }
public void Put([FromBody] BasicInfoCoreEntity objBasicInfoCoreEntity) { string strLoggedInUserID = string.Empty; IEnumerable <string> headerValues = Request.Headers.GetValues("MugurthamUserToken"); strLoggedInUserID = headerValues.FirstOrDefault(); Mugurtham.Core.Login.LoggedInUser objLoggedIn = new Core.Login.LoggedInUser(Request.Headers.GetValues("MugurthamUserToken").FirstOrDefault(), Request.Headers.GetValues("CommunityID").FirstOrDefault()); using (objLoggedIn as IDisposable) { BasicInfoCore objBasicInfoCore = new BasicInfoCore(ref objLoggedIn); using (objBasicInfoCore as IDisposable) objBasicInfoCore.Edit(ref objBasicInfoCoreEntity); objBasicInfoCore = null; } objLoggedIn = null; }
public int GetAll(ref List<ProfileCore> objProfileCoreList, string strGender, string strSangamID) { try { BasicInfoCore objBasicInfoCore = new BasicInfoCore(); using (objBasicInfoCore as IDisposable) { List<BasicInfoCoreEntity> objBasicInfoCoreEntityList = new List<BasicInfoCoreEntity>(); IUnitOfWork objIUnitOfWork = new UnitOfWork(); using (objIUnitOfWork as IDisposable) { if ((objIUnitOfWork.RepositoryBasicInfo.getAllProfiles(strGender, strSangamID) != null) && (objIUnitOfWork.RepositoryBasicInfo.getAllProfiles(strGender, strSangamID).Count > 0)) { List<Mugurtham.DTO.Profile.BasicInfo> objListBasicInfo = new List<Mugurtham.DTO.Profile.BasicInfo>(); objListBasicInfo = objIUnitOfWork.RepositoryBasicInfo.getAllProfiles(strGender, strSangamID); if (objListBasicInfo != null && objListBasicInfo.Count > 0) { foreach (Mugurtham.DTO.Profile.BasicInfo objBasicInfo in objListBasicInfo) { using (objBasicInfo as IDisposable) { BasicInfoCoreEntity objBasicInfoCoreEntity = new BasicInfoCoreEntity(); using (objBasicInfoCoreEntity as IDisposable) { objBasicInfoCore.AssignEntityFromDTO(objBasicInfoCoreEntity, objBasicInfo); objBasicInfoCoreEntityList.Add(objBasicInfoCoreEntity); } objBasicInfoCoreEntity = null; } } } } } objIUnitOfWork = null; foreach (BasicInfoCoreEntity objBasicInfoCoreEntity in objBasicInfoCoreEntityList) { ProfileCore objProfileCore = null; GetByProfileID(objBasicInfoCoreEntity.ProfileID, out objProfileCore); objProfileCoreList.Add(objProfileCore); using (objProfileCore as IDisposable) { } objProfileCore = null; } } objBasicInfoCore = null; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return 0; }
/// <summary> /// Creates a new row in all profile registration table for the passed profileID /// </summary> /// <param name="strProfileID">New ProfileID to create in all registration tables</param> /// <returns></returns> public int Add(ref BasicInfoCoreEntity objBasicInfoCoreEntity, out string strProfileID, Mugurtham.Core.Login.LoggedInUser objLoggedIn) { strProfileID = string.Empty; string strUserID = string.Empty; SangamCore objSangamCore = new SangamCore(); try { using (objSangamCore as IDisposable) { objSangamCore.GetNewProfileID(out strProfileID, objLoggedIn); Mugurtham.Core.Sangam.SangamCoreEntity objSangamCoreEntity = new SangamCoreEntity(); using (objSangamCoreEntity as IDisposable) { objSangamCoreEntity = objSangamCore.GetByID(objLoggedIn.sangamID); if (string.IsNullOrEmpty(objSangamCoreEntity.LastProfileIDNo.ToString())) return -1; objSangamCoreEntity.LastProfileIDNo += 1; objSangamCore.Edit(ref objSangamCoreEntity); } objSangamCoreEntity = null; } objSangamCore = null; User.UserCore objUserCore = new User.UserCore(); using (objUserCore as IDisposable) { User.UserCoreEntity objUserCoreEntity = new User.UserCoreEntity(); using (objUserCoreEntity as IDisposable) { objUserCoreEntity.ID = Helpers.primaryKey; objUserCoreEntity.Name = objBasicInfoCoreEntity.Name; objUserCoreEntity.LoginID = strProfileID; objUserCoreEntity.Password = strProfileID; // Helpers.passwordGenerator(); objUserCoreEntity.SangamID = objLoggedIn.sangamID; objUserCoreEntity.RoleID = Constants.RoleIDForUserProfile; objUserCoreEntity.ThemeID = Constants.ThemeBootstrap; objUserCoreEntity.LocaleID = Constants.LocaleUSEnglish; objUserCoreEntity.IsActivated = "1"; // Activated by default objUserCoreEntity.HomePagePath = Constants.HomePagePathForProfileUser; objUserCore.Add(ref objUserCoreEntity, out strUserID); } objUserCoreEntity = null; } objUserCore = null; BasicInfoCore objBasicInfoCore = new BasicInfoCore(); using (objBasicInfoCore as IDisposable) { objBasicInfoCoreEntity.ProfileID = strProfileID; objBasicInfoCoreEntity.ElanUserID = strUserID; objBasicInfoCoreEntity.SangamID = objLoggedIn.sangamID; objBasicInfoCore.Add(ref objBasicInfoCoreEntity, objLoggedIn.LoginID); } objBasicInfoCore = null; CareerCore objCareerCore = new CareerCore(); using (objCareerCore as IDisposable) { CareerCoreEntity objCareerCoreEntity = new CareerCoreEntity(); using (objCareerCoreEntity as IDisposable) { objCareerCoreEntity.ProfileID = strProfileID; objCareerCore.Add(ref objCareerCoreEntity); } objCareerCoreEntity = null; } objCareerCore = null; ContactCore objContactCore = new ContactCore(); using (objContactCore as IDisposable) { ContactCoreEntity objContactCoreEntity = new ContactCoreEntity(); using (objContactCoreEntity as IDisposable) { objContactCoreEntity.ProfileID = strProfileID; objContactCore.Add(ref objContactCoreEntity); } objContactCoreEntity = null; } objContactCore = null; FamilyCore objFamilyCore = new FamilyCore(); using (objFamilyCore as IDisposable) { FamilyCoreEntity objFamilyCoreEntity = new FamilyCoreEntity(); using (objFamilyCoreEntity as IDisposable) { objFamilyCoreEntity.ProfileID = strProfileID; objFamilyCore.Add(ref objFamilyCoreEntity); } objFamilyCoreEntity = null; } objFamilyCore = null; LocationCore objLocationCore = new LocationCore(); using (objLocationCore as IDisposable) { LocationCoreEntity objLocationCoreEntity = new LocationCoreEntity(); using (objLocationCoreEntity as IDisposable) { objLocationCoreEntity.ProfileID = strProfileID; objLocationCore.Add(ref objLocationCoreEntity); } objLocationCoreEntity = null; } objLocationCore = null; ReferenceCore objReferenceCore = new ReferenceCore(); using (objReferenceCore as IDisposable) { ReferenceCoreEntity objReferenceCoreEntity = new ReferenceCoreEntity(); using (objReferenceCoreEntity as IDisposable) { objReferenceCoreEntity.ProfileID = strProfileID; objReferenceCore.Add(ref objReferenceCoreEntity); } objReferenceCoreEntity = null; } objReferenceCore = null; RaasiCore objRaasiCore = new RaasiCore(); using (objRaasiCore as IDisposable) { RaasiCoreEntity objRaasiCoreEntity = new RaasiCoreEntity(); using (objRaasiCoreEntity as IDisposable) { objRaasiCoreEntity.ProfileID = strProfileID; objRaasiCore.Add(ref objRaasiCoreEntity); } objRaasiCoreEntity = null; } objRaasiCore = null; AmsamCore objAmsamCore = new AmsamCore(); using (objAmsamCore as IDisposable) { AmsamCoreEntity objAmsamCoreEntity = new AmsamCoreEntity(); using (objAmsamCoreEntity as IDisposable) { objAmsamCoreEntity.ProfileID = strProfileID; objAmsamCore.Add(ref objAmsamCoreEntity); } objAmsamCoreEntity = null; } objAmsamCore = null; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return 0; }
public BasicInfoCoreEntity GetByProfileID(string strProfileID) { BasicInfoCoreEntity objBasicInfoCoreEntity = new BasicInfoCoreEntity(); try { Mugurtham.DTO.Profile.BasicInfo objBasicInfo = new Mugurtham.DTO.Profile.BasicInfo(); IUnitOfWork objUOW = new UnitOfWork(); using (objUOW as IDisposable) objBasicInfo = objUOW.RepositoryBasicInfo.GetAll().ToList().Where(p => p.ProfileID.Trim().ToLower() == strProfileID.Trim().ToLower()).FirstOrDefault(); objUOW = null; if (objBasicInfo != null) { using (objBasicInfo as IDisposable) { AssignEntityFromDTO(objBasicInfoCoreEntity, objBasicInfo); } } objBasicInfo = null; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return objBasicInfoCoreEntity; }
public List<BasicInfoCoreEntity> GetAllBySangam(string strSangamID) { List<BasicInfoCoreEntity> objListBasicInfoCoreEntity = new List<BasicInfoCoreEntity>(); try { List<Mugurtham.DTO.Profile.BasicInfo> objListBasicInfo = new List<Mugurtham.DTO.Profile.BasicInfo>(); IUnitOfWork objUOW = new UnitOfWork(); using (objUOW as IDisposable) objListBasicInfo = objUOW.RepositoryBasicInfo.GetAll().ToList().Where(p => p.SangamID == strSangamID).ToList(); objUOW = null; if (objListBasicInfo != null && objListBasicInfo.Count > 0) { foreach (Mugurtham.DTO.Profile.BasicInfo objBasicInfo in objListBasicInfo) { using (objBasicInfo as IDisposable) { BasicInfoCoreEntity objBasicInfoCoreEntity = new BasicInfoCoreEntity(); AssignEntityFromDTO(objBasicInfoCoreEntity, objBasicInfo); objListBasicInfoCoreEntity.Add(objBasicInfoCoreEntity); objBasicInfoCoreEntity = null; } } } } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return objListBasicInfoCoreEntity; }