public ContactCoreEntity GetByProfileID(string strProfileID) { ContactCoreEntity objContactCoreEntity = new ContactCoreEntity(); try { Mugurtham.DTO.Profile.Contact objContact = new Mugurtham.DTO.Profile.Contact(); IUnitOfWork objUOW = new UnitOfWork(); using (objUOW as IDisposable) objContact = objUOW.RepositoryContact.GetAll().ToList().Where(p => p.ProfileID.Trim().ToLower() == strProfileID.Trim().ToLower()).FirstOrDefault(); objUOW = null; if (objContact != null) { using (objContact as IDisposable) { AssignEntityFromCore(ref objContact, ref objContactCoreEntity); } } objContact = null; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return objContactCoreEntity; }
private ContactCoreEntity GetByProfileID(string strProfileID) { ContactCoreEntity objContactCoreEntity = new ContactCoreEntity(); try { Mugurtham.DTO.Profile.Contact objContact = new Mugurtham.DTO.Profile.Contact(); IUnitOfWork objUOW = new UnitOfWork(_objLoggedInUser.ConnectionStringAppKey); using (objUOW as IDisposable) objContact = objUOW.RepositoryContact.GetAll().ToList().Where(p => p.ProfileID.Trim().ToLower() == strProfileID.Trim().ToLower()).FirstOrDefault(); objUOW = null; if (objContact != null) { using (objContact as IDisposable) { AssignEntityFromCore(ref objContact, ref objContactCoreEntity); } } objContact = null; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return(objContactCoreEntity); }
/// <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; }