public static PersonViewModel GetSourcePerson(int Id)
        {
            RelationRequestDAL Rel = new DAL.RelationRequestDAL(Id);
            var SourceUsers_Id     = Rel.RelationRequest.SourceUsers.Id;
            var GetPersonId        = RelationRequestDAL.GetPersonId(SourceUsers_Id);

            return(PersonViewModel.Find(GetPersonId));
        }
Exemplo n.º 2
0
        public ActionResult RegisterRelationAction(int PersonId)
        {
            var Person = PersonViewModel.Find(PersonId);
            var User   = UserHelpar.GetUser();

            if (User.Id != 0)
            {
                var Rel = new RelationRequestViewModel();
                Rel.RequestUser_Id = UserHelpar.GetUserId();
                Rel.TargetUser_Id  = Person.User_Id;
                Rel.RequestDate    = DateTime.Now;
                Rel.RequestStatus  = RelationStatus.Pending.ToString();
                Rel.Create();


                return(RedirectToAction("Details", "RelationRequests", new { Id = Rel.Id }));
            }
            else
            {
                // return RedirectToAction(Url.Action("Login", "Account") +"?returnUrl="+" "+"&relationRequestUserId="+ Person.User_Id);
                return(RedirectToAction("Login", "Account", new { returnUrl = "RelationRequest", relationRequestUserId = Person.User_Id }));
            }
        }
        public static PersonViewModel GetTargetPerson(int Id)
        {
            RelationRequestDAL Rel = new DAL.RelationRequestDAL(Id);

            return(PersonViewModel.Find(RelationRequestDAL.GetPersonId(Rel.RelationRequest.TargetUsers.Id)));
        }