//public async Task UpdateUser(int id, string userName , string Email, string password)
        //{
        //    _tableName = "User";
        //    //get the current object with the id
        //    var currentUser = await _getItem.GetUserItems(_tableName, id);

        //    //get the sort keys of the previous one
        //    var currentUserName = currentUser.User.Select(p => p.UserName).FirstOrDefault();

        //    //delete the current event with id
        //    var response = await _deleteItem.Delete(_tableName, id);

        //    //create a new object with the id and sort key
        //    await _putItem.AddNewUser(id, currentUserName, Email, password);

        //}

        public async Task UpdateEvent(int id, string eventType, string eventName, string location, string occurrance, string startTime, string endTime, string notes, bool status)
        {
            _tableName = "Event";
            //get the current object with the id
            var currentEvent = await _getItem.GetEventByID(id);

            //get the sort keys of the previous one
            var userName = currentEvent.UserName;

            //delete the current event with id
            var response = await _deleteItem.Delete(_tableName, id.ToString());

            //create a new object with the id and sort key
            await _putItem.AddNewEvent(id, userName, eventType, eventName, location, occurrance, startTime, endTime, notes, status);
        }
Example #2
0
 //[Route("putevent/{eventId}/{userName}/{eventType}/{eventName}/{location}/{occurrance}/{startTime}/{endTime}/{notes}/{status}")]
 //int eventId, string userName, string eventType, string eventName, string location, string occurrance, string startTime, string endTime, string notes, bool status
 public IActionResult PutEvent([FromBody] Event evnt)
 {
     _putItem.AddNewEvent(evnt.EventID, evnt.UserName, evnt.EventType, evnt.EventName, evnt.Location, evnt.Occurrance, evnt.EventStartTime.ToString(), evnt.EventEndTime.ToString(), evnt.Notes, evnt.Status);
     return(Ok());
 }