Ejemplo n.º 1
0
        public ActionResult Partial(int ReferenceId)
        {
            MessageServices services      = new MessageServices();
            OfferServices   offerServices = new OfferServices();
            MessageServices chatServices  = new MessageServices();
            MessageModel    filter        = new MessageModel();

            chatServices.MarkAsReaded(
                new MessageModel()
            {
                ReferenceId = ReferenceId, From = SessionWeb.User.PersonId
            });

            OfferModel offer = offerServices.GetFirst(new OfferModel()
            {
                OfferId = ReferenceId
            });

            ViewBag.Alias = SessionWeb.User.PersonId == offer.ProjectAdmin.PersonId ? "PROJECT_OWNER"
                : SessionWeb.User.PersonId == offer.VesselAdmin.PersonId ? "VESSEL_OWNER" : "";
            ViewBag.From = SessionWeb.User.PersonId;
            ViewBag.To   = SessionWeb.User.PersonId == offer.ProjectAdmin.PersonId ? offer.VesselAdmin.PersonId
                : SessionWeb.User.PersonId == offer.VesselAdmin.PersonId ? offer.ProjectAdmin.PersonId : -1;
            ViewBag.lstMsg          = services.Get(filter);
            ViewBag.SessionPersonId = SessionWeb.User.PersonId;
            ViewBag.ReferenceId     = ReferenceId;

            return(View());
        }