public ActionResult Add([System.Web.Http.FromBody] Mugurtham.Core.BasicInfo.BasicInfoCoreEntity objBasicInfoCoreEntity) { Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"]; string strProfileID = string.Empty; Mugurtham.Core.Profile.API.ProfileCore objProfileCore = new Mugurtham.Core.Profile.API.ProfileCore(ref objLoggedIn); using (objProfileCore as IDisposable) { objProfileCore.Add(ref objBasicInfoCoreEntity, out strProfileID, objLoggedIn); } objProfileCore = null; return(this.Json(strProfileID, JsonRequestBehavior.AllowGet)); }
public int Add(ref Mugurtham.Core.BasicInfo.BasicInfoCoreEntity objBasicInfoCoreEntity, string LoggedInUserID) { try { bool GrantAddAccess = false; //One & Only Sangam Admin, Mugurtham Admin can add New Profiles. //So validate if the user is in SangamAdmin, MugurthamAdmin Role and the proceed Profile.ProfileSecurity objProfileSecurity = new Profile.ProfileSecurity(ref _objLoggedInUser); using (objProfileSecurity as IDisposable) { if (objProfileSecurity.IsSangamAdmin(LoggedInUserID)) { GrantAddAccess = true; } objProfileSecurity = null; } if (GrantAddAccess) { IUnitOfWork objIUnitOfWork = new UnitOfWork(_objLoggedInUser.ConnectionStringAppKey); 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); }
public int Edit(ref Mugurtham.Core.BasicInfo.BasicInfoCoreEntity objBasicInfoCoreEntity, string LoggedInUserID) { Profile.ProfileSecurity objProfileSecurity = new Profile.ProfileSecurity(ref _objLoggedInUser); using (objProfileSecurity as IDisposable) { if (!string.IsNullOrEmpty(LoggedInUserID)) { //MugurthamUserToken - If null - hacker is trying to hack the system so redirect to unauthorized page if (!objProfileSecurity.validateProfileViewAccess(objBasicInfoCoreEntity.ProfileID, LoggedInUserID)) { objBasicInfoCoreEntity.ProfileID = LoggedInUserID; } } } objProfileSecurity = null; Edit(ref objBasicInfoCoreEntity); return(0); }
public int Edit(ref Mugurtham.Core.BasicInfo.BasicInfoCoreEntity objBasicInfoCoreEntity) { try { IUnitOfWork objIUnitOfWork = new UnitOfWork(_objLoggedInUser.ConnectionStringAppKey); using (objIUnitOfWork as IDisposable) { Mugurtham.DTO.Profile.BasicInfo objDTOBasicInfo = new DTO.Profile.BasicInfo(); using (objDTOBasicInfo as IDisposable) { AssignDTOFromEntity(ref objDTOBasicInfo, ref objBasicInfoCoreEntity); } objIUnitOfWork.RepositoryBasicInfo.Edit(objDTOBasicInfo); objDTOBasicInfo = null; } objIUnitOfWork.commit(); objIUnitOfWork = null; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return(0); }
private int AssignDTOFromEntity(ref Mugurtham.DTO.Profile.BasicInfo objBasicInfo, ref Mugurtham.Core.BasicInfo.BasicInfoCoreEntity objBasicInfoCoreEntity) { try { objBasicInfo.ProfileID = objBasicInfoCoreEntity.ProfileID; objBasicInfo.SangamProfileID = objBasicInfoCoreEntity.SangamProfileID; objBasicInfo.AboutMe = objBasicInfoCoreEntity.AboutMe; objBasicInfo.Age = objBasicInfoCoreEntity.Age; objBasicInfo.AnyDosham = objBasicInfoCoreEntity.AnyDhosham; objBasicInfo.BloodGroup = objBasicInfoCoreEntity.BloodGroup; objBasicInfo.BodyType = objBasicInfoCoreEntity.BodyType; objBasicInfo.Caste = objBasicInfoCoreEntity.Caste; objBasicInfo.ChildrenLivingStatus = objBasicInfoCoreEntity.ChildrenLivingStatus; objBasicInfo.Complexion = objBasicInfoCoreEntity.Complexion; objBasicInfo.CreatedBy = objBasicInfoCoreEntity.ProfileCreator; objBasicInfo.CreatedDate = objBasicInfoCoreEntity.CreatedDate; objBasicInfo.DateOfBirth = objBasicInfoCoreEntity.DOB; objBasicInfo.Drinking = objBasicInfoCoreEntity.Drinking; objBasicInfo.Eating = objBasicInfoCoreEntity.Eating; objBasicInfo.ElanUserID = objBasicInfoCoreEntity.ElanUserID; //ElanProfileID objBasicInfo.Gender = objBasicInfoCoreEntity.Gender; objBasicInfo.Gothram = objBasicInfoCoreEntity.Gothram; objBasicInfo.Height = objBasicInfoCoreEntity.Height; objBasicInfo.HoroscopeMatch = objBasicInfoCoreEntity.HoroscopeMatch; objBasicInfo.MaritalStatus = objBasicInfoCoreEntity.MaritalStatus; objBasicInfo.ModifiedBy = objBasicInfoCoreEntity.ModifiedBy; objBasicInfo.ModifiedDate = DateTime.Now; objBasicInfo.MotherTongue = objBasicInfoCoreEntity.MotherTongue; objBasicInfo.Name = objBasicInfoCoreEntity.Name; objBasicInfo.NoOfChildren = objBasicInfoCoreEntity.NoOfChildren; objBasicInfo.PartnerExpectations = objBasicInfoCoreEntity.PartnerExpectation; objBasicInfo.PhysicalStatus = objBasicInfoCoreEntity.PhysicalStatus; objBasicInfo.PlaceOfBirth = objBasicInfoCoreEntity.PlaceOfBirth; objBasicInfo.ProfileCreatedBy = objBasicInfoCoreEntity.ProfileCreatedBy; objBasicInfo.Raasi = objBasicInfoCoreEntity.Raasi; objBasicInfo.Religion = objBasicInfoCoreEntity.Religion; objBasicInfo.SangamID = objBasicInfoCoreEntity.SangamID; objBasicInfo.Smoking = objBasicInfoCoreEntity.Smoking; objBasicInfo.Star = objBasicInfoCoreEntity.Star; objBasicInfo.SubCaste = objBasicInfoCoreEntity.SubCaste; objBasicInfo.TamilDOB = objBasicInfoCoreEntity.TamilDOB; objBasicInfo.TimeOfBirth = objBasicInfoCoreEntity.TOB; objBasicInfo.Weight = objBasicInfoCoreEntity.Weight; objBasicInfo.Zodiac = objBasicInfoCoreEntity.Zodiac; objBasicInfo.ZodiacDay = objBasicInfoCoreEntity.ZodiacDay; objBasicInfo.ZodiacMonth = objBasicInfoCoreEntity.ZodiacMonth; objBasicInfo.ZodiacDay = objBasicInfoCoreEntity.ZodiacYear; objBasicInfo.PhotoPath = objBasicInfoCoreEntity.PhotoPath; objBasicInfo.Paadham = objBasicInfoCoreEntity.Paadham; objBasicInfo.CreatedBy = objBasicInfoCoreEntity.ProfileCreator; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return(0); }