public _Petition_CoauthorViewModel(Coauthor coauthor) { if (coauthor != null) { Name = coauthor.User.FullName; Avatar = ImageService.GetImageUrl <User>(coauthor.User.Avatar); UserId = coauthor.UserId; } }
public UserPetitionNotices_ItemViewModel(Coauthor coauthor) { if (coauthor != null) { CoauthorId = coauthor.Id; PetitionId = coauthor.Petition.Id; PetitionController = coauthor.Petition.Controller; PetitionTitle = coauthor.Petition.Title; } }
public ActionResult DeletePetitionCoauthor(Guid id) { if (!Request.IsAuthenticated) { throw new AuthenticationException(); } Coauthor coauthor = DataService.PerThread.CoauthorSet.SingleOrDefault(x => x.Id == id); if (coauthor == null) { throw new Exception("Неверный идентификатор соавтора"); } VotingService.DeletePetitionCoauthor(id, UserContext.Current.Id); return(RedirectToAction("editpetitioncoauthors", "user", new { id = coauthor.PetitionId })); }
public _EditPetitionCoauthors_Coauthor(Coauthor coauthor) { Id = coauthor.Id; Name = coauthor.User.FullName; UserId = coauthor.UserId; if (!coauthor.IsAccepted.HasValue) { Status = "нет ответа"; } else if (coauthor.IsAccepted.Value) { Status = "принято"; } else { Status = "отклонено"; } }