Exemplo n.º 1
0
        public ActionResult AddInvit(int id)
        {
            var user = this.serviceUser.GetById(id);
            VMAddInvit model = new VMAddInvit();
            model.DisplayName = user.DisplayName;
            model.UserId = user.Id;
            model.ThumbnailUrl = user.PictureUrl;
            model.Message = string.Format(
            @"Hello {0},

            I'm working on a project that could use your talents.  Would you consider contributing to my project?

            Thanks,
            {1}

            ",
                user.DisplayName,
                CurrentUser.DisplayName);

            //todo : find a better way
            JsonSerializer js = JsonSerializer.Create(new JsonSerializerSettings());
            var jw = new System.IO.StringWriter();
            js.Serialize(jw, model);
            model.JSON = jw.ToString();

            return View(model);
        }
Exemplo n.º 2
0
        public JsonResult AddInvit(VMAddInvit model)
        {
            int result = this.serviceInvit.Invit(model.ProjectId, model.UserId, model.Message, CurrentUser);

            return new JsonResult() { Data = result > 0 };
        }