public HttpResponseMessage getByProfileID(string ID) { ProfileCore objProfCore = null; if (!string.IsNullOrWhiteSpace(ID)) { string strLoggedInUserID = string.Empty; IEnumerable <string> headerValues = Request.Headers.GetValues("MugurthamUserToken"); strLoggedInUserID = headerValues.FirstOrDefault(); Mugurtham.Core.Login.LoggedInUser objLoggedIn = new Core.Login.LoggedInUser(strLoggedInUserID, Request.Headers.GetValues("CommunityID").FirstOrDefault()); using (objLoggedIn as IDisposable) { // Destroy this objLoggedIn object ProfileCore objProfileCore = new ProfileCore(ref objLoggedIn); using (objProfileCore as IDisposable) objProfileCore.GetByProfileID(ID, out objProfCore, objLoggedIn); objProfileCore = null; } objLoggedIn = null; } return(Request.CreateResponse(HttpStatusCode.OK, objProfCore, Configuration.Formatters.JsonFormatter)); }
public void SearchUrl() { var term = Guid.NewGuid().ToString(); var data = "/search/member?s=" + term + "&c=organic"; Assert.AreEqual <string>(data, ProfileCore.SearchUrl(term)); }
public void BaseUrl() { var key = Guid.NewGuid().ToString(); var data = "/profile/" + key; Assert.AreEqual <string>(data, ProfileCore.BaseUrl(key)); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.ProfileLayout); drawer = new Drawer(this); core = new ProfileCore(this); SetResources(); ServiceGPS.mContext = this; if (Intent.Extras != null) { foreach (var key in Intent.Extras.KeySet()) { if (key != null) { var value = Intent.Extras.GetString(key); Log.Debug(TAG, "Key: {0} Value: {1}", key, value); } } } StartService(new Intent(this, typeof(ServiceGPS))); //StartService(new Intent(this, typeof(MyFirebaseIIDService))); //StartService(new Intent(this, typeof(MyFirebaseMessagingService))); }
public ActionResult getRecentlyViewedProfiles() { string strGender = "admin"; // Mugurtham admin, Sangam admin, public user Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"]; 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"; } } } ProfileCore objProfileCore = new ProfileCore(ref objLoggedIn); ProfileBasicViewEntity objProfileBasicViewEntity = new ProfileBasicViewEntity(); using (objProfileCore as IDisposable) { objProfileCore.GetRecentlyViewedProfiles(Utility.connectionString(), strGender, objLoggedIn.LoginID, objLoggedIn.sangamID, ref objProfileBasicViewEntity, ref objLoggedIn ); } objProfileCore = null; return(this.Json(objProfileBasicViewEntity, JsonRequestBehavior.AllowGet)); }
public override void Execute() { var facebook = new FacebookCore(); var profileCore = new ProfileCore(); var emailCore = new EmailCore(); var profiles = profileCore.Search(null, null, null, true, short.MaxValue, int.MaxValue); foreach (var profile in profiles) { try { var user = profileCore.SearchSingle <ProfileFull>(profile.Identifier, profile.Key, null, true); if (!string.IsNullOrWhiteSpace(user.FacebookAccessToken) && Guid.Empty != user.Identifier) { var emails = facebook.ImportFriends(user); foreach (var email in emails) { emailCore.NewFriend(email); } } Thread.Sleep(500); } catch (Exception ex) { Trace.WriteLine(ex.ToString()); } } }
public ActionResult getProfilePhotos() { Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"]; List <Mugurtham.Core.Profile.Photo.PhotoCoreEntity> objPhotoCoreEntityList = new List <Mugurtham.Core.Profile.Photo.PhotoCoreEntity>(); ProfileCore objProfileCore = new ProfileCore(ref objLoggedIn); using (objProfileCore as IDisposable) objProfileCore.GetProfilePhotos(ref objPhotoCoreEntityList, objLoggedIn.LoginID); objProfileCore = null; return(this.Json(objPhotoCoreEntityList, JsonRequestBehavior.AllowGet)); }
public ActionResult getByProfileID(string ProfileID) { Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"]; ProfileCore objProfileCoreReturn = new ProfileCore(ref objLoggedIn); ProfileCore objProfileCore = new ProfileCore(ref objLoggedIn); using (objProfileCore as IDisposable) { objProfileCore.GetByProfileID(ProfileID, out objProfileCoreReturn, objLoggedIn); } objProfileCore = null; return(this.Json(objProfileCoreReturn, JsonRequestBehavior.AllowGet)); }
public HttpResponseMessage getProfileByProfileID(string ID) { ProfileCore objProfileCoreForView = null; Mugurtham.Core.Login.LoggedInUser objLoggedIn = new Core.Login.LoggedInUser(Request.Headers.GetValues("MugurthamUserToken").FirstOrDefault(), Request.Headers.GetValues("CommunityID").FirstOrDefault()); using (objLoggedIn as IDisposable) { ProfileCore objProfileCore = new ProfileCore(ref objLoggedIn); using (objProfileCore as IDisposable) { objProfileCore.GetByProfileID(ID, out objProfileCoreForView, objLoggedIn); } objProfileCore = null; } objLoggedIn = null; return(Request.CreateResponse(HttpStatusCode.OK, objProfileCoreForView, Configuration.Formatters.JsonFormatter)); }
/// <summary> /// Profile Directory /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Unique(Guid?id, string key = null) { if (!id.HasValue && string.IsNullOrWhiteSpace(key)) { return(RedirectToAction("Index")); } var callerId = User.IdentifierSafe(); var profile = new ProfileMaster() { Display = profileCore.SearchSingle(id, key, callerId), }; if (null != profile.Display) { profile.Display.Badges = badgeCore.Search(profile.Display.Identifier); profile.Display.Activities = activityCore.UserSearch(profile.Display.Identifier); profile.Display.Items = itemCore.Search(profile.Display.Identifier, null, null, short.MaxValue, callerId); profile.ItemRequests = itemRequestCore.Search(profile.Display.Identifier, callerId); profile.Lent = from s in this.borrowCore.Lent(profile.Display.Identifier) where s.Status == BorrowStatus.Returned select s; profile.Borrowed = from s in this.borrowCore.Borrowed(profile.Display.Identifier) where s.Status == BorrowStatus.Returned select s; return(View(profile)); } else if (!string.IsNullOrWhiteSpace(key)) { return(Redirect(ProfileCore.SearchUrl(key, "unknown_key"))); } else { return(RedirectToAction("index")); } }
public static string RelativeSearch(this IReferenceType reference, string query) { switch (reference.Type) { case Reference.ItemRequest: return(ItemRequestCore.SearchUrl(query)); case Reference.Item: return(ItemCore.SearchUrl(query)); case Reference.User: return(ProfileCore.SearchUrl(query)); case Reference.Company: return(CompanyCore.SearchUrl(query)); default: return(null); } }
public static string RelativeLink(this SearchResult result) { switch (result.Type) { case Reference.ItemRequest: return(ItemRequestCore.BaseUrl(result.Key)); case Reference.Item: return(ItemCore.BaseUrl(result.Key)); case Reference.User: return(ProfileCore.BaseUrl(result.Key)); case Reference.Company: return(CompanyCore.BaseUrl(result.Key)); default: throw new InvalidOperationException("unkown type"); } }
public void SearchUrlNull() { var data = "/search/member?s=&c=organic"; Assert.AreEqual <string>(data, ProfileCore.SearchUrl(null)); }
public void BaseUrlNull() { var data = "/profile/"; Assert.AreEqual <string>(data, ProfileCore.BaseUrl(null)); }