public ActionResult Update(Guid?id) { if (id == null) { return(RedirectToAction("List", "AppUser", new { area = "Member" })); } AppUser data = _appUserService.GetById((Guid)id); AppUserVM model = new AppUserVM() { ID = data.ID, UserName = data.UserName, Password = data.Password, Gender = data.Gender, Address = data.Address, IdentityNumber = data.IdentityNumber, Name = data.Name, LastName = data.LastName, Salary = data.Salary, Email = data.Email, Phone = data.Phone, District = data.District, City = data.City, Country = data.Country, Birthdate = data.Birthdate, ImagePath = data.ImagePath, DepartmentID = data.DepartmentID, StoreID = data.StoreID, }; TempData["DepartmentListesi"] = _departmentService.GetActive(); TempData["StoreListesi"] = _storeService.GetActive(); return(View(model)); }
public ActionResult Update(int id) { AppUser appUser = _appUserService.GetById(id); AppUserDTO model = new AppUserDTO(); model.Id = appUser.Id; model.FirstName = appUser.FirstName; model.LastName = appUser.LastName; model.UserName = appUser.UserName; model.Mail = appUser.Mail; model.Password = appUser.Password; model.Role = appUser.Role; model.XSmallUserImage = appUser.XSmallUserImage; return(View(model)); }
public ActionResult <AppUserDto> GetById(int id) { var user = _userService.GetById(id); var userDto = _mapper.Map <AppUserDto>(user); return(userDto); }
public void GetById_ShouldNotBeNull() { //Arrange //Act var result = _service.GetById(1); //Assert result.Should().NotBeNull(); dbContext.Dispose(); }
public ActionResult Update(int id) { AppUserDTO model = new AppUserDTO(); AppUser user = _appUserService.GetById(id); model.Id = user.Id; model.Name = user.Name; model.LastName = user.LastName; model.UserName = user.UserName; model.Password = user.Password; model.Address = user.Address; model.PhoneNumber = user.PhoneNumber; model.Role = user.Role; model.ImagePath = user.ImagePath; model.Email = user.Email; return(View(model)); }
public ActionResult Update(Guid id) { AppUser appuser = _appUserService.GetById(id); AppUserDTO model = new AppUserDTO(); model.ID = appuser.ID; model.FirstName = appuser.FirstName; model.LastName = appuser.LastName; model.UserName = appuser.UserName; model.Password = appuser.Password; model.Bio = appuser.Bio; model.Email = appuser.Email; model.Birthdate = appuser.Birthdate; model.Gender = appuser.Gender; model.PhoneNumber = appuser.PhoneNumber; model.UserImage = appuser.UserImage; model.XSmallUserImage = appuser.XSmallUserImage; model.CruptedUserImage = appuser.CruptedUserImage; return(View(model)); }
public ActionResult Update(Guid?id) { if (id == null) { return(RedirectToAction("List")); } AppUser guncellenecek = _appUserService.GetById((Guid)id); AppUserDTO model = new AppUserDTO(); model.ID = guncellenecek.ID; model.Name = guncellenecek.Name; model.LastName = guncellenecek.LastName; model.Password = guncellenecek.Password; model.UserName = guncellenecek.UserName; model.Role = guncellenecek.Role; model.ImagePath = guncellenecek.ImagePath; model.Address = guncellenecek.Address; model.PhoneNumber = guncellenecek.PhoneNumber; model.Email = guncellenecek.Email; return(View(model)); }
public ActionResult Show(Guid id) { ArticleDetailVM model = new ArticleDetailVM(); model.Article = _articleService.GetById(id); model.AppUser = _appUserService.GetById(model.Article.AppUser.ID); model.Comments = _commentService.GetDefault(x => x.ArticleID == id && (x.Status == Core.Enum.Status.Active || x.Status == Core.Enum.Status.Updated)); model.LikeCount = _likeService.GetDefault(x => x.ArticleID == id && (x.Status == Core.Enum.Status.Active || x.Status == Core.Enum.Status.Updated)).Count; model.CommentCount = _commentService.GetDefault(x => x.ArticleID == id && (x.Status == Core.Enum.Status.Active || x.Status == Core.Enum.Status.Updated)).Count; model.Likes = _likeService.GetDefault(x => x.ArticleID == id && (x.Status == Core.Enum.Status.Active || x.Status == Core.Enum.Status.Updated)); return(View(model)); }
public ActionResult Update(Guid?id) { if (id == null) { return(RedirectToAction("List", "AppUser", new { area = "Admin" })); } AppUser data = _appuserService.GetById((Guid)id); AppUserVM model = new AppUserVM() { ID = data.ID, Name = data.Name, LastName = data.LastName, ImagePath = data.ImagePath, UserName = data.UserName, Password = data.Password, Email = data.Email, PhoneNumber = data.PhoneNumber, Role = data.Role }; return(View(model)); }
public ActionResult Index() { TweetDetailVM model = new TweetDetailVM(); model.Tweets = _tweetService.GetActive(); foreach (var item in model.Tweets) { model.AppUser = _appUserService.GetById(item.AppUser.ID); model.Tweet = _tweetService.GetById(item.ID); model.Comments = _commentService.GetDefault(x => x.TweetID == item.ID && (x.Status == Core.Enum.Status.Active || x.Status == Core.Enum.Status.Updated)).OrderByDescending(x => x.CreatedDate).Take(10).ToList(); model.Likes = _likeService.GetDefault(x => x.TweetID == item.ID && (x.Status == Core.Enum.Status.Active || x.Status == Core.Enum.Status.Updated)); model.LikeCount = _likeService.GetDefault(x => x.TweetID == item.ID && (x.Status == Core.Enum.Status.Active || x.Status == Core.Enum.Status.Updated)).Count(); model.CommentCount = _commentService.GetDefault(x => x.TweetID == item.ID && (x.Status == Core.Enum.Status.Active || x.Status == Core.Enum.Status.Updated)).Count(); } return(View(model)); }
public ActionResult Show(Guid id) { TweetDetailVM model = new TweetDetailVM(); model.Tweet = _tweetService.GetById(id); model.AppUser = _appUserService.GetById(model.Tweet.AppUser.ID); model.Comments = _commentService.GetDefault(x => x.TweetID == id && (x.Status == Core.Enum.Status.Active || x.Status == Core.Enum.Status.Updated)); model.LikeCount = _likeService.GetDefault(x => x.TweetID == id && (x.Status == Core.Enum.Status.Active || x.Status == Core.Enum.Status.Updated)).Count; model.CommentCount = _commentService.GetDefault(x => x.TweetID == id && (x.Status == Core.Enum.Status.Active || x.Status == Core.Enum.Status.Updated)).Count; model.Likes = _likeService.GetDefault(x => x.TweetID == id && (x.Status == Core.Enum.Status.Active || x.Status == Core.Enum.Status.Updated)); model.Retweets = _retweetService.GetDefault(x => x.TweetID == id && (x.Status == Core.Enum.Status.Active || x.Status == Core.Enum.Status.Updated)); model.DMSends = _dMSendService.GetDefault(x => x.TweetID == id && (x.Status == Core.Enum.Status.Active || x.Status == Core.Enum.Status.Updated)); model.RetweetCount = _retweetService.GetDefault(x => x.TweetID == id && (x.Status == Core.Enum.Status.Active || x.Status == Core.Enum.Status.Updated)).Count; model.DMSendCount = _dMSendService.GetDefault(x => x.TweetID == id && (x.Status == Core.Enum.Status.Active || x.Status == Core.Enum.Status.Updated)).Count; return(View(model)); }
// GET: Member/Post public ActionResult Show(int id) { PostDetailVM model = new PostDetailVM(); model.Post = _postService.GetById(id); model.AppUser = _appUserService.GetById(model.Post.AppUserId); model.Comments = _commentService.GetDefault(x => x.PostId == id && x.Status != Status.Passive); model.Likes = _likeService.GetDefault(x => x.PostId == id && x.Status != Status.Passive); model.CommentCount = _commentService.GetDefault(x => x.PostId == id && x.Status != Status.Passive).Count; model.LikeCount = _likeService.GetDefault(x => x.PostId == id && x.Status != Status.Passive).Count; return(View(model)); }
public ActionResult Edit(Guid Id) { return(View(appUser.GetById(Id))); }
public ActionResult UpdateAppUser(int id) { AppUser user = appUserService.GetById(id) as AppUser; return(View(user)); }
//Admin Profile //todo:Admin Profile butonuna bağlanacak. public ActionResult AdminProfile(Guid id) { var admin = appUserService.GetById(id); return(View(admin)); }
public ActionResult Details(int id) { return(View(appUserService.GetById(id))); }
public ActionResult Update(Guid id) { return(View(_appUserService.GetById(id))); }