Exemplo n.º 1
0
        //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);
        }
Exemplo n.º 2
0
        public IActionResult Delete(string f, bool collections = false)
        {
            var fileIndexResultsList = _deleteItem.Delete(f, collections);

            // When all items are not found
            // ok = file is deleted
            if (fileIndexResultsList.All(p => p.Status != FileIndexItem.ExifStatus.Ok))
            {
                return(NotFound(fileIndexResultsList));
            }

            return(Json(fileIndexResultsList));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> DeleteItem(string tableName, string id)
        {
            var response = await _deleteItem.Delete(tableName, id);

            return(Ok(response));
        }