Exemplo n.º 1
0
 public ActionResult AddProject(Project pro, string id)
 {
     try
     {
         var us = _repositoryAppUser.Get(id);
         _repositoryProject.Create(pro, id);
         return(RedirectToAction("GetProject", new { id = id }));
     }
     catch
     {
         return(RedirectToAction("Index", "SanctumSanctorum"));
     }
 }
Exemplo n.º 2
0
        public async Task <ActionResult> AddEmployee(Employee empl, string id)
        {
            try
            {
                var us = _repositoryUser.Get(id);
                _repositoryEmployee.Create(empl);

                IdentityMessage message = new IdentityMessage();
                message.Body        = string.Format(us.NickName + " добавил Вас в свою команду!");
                message.Destination = empl.Email;
                message.Subject     = "Dream team";
                EmailService em = new EmailService();
                await em.SendAsync(message);

                _repositoryUser_Employee.Create(us, empl);
                return(RedirectToAction("GetEmployee", new { id = id }));
            }
            catch
            {
                return(View());
            }
        }