Пример #1
0
        public JsonResult AcceptRequest(int id)
        {
            var user  = User.Identity.Name;
            var login = AccountService.GetLoginByEmail(user);

            if (ModelState.IsValid)
            {
                var result = TenantService.AcceptRequest(new RequestModel {
                    Id = id
                }, login);
                if (result.IsSuccess)
                {
                    return(Json(new { Success = true, Message = "Request has been accepted!" }));
                }
                else
                {
                    return(Json(new { Success = false, ErrorMsg = result.ErrorMessage }));
                }
            }
            return(Json(new { Success = false, ErrorMsg = "Invalid fields" }));
        }