public ActionResult UpdatePersonalInformation(ProfileModel Model, FormCollection collection) { UserBM CurrentUser = SessionManager.InstanceCreator.Get<UserBM>(SessionKey.User); if (CurrentUser != null) { string test = collection["hdCommunityName"].ToString(); string test2 = collection["hdSubCommunityName"].ToString(); UserBL UserBL = new UserBL(); CurrentUser.CountryId = Model.UserBM.CountryId; CurrentUser.StateId = Model.UserBM.StateId; CurrentUser.CityId = Model.UserBM.CityId; CurrentUser.CommunityId = Model.UserBM.CommunityId; CurrentUser.SubCommunityId = Model.UserBM.SubCommunityId; if (!string.IsNullOrEmpty(collection["hdCommunityName"].ToString())) CurrentUser.CommunityName = collection["hdCommunityName"].ToString(); if (!string.IsNullOrEmpty(collection["hdSubCommunityName"].ToString())) CurrentUser.SubCommunityName = collection["hdSubCommunityName"].ToString(); UserBL.UpdateUser(CurrentUser); SessionManager.InstanceCreator.Set<UserBM>(CurrentUser, SessionKey.User); TempData["Success"] = "Record saved Successfully."; } else { TempData["Error"] = "Please Login."; } return RedirectToAction("EditProfile"); }
public ActionResult LogOff() { UserBM User = SessionManager.InstanceCreator.Get<UserBM>(SessionKey.User); if (User != null) { User.IsOnline = false; UserBL userBL = new UserBL(); userBL.UpdateUser(User); } FormsAuthentication.SignOut(); return RedirectToAction("Login", "Account"); }