Beispiel #1
0
 public int AssignEntityFromDTO(ref Mugurtham.DTO.Profile.Raasi objDTORaasi, ref Mugurtham.Core.Raasi.RaasiCoreEntity objRaasiCoreEntity)
 {
     try
     {
         objRaasiCoreEntity.CreatedBy = objDTORaasi.CreatedBy;
         objRaasiCoreEntity.Kattam1 = objDTORaasi.Kattam1;
         objRaasiCoreEntity.Kattam2 = objDTORaasi.Kattam2;
         objRaasiCoreEntity.Kattam3 = objDTORaasi.Kattam3;
         objRaasiCoreEntity.Kattam4 = objDTORaasi.Kattam4;
         objRaasiCoreEntity.Kattam5 = objDTORaasi.Kattam5;
         objRaasiCoreEntity.Kattam6 = objDTORaasi.Kattam6;
         objRaasiCoreEntity.Kattam7 = objDTORaasi.Kattam7;
         objRaasiCoreEntity.Kattam8 = objDTORaasi.Kattam8;
         objRaasiCoreEntity.Kattam9 = objDTORaasi.Kattam9;
         objRaasiCoreEntity.Kattam10 = objDTORaasi.Kattam10;
         objRaasiCoreEntity.Kattam11 = objDTORaasi.Kattam11;
         objRaasiCoreEntity.Kattam12 = objDTORaasi.Kattam12;
         objRaasiCoreEntity.CreatedDate = DateTime.Now;
         objRaasiCoreEntity.ModifiedDate = DateTime.Now;
         objRaasiCoreEntity.ProfileID = objDTORaasi.ProfileID;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #2
0
 public int Add(ref Mugurtham.Core.Profile.Photo.PhotoCoreEntity objPhotoCoreEntity)
 {
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.Profile.Photo objDTOPhoto = new DTO.Profile.Photo();
             using (objDTOPhoto as IDisposable)
             {
                 objDTOPhoto.ID = Helpers.primaryKey;
                 AssignDTOFromEntity(ref objDTOPhoto, ref objPhotoCoreEntity);
             }
             objIUnitOfWork.RepositoryPhoto.Add(objDTOPhoto);
             objDTOPhoto = null;
         }
         objIUnitOfWork.commit();
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #3
0
 public int Add(ref Mugurtham.Core.Role.RoleCoreEntity objRoleCoreEntity, out string strRoleID)
 {
     strRoleID = Helpers.primaryKey;
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.Role.Role objDTORole = new DTO.Role.Role();
             using (objDTORole as IDisposable)
             {
                 objRoleCoreEntity.ID = strRoleID;
                 AssignDTOFromEntity(ref objDTORole, ref objRoleCoreEntity);
             }
             objIUnitOfWork.RepositoryRole.Add(objDTORole);
             objDTORole = null;
         }
         objIUnitOfWork.commit();
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #4
0
 public int Add(ref Mugurtham.Core.User.UserCoreEntity objUserCoreEntity, out string strUserID)
 {
     strUserID = Helpers.primaryKey;
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.User.User objDTOUser = new DTO.User.User();
             using (objDTOUser as IDisposable)
             {
                 objUserCoreEntity.ID = strUserID;
                 assignHomePagePath(ref objUserCoreEntity);
                 AssignDTOFromEntity(ref objDTOUser, ref objUserCoreEntity);
             }
             objIUnitOfWork.RepositoryUser.Add(objDTOUser);
             objDTOUser = null;
         }
         objIUnitOfWork.commit();
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #5
0
 public int Add(ref Mugurtham.Core.Sangam.SangamCoreEntity objSangamCoreEntity, out string strSangamID)
 {
     strSangamID = Helpers.primaryKey;
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.Sangam.Sangam objDTOSangam = new DTO.Sangam.Sangam();
             using (objDTOSangam as IDisposable)
             {
                 objSangamCoreEntity.ID = strSangamID;
                 objSangamCoreEntity.RunningNoStartsFrom = 1000;
                 objSangamCoreEntity.LastProfileIDNo = 1000;
                 AssignDTOFromEntity(ref objDTOSangam, ref objSangamCoreEntity);
             }
             objIUnitOfWork.RepositorySangam.Add(objDTOSangam);
             objDTOSangam = null;
         }
         objIUnitOfWork.commit();
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #6
0
 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;
 }
Beispiel #7
0
 public int Add(ref Mugurtham.Core.ProfileViewed.ProfileViewedCoreEntity objProfileViewedCoreEntity)
 {
     try
     {
         string strMappingID = string.Empty;
         string strViewerID = objProfileViewedCoreEntity.ViewerID;
         string strViewedID = objProfileViewedCoreEntity.ViewedID;
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.ProfileViewed.ProfileViewed objDTOProfileViewed = new DTO.ProfileViewed.ProfileViewed();
             using (objDTOProfileViewed as IDisposable)
             {
                 objDTOProfileViewed.ID = Helpers.primaryKey;
                 objDTOProfileViewed.ViewerID = objProfileViewedCoreEntity.ViewerID;
                 objDTOProfileViewed.ViewedID = objProfileViewedCoreEntity.ViewedID;
             }
             List<Mugurtham.DTO.ProfileViewed.ProfileViewed> objProfileViewed = new List<DTO.ProfileViewed.ProfileViewed>();
             using (objProfileViewed as IDisposable)
             {
                 objProfileViewed = objIUnitOfWork.RepositoryProfileViewed.GetAll().ToList().
                 Where(p => p.ViewerID.Trim().ToLower() == strViewerID.Trim().ToLower() &&
                       p.ViewedID.Trim().ToLower() == strViewedID.Trim().ToLower()).ToList();
                 foreach (DTO.ProfileViewed.ProfileViewed objProfiles in objProfileViewed)
                 {
                     strMappingID = objProfiles.ID;
                 }
             }
             if (objProfileViewed.Count == 0)
             {
                 IUnitOfWork objIUnitOfWorkAdd = new UnitOfWork();
                 using (objIUnitOfWorkAdd as IDisposable)
                 {
                     objIUnitOfWorkAdd.RepositoryProfileViewed.Add(objDTOProfileViewed);
                     objIUnitOfWorkAdd.commit();
                     objDTOProfileViewed = null;
                 }
                 objIUnitOfWorkAdd = null;
             }
         }
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #8
0
 public int Add(ref Mugurtham.Core.BasicInfo.BasicInfoCoreEntity objBasicInfoCoreEntity, string LoggedInUserID)
 {
     try
     {
         bool GrantAddAccess = false;
         //One & Only Sangam Admin can add New Profiles.
         //So validate if the user is in SangamAdmin Role and the proceed
         Profile.ProfileSecurity objProfileSecurity = new Profile.ProfileSecurity();
         using (objProfileSecurity as IDisposable)
         {
             if (objProfileSecurity.IsSangamAdmin(LoggedInUserID))
             {
                 GrantAddAccess = true;
             }
             objProfileSecurity = null;
         }
         if (GrantAddAccess)
         {
             IUnitOfWork objIUnitOfWork = new UnitOfWork();
             using (objIUnitOfWork as IDisposable)
             {
                 Mugurtham.DTO.Profile.BasicInfo objDTOBasicInfo = new DTO.Profile.BasicInfo();
                 using (objDTOBasicInfo as IDisposable)
                 {
                     AssignDTOFromEntity(ref objDTOBasicInfo, ref objBasicInfoCoreEntity);
                     objDTOBasicInfo.CreatedDate = DateTime.Now;
                 }
                 objIUnitOfWork.RepositoryBasicInfo.Add(objDTOBasicInfo);
                 objDTOBasicInfo = null;
             }
             objIUnitOfWork.commit();
             objIUnitOfWork = null;
             return 0;
         }
         else
         {
             return -1;
         }
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #9
0
 public int Add(ref Mugurtham.Core.Family.FamilyCoreEntity objFamilyCoreEntity)
 {
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.Profile.Family objDTOFamily = new DTO.Profile.Family();
             using (objDTOFamily as IDisposable)
             {
                 AssignDTOFromEntity(ref objDTOFamily, ref objFamilyCoreEntity);
             }
             objIUnitOfWork.RepositoryFamily.Add(objDTOFamily);
             objDTOFamily = null;
         }
         objIUnitOfWork.commit();
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #10
0
 public int Edit(ref Mugurtham.Core.Role.RoleCoreEntity objRoleCoreEntity)
 {
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.Role.Role objDTORole = new DTO.Role.Role();
             using (objDTORole as IDisposable)
             {
                 AssignDTOFromEntity(ref objDTORole, ref objRoleCoreEntity);
             }
             objIUnitOfWork.RepositoryRole.Edit(objDTORole);
             objDTORole = null;
         }
         objIUnitOfWork.commit();
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #11
0
 public int Add(ref Mugurtham.Core.Raasi.RaasiCoreEntity objRaasiCoreEntity)
 {
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.Profile.Raasi objDTORaasi = new DTO.Profile.Raasi();
             using (objDTORaasi as IDisposable)
             {
                 AssignDTOFromEntity(ref objDTORaasi, ref objRaasiCoreEntity);
             }
             objIUnitOfWork.RepositoryRaasi.Add(objDTORaasi);
             objDTORaasi = null;
         }
         objIUnitOfWork.commit();
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #12
0
 public int Edit(ref Mugurtham.Core.Contact.ContactCoreEntity objContactCoreEntity)
 {
     IUnitOfWork objIUnitOfWork = new UnitOfWork();
     try
     {
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.Profile.Contact objDTOContact = new DTO.Profile.Contact();
             using (objDTOContact as IDisposable)
             {
                 AssignDTOFromEntity(ref objDTOContact, ref objContactCoreEntity);
             }
             objIUnitOfWork.RepositoryContact.Edit(objDTOContact);
             objDTOContact = null;
         }
         objIUnitOfWork.commit();
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #13
0
 public int Edit(ref Mugurtham.Core.Sangam.SangamCoreEntity objSangamCoreEntity)
 {
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.Sangam.Sangam objDTOSangam = new DTO.Sangam.Sangam();
             using (objDTOSangam as IDisposable)
             {
                 AssignDTOFromEntity(ref objDTOSangam, ref objSangamCoreEntity);
             }
             objIUnitOfWork.RepositorySangam.Edit(objDTOSangam);
             objDTOSangam = null;
         }
         objIUnitOfWork.commit();
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #14
0
 public int Edit(ref Mugurtham.Core.Career.CareerCoreEntity objCareerCoreEntity)
 {
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.Profile.Career objDTOCareer = new DTO.Profile.Career();
             using (objDTOCareer as IDisposable)
             {
                 AssignDTOFromEntity(ref objDTOCareer, ref objCareerCoreEntity);
             }
             objIUnitOfWork.RepositoryCareer.Edit(objDTOCareer);
             objDTOCareer = null;
         }
         objIUnitOfWork.commit();
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #15
0
 public int Edit(ref Mugurtham.Core.Location.LocationCoreEntity objLocationCoreEntity)
 {
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.Profile.Location objDTOLocation = new DTO.Profile.Location();
             using (objDTOLocation as IDisposable)
             {
                 AssignDTOFromEntity(ref objDTOLocation, ref objLocationCoreEntity);
             }
             objIUnitOfWork.RepositoryLocation.Edit(objDTOLocation);
             objDTOLocation = null;
         }
         objIUnitOfWork.commit();
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #16
0
 private int AssignEntityFromDTO(ref Mugurtham.DTO.User.User objDTOUser, ref Mugurtham.Core.User.UserCoreEntity objUserCoreEntity)
 {
     try
     {
         objUserCoreEntity.CreatedBy = objDTOUser.CreatedBy;
         objUserCoreEntity.CreatedDate = DateTime.Now;
         objUserCoreEntity.ID = objDTOUser.ID;
         objUserCoreEntity.LoginID = objDTOUser.LoginID;
         objUserCoreEntity.Password = objDTOUser.Password;
         objUserCoreEntity.IsActivated = objDTOUser.IsActivated;
         objUserCoreEntity.LocaleID = objDTOUser.LocaleID;
         objUserCoreEntity.ModifiedBy = objDTOUser.ModifiedBy;
         objUserCoreEntity.ModifiedDate = DateTime.Now;
         objUserCoreEntity.Name = objDTOUser.Name;
         objUserCoreEntity.RoleID = objDTOUser.RoleID;
         objUserCoreEntity.SangamID = objDTOUser.SangamID;
         objUserCoreEntity.ThemeID = objDTOUser.ThemeID;
         objUserCoreEntity.HomePagePath = objDTOUser.HomePagePath;
         objUserCoreEntity.IsHighlighted = objDTOUser.IsHighlighted;
         objUserCoreEntity.ShowHoroscope = objDTOUser.ShowHoroscope;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #17
0
        /*========================================================================================================*/
        /*BUSINESS FUNCTIONS - APART CRUD*/
        /*========================================================================================================*/
        public int validateLogin(ref Mugurtham.Core.User.UserCoreEntity objUserCoreEntity, out bool boolLogin)
        {
            /*
             1 -> Success
             2 -> Invalid User
             3 -> Invalid Password
             4 -> DeActivated Sangam
             5 -> DeActivated Profile
             */
            int intLoginStatus = 0;
            boolLogin = false;

            try
            {
                Mugurtham.Core.User.UserCoreEntity _objUserCoreEntity = null;
                _objUserCoreEntity = GetByLoginID(objUserCoreEntity.LoginID);
                if (_objUserCoreEntity.LoginID == null)
                {
                    intLoginStatus = 2;
                    objUserCoreEntity.LoginStatus = "2";
                    return intLoginStatus;
                }
                // Validate if Sangam is activated
                Sangam.SangamCore objSangamCore = new Sangam.SangamCore();
                using (objSangamCore as IDisposable)
                {
                    Sangam.SangamCoreEntity objSangamCoreEntity = new Sangam.SangamCoreEntity();
                    using (objSangamCoreEntity as IDisposable)
                    {
                        objSangamCoreEntity = objSangamCore.GetByID(_objUserCoreEntity.SangamID);
                        if (objSangamCoreEntity.IsActivated == "0")
                        {
                            intLoginStatus = 4;
                            objUserCoreEntity.LoginStatus = "4";
                        }
                    }
                    objSangamCoreEntity = null;
                }
                objSangamCore = null;
                if (intLoginStatus == 4)
                    return intLoginStatus;
                // Validate if User is activated
                if (_objUserCoreEntity.IsActivated == "0")
                {
                    intLoginStatus = 5;
                    objUserCoreEntity.LoginStatus = "5";
                    return intLoginStatus;
                }
                //Validate if loginid and password matches
                if (_objUserCoreEntity.Password.Trim() == Helpers.EncodePasswordToBase64(objUserCoreEntity.Password.Trim()))
                {
                    intLoginStatus = 1;
                    _objUserCoreEntity.LoginStatus = "1";
                    objUserCoreEntity = _objUserCoreEntity;
                    boolLogin = true;
                }
                else
                {
                    intLoginStatus = 3;
                    objUserCoreEntity.LoginStatus = "3";
                }
            }
            catch (Exception objEx)
            {
                Helpers.LogExceptionInFlatFile(objEx);
            }
            return intLoginStatus;
        }
Beispiel #18
0
 private int AssignEntityFromCore(ref Mugurtham.DTO.Profile.Contact objDTOContact, ref Mugurtham.Core.Contact.ContactCoreEntity objContactCoreEntity)
 {
     try
     {
         objContactCoreEntity.Name = objDTOContact.Name;
         objContactCoreEntity.ResidentialAddress = objDTOContact.Address;
         objContactCoreEntity.TimeToCall = objDTOContact.ConvinientTimeToCall;
         objContactCoreEntity.Email = objDTOContact.EMail;
         objContactCoreEntity.LandlineNumber = objDTOContact.LandLineNumber;
         objContactCoreEntity.MobileNumber = objDTOContact.MobileNumber;
         objContactCoreEntity.Relationship = objDTOContact.RelationShipWithMember;
         objContactCoreEntity.ProfileID = objDTOContact.ProfileID;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
 private int AssignDTOFromEntity(ref Mugurtham.DTO.ProfileInterested.ProfileInterested objDTOProfileInterested, ref Mugurtham.Core.ProfileInterested.ProfileInterestedCoreEntity objProfileInterestedCoreEntity)
 {
     try
     {
         objDTOProfileInterested.ViewerID = objProfileInterestedCoreEntity.ViewerID;
         objDTOProfileInterested.InterestedInID = objProfileInterestedCoreEntity.InterestedInID;
         objDTOProfileInterested.InterestedDate = DateTime.Now;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #20
0
 private int AssignDTOFromEntity(ref Mugurtham.DTO.Profile.Photo objPhoto, ref Mugurtham.Core.Profile.Photo.PhotoCoreEntity objPhotoCoreEntity)
 {
     try
     {
         objPhoto.ProfileID = objPhotoCoreEntity.ProfileID;
         objPhoto.PhotoPath = objPhotoCoreEntity.PhotoPath;
         objPhoto.IsProfilePic = objPhotoCoreEntity.IsProfilePic;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
        public int GetInterestedProfiles(string strConnectionString, string strGender,
            string strInterestedProfileID, string strSangamID,
           ref ProfileBasicViewEntity objProfileBasicViewEntity,
           ref Mugurtham.Core.Login.LoggedInUser objLoggedIn)
        {
            List<PhotoCoreEntity> objPhotoCoreEntityList = new List<PhotoCoreEntity>();
            List<ProfileBasicInfoViewCoreEntity> objProfileBasicInfoViewCoreEntityList = new List<ProfileBasicInfoViewCoreEntity>();
            try
            {
                if (objLoggedIn.roleID == Constants.RoleIDForUserProfile) // User Profiles
                {
                    if (!string.IsNullOrWhiteSpace(objLoggedIn.BasicInfoCoreEntity.Gender))
                    {
                        if (objLoggedIn.BasicInfoCoreEntity.Gender.ToLower().Trim() == "male".ToLower().Trim())
                            strGender = "female";
                        else
                            strGender = "male";
                    }
                }
                using (SqlConnection objSqlConnection = new SqlConnection(strConnectionString))
                {
                    objSqlConnection.Open();
                    // 1.  create a command object identifying the stored procedure
                    SqlCommand objSqlCommand = new SqlCommand("uspGetInterestedProfiles", objSqlConnection);

                    // 2. set the command object so it knows to execute a stored procedure
                    objSqlCommand.CommandType = CommandType.StoredProcedure;

                    // 3. add parameter to command, which will be passed to the stored procedure
                    objSqlCommand.Parameters.Add(new SqlParameter("@GENDER", strGender));
                    objSqlCommand.Parameters.Add(new SqlParameter("@InterestedID", strInterestedProfileID));
                    objSqlCommand.Parameters.Add(new SqlParameter("@SangamID", strSangamID));
                    // execute the command
                    using (SqlDataReader objSqlDataReader = objSqlCommand.ExecuteReader())
                    {
                        while (objSqlDataReader.Read())
                        {
                            ProfileBasicInfoViewCoreEntity objProfileBasicInfoViewCoreEntity = new ProfileBasicInfoViewCoreEntity();
                            objProfileBasicInfoViewCoreEntity.SangamProfileID = objSqlDataReader["SangamProfileID"].ToString();
                            objProfileBasicInfoViewCoreEntity.MugurthamProfileID = objSqlDataReader["MugurthamProfileID"].ToString();
                            objProfileBasicInfoViewCoreEntity.Name = objSqlDataReader["Name"].ToString();
                            objProfileBasicInfoViewCoreEntity.Gender = objSqlDataReader["Gender"].ToString();
                            objProfileBasicInfoViewCoreEntity.Education = objSqlDataReader["Education"].ToString();
                            objProfileBasicInfoViewCoreEntity.Location = objSqlDataReader["Location"].ToString();
                            objProfileBasicInfoViewCoreEntity.Occupation = objSqlDataReader["Occupation"].ToString();
                            objProfileBasicInfoViewCoreEntity.SangamID = objSqlDataReader["SangamID"].ToString();
                            objProfileBasicInfoViewCoreEntity.SangamName = objSqlDataReader["SangamName"].ToString();
                            objProfileBasicInfoViewCoreEntity.SubCaste = objSqlDataReader["Subcaste"].ToString();
                            objProfileBasicInfoViewCoreEntity.Star = objSqlDataReader["Star"].ToString();
                            objProfileBasicInfoViewCoreEntity.AboutMe = objSqlDataReader["AboutMe"].ToString();
                            if (!string.IsNullOrEmpty(objSqlDataReader["Age"].ToString()))
                                objProfileBasicInfoViewCoreEntity.Age = Convert.ToInt32(objSqlDataReader["Age"].ToString());
                            objProfileBasicInfoViewCoreEntityList.Add(objProfileBasicInfoViewCoreEntity);
                        }
                        if (objSqlDataReader.NextResult())
                        {
                            while (objSqlDataReader.Read())
                            {
                                PhotoCoreEntity objPhotoCoreEntity = new PhotoCoreEntity();
                                using (objPhotoCoreEntity as IDisposable)
                                {
                                    objPhotoCoreEntity.ID = objSqlDataReader["ID"].ToString();
                                    objPhotoCoreEntity.ProfileID = objSqlDataReader["ProfileID"].ToString();
                                    objPhotoCoreEntity.PhotoPath = objSqlDataReader["PhotoPath"].ToString();
                                    objPhotoCoreEntity.IsProfilePic = Convert.ToDecimal(objSqlDataReader["IsProfilePic"].ToString());
                                    objPhotoCoreEntityList.Add(objPhotoCoreEntity);
                                }
                                objPhotoCoreEntity = null;
                            }
                        }
                        objProfileBasicViewEntity.ProfileBasicInfoViewCoreEntityList = objProfileBasicInfoViewCoreEntityList;
                        objProfileBasicViewEntity.PhotoCoreEntityList = objPhotoCoreEntityList;
                        objSqlDataReader.Close();
                    }
                    objSqlCommand.Cancel();
                    objSqlCommand.Dispose();
                    objSqlConnection.Close();
                    objSqlConnection.Dispose();

                }
            }
            catch (Exception objEx)
            {
                Helpers.LogExceptionInFlatFile(objEx);
            }
            return 0;
        }
Beispiel #22
0
 private int AssignDTOFromEntity(ref Mugurtham.DTO.Profile.Reference objDTOReference, ref Mugurtham.Core.Reference.ReferenceCoreEntity objReferenceCoreEntity)
 {
     try
     {
         objDTOReference.ContactNo = objReferenceCoreEntity.ContactNo;
         objDTOReference.NomineeName = objReferenceCoreEntity.NomineeName;
         objDTOReference.CreatedDate = DateTime.Now;
         objDTOReference.ModifiedDate = DateTime.Now;
         objDTOReference.ProfileID = objReferenceCoreEntity.ProfileID;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #23
0
 private int AssignDTOFromEntity(ref Mugurtham.DTO.Profile.Family objDTOFamily, ref Mugurtham.Core.Family.FamilyCoreEntity objFamilyCoreEntity)
 {
     try
     {
         objDTOFamily.AboutFamily = objFamilyCoreEntity.AboutFamily;
         objDTOFamily.BrothersMarried = objFamilyCoreEntity.MarriedBrothers;
         objDTOFamily.FamilType = objFamilyCoreEntity.FamilType;
         objDTOFamily.FamilyOrigin = objFamilyCoreEntity.FamilyOrigin;
         objDTOFamily.FamilyStatus = objFamilyCoreEntity.FamilyStatus;
         objDTOFamily.FamilyValue = objFamilyCoreEntity.FamilyValue;
         objDTOFamily.FathersName = objFamilyCoreEntity.FathersName;
         objDTOFamily.FathersOccupation = objFamilyCoreEntity.FathersOccupation;
         objDTOFamily.Mothersname = objFamilyCoreEntity.Mothersname;
         objDTOFamily.MothersOccupation = objFamilyCoreEntity.MothersOccupation;
         objDTOFamily.NoOfBrothers = objFamilyCoreEntity.NoOfBrothers;
         objDTOFamily.NoOfSisters = objFamilyCoreEntity.NoOfSisters;
         objDTOFamily.SistersMarried = objFamilyCoreEntity.MarriedSisters;
         objDTOFamily.CreateDate = DateTime.Now;
         objDTOFamily.ModifiedDate = DateTime.Now;
         objDTOFamily.ProfileID = objFamilyCoreEntity.ProfileID;
         objDTOFamily.MothersSubSect = objFamilyCoreEntity.MothersSubSect;
         objDTOFamily.ParentsAlive = objFamilyCoreEntity.ParentsAlive;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #24
0
 private int AssignEntityFromDTO(ref Mugurtham.DTO.Role.Role objDTORole, ref Mugurtham.Core.Role.RoleCoreEntity objRoleCoreEntity)
 {
     try
     {
         objRoleCoreEntity.CreatedBy = objDTORole.CreatedBy;
         objRoleCoreEntity.CreatedDate = DateTime.Now;
         objRoleCoreEntity.Description = objDTORole.Description;
         objRoleCoreEntity.ID = objDTORole.ID;
         objRoleCoreEntity.ModifiedBy = objDTORole.ModifiedBy;
         objRoleCoreEntity.ModifiedDate = DateTime.Now;
         objRoleCoreEntity.Name = objDTORole.Name;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #25
0
 private int AssignEntityFromDTO(ref CareerCoreEntity objCareerCoreEntity, Mugurtham.DTO.Profile.Career objCareer)
 {
     try
     {
         objCareerCoreEntity.AnnualIncome = objCareer.Income;
         objCareerCoreEntity.Education = objCareer.Education;
         objCareerCoreEntity.EducationInDetail = objCareer.EducationInDetail;
         objCareerCoreEntity.EmployedIn = objCareer.EmployedIn;
         objCareerCoreEntity.Occupation = objCareer.Occupation;
         objCareerCoreEntity.OccupationInDetail = objCareer.OccupationInDetail;
         objCareerCoreEntity.ProfileID = objCareer.ProfileID;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
 private int AssignEntityFromDTO(ref ProfileInterestedCoreEntity objProfileInterestedCoreEntity, Mugurtham.DTO.ProfileInterested.ProfileInterested objDTOProfileInterested)
 {
     try
     {
         objProfileInterestedCoreEntity.ID = objDTOProfileInterested.ID;
         objProfileInterestedCoreEntity.ViewerID = objDTOProfileInterested.ViewerID;
         objProfileInterestedCoreEntity.InterestedInID = objDTOProfileInterested.InterestedInID;
         objProfileInterestedCoreEntity.InterestedDate = objDTOProfileInterested.InterestedDate;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #27
0
 private int AssignDTOFromEntity(ref Mugurtham.DTO.Profile.Career objCareer, ref Mugurtham.Core.Career.CareerCoreEntity objCareerCoreEntity)
 {
     try
     {
         objCareer.Education = objCareerCoreEntity.Education;
         objCareer.EducationInDetail = objCareerCoreEntity.EducationInDetail;
         objCareer.EmployedIn = objCareerCoreEntity.EmployedIn;
         objCareer.Income = objCareerCoreEntity.AnnualIncome;
         objCareer.Occupation = objCareerCoreEntity.Occupation;
         objCareer.OccupationInDetail = objCareerCoreEntity.OccupationInDetail;
         objCareer.CreatedDate = DateTime.Now;
         objCareer.ModifiedDate = DateTime.Now;
         objCareer.ProfileID = objCareerCoreEntity.ProfileID;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #28
0
 public int GetNewProfileID(out string strNewProfileID, Mugurtham.Core.Login.LoggedInUser objLoggedIn)
 {
     strNewProfileID = string.Empty;
     try
     {
         if (!string.IsNullOrWhiteSpace(objLoggedIn.sangamID))
         {
             SangamCoreEntity objSangamCoreEntity = new SangamCoreEntity();
             using (objSangamCoreEntity as IDisposable)
             {
                 objSangamCoreEntity = GetByID(objLoggedIn.sangamID);
                 strNewProfileID = objSangamCoreEntity.ProfileIDStartsWith + (objSangamCoreEntity.LastProfileIDNo + 1).ToString();
             }
         }
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #29
0
 private int AssignDTOFromEntity(ref Mugurtham.DTO.Profile.Location objDTOLocation, ref Mugurtham.Core.Location.LocationCoreEntity objLocationCoreEntity)
 {
     try
     {
         objDTOLocation.ProfileID = objLocationCoreEntity.ProfileID;
         objDTOLocation.CitizenShip = objLocationCoreEntity.CitizenShip;
         objDTOLocation.CountryLivingIn = objLocationCoreEntity.CountryLivingIn;
         objDTOLocation.ResidentStatus = objLocationCoreEntity.ResidentStatus;
         objDTOLocation.ResidingCity = objLocationCoreEntity.ResidingCity;
         objDTOLocation.ResidingState = objLocationCoreEntity.ResidingState;
         objDTOLocation.CreatedDate = DateTime.Now;
         objDTOLocation.ModifiedDate = DateTime.Now;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Beispiel #30
0
 private int AssignEntityFromDTO(ref Mugurtham.DTO.Sangam.Sangam objDTOSangam, ref Mugurtham.Core.Sangam.SangamCoreEntity objSangamCoreEntity)
 {
     try
     {
         objSangamCoreEntity.AboutSangam = objDTOSangam.AboutSangam;
         objSangamCoreEntity.Address = objDTOSangam.Address;
         objSangamCoreEntity.ContactNumber = objDTOSangam.ContactNumber;
         objSangamCoreEntity.ID = objDTOSangam.ID;
         objSangamCoreEntity.Name = objDTOSangam.Name;
         objSangamCoreEntity.ProfileIDStartsWith = objDTOSangam.ProfileIDStartsWith;
         objSangamCoreEntity.IsActivated = objDTOSangam.IsActivated;
         objSangamCoreEntity.LogoPath = objDTOSangam.LogoPath;
         objSangamCoreEntity.BannerPath = objDTOSangam.BannerPath;
         objSangamCoreEntity.RunningNoStartsFrom = objDTOSangam.RunningNoStartsFrom;
         objSangamCoreEntity.LastProfileIDNo = objDTOSangam.LastProfileIDNo;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }