Пример #1
0
        public IHttpActionResult BulkAssign(AssignData AD)
        {
            var ua = UserAccess.GetUserAccess(User.Identity.Name);

            if (ua.current_access == UserAccess.access_type.inspector_access ||
                ua.current_access == UserAccess.access_type.admin_access)
            {
                return(Ok(AD.BulkAssign(ua)));
            }
            else
            {
                return(Unauthorized());
            }
        }
Пример #2
0
    public void LoadData(AssignData callback)
    {
        callbacksToCall.add(callback);
        if (isLoading)
        {
            return;
        }
        // Do some long running code here
        var data = something;

        // Now iterate the list
        foreach (var item in callbacksToCall)
        {
            item(data);
        }
        isLoading = false;
    }