public async Task<JsonResult> Approve(Agreement model)
 {
     if (ModelState.IsValid)
     {
         var agr = await db.Agreements.FindAsync(model.Id);
         if (agr != null)
         {
             agr.Status = Status.Approved;
             await db.SaveChangesAsync();
             return Json(Result.Done);
         }
     }
     return Json(Result.Failed);
 }
 public async Task<JsonResult> Delete(Agreement model)
 {
     if (ModelState.IsValid)
     {
         var agr = await db.Agreements.FindAsync(model.Id);
         if (agr != null)
         {
             db.Agreements.Remove(agr);
             await db.SaveChangesAsync();
             return Json(Result.Done);
         }
     }
     return Json(Result.Failed);
 }
 public async Task<JsonResult> Create(Agreement model)
 {            
     if (ModelState.IsValid)
     {
         var userName = User.Identity.Name;
         var user = UserManager.FindByName(userName);
         model.Status = Status.Made;
         model.Id = Guid.NewGuid();
         model.IdUser = user.Id;
         db.Agreements.Add(model);
         var result = await db.SaveChangesAsync();
         return Json(Result.Done);
     }
     return Json(Result.Failed);
 }