public OperationStatus CloseProject(int projectId)
 {
     var status = new OperationStatus {Success = true};
     try
     {
         context.Projects.Single(x => x.ProjectId == projectId).ProjectStatus = (int) ProjectStatus.Closed;
         context.SaveChanges();
     }
     catch (Exception ex)
     {
         status.Success = false;
         status.ErrorMessege = ex.ToString();
     }
     return status;
 }
 public OperationStatus UpdateStatus(Task task)
 {
     var status = new OperationStatus { Success = true };
     var selectedTask = context.Tasks.First(x => x.TaskId == task.TaskId);
     selectedTask.LocationLeft = task.LocationLeft;
     selectedTask.LocationTop = task.LocationTop;
     selectedTask.TaskStatus = task.TaskStatus;
     try
     {
         context.SaveChanges();
     }
     catch(Exception ex)
     {
         status.Success = false;
         status.ErrorMessege = ex.ToString();
     }
     return status;
 }