Exemplo n.º 1
0
        public async Task <IActionResult> Dashboard(int Id)
        {
            SIPUserManager SIPUser     = new SIPUserManager(_hostingEnvironment, _userManager);
            var            CurrentUser = await SIPUser.GetUser(User);

//            var CurrentUser = await _userManager.GetUserAsync(User);
            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))
            {
                var Organization = new FrontOrganizationDashboard();
                Organization = await _frontOrganizationProvider.Dashboard(CurrentUser.Id, Id);

                var subOrganization = await _frontOrganizationProvider.DashboardSubOrganization(CurrentUser.Id, Id);

                var Content = await _frontOrganizationProvider.DashboardContent(CurrentUser.Id, Id);

                var Process = await _frontOrganizationProvider.DashboardProcess(CurrentUser.Id, Id);

                var PersonRoles = await _frontOrganizationProvider.DashboardPersonRoles(CurrentUser.Id, Id);

                var PersonPositions = await _frontOrganizationProvider.DashboardPersonPositions(CurrentUser.Id, Id);

                var Address = await _frontOrganizationProvider.DashboardAddress(CurrentUser.Id, Id);

                var Telecom = await _frontOrganizationProvider.DashboardTelecom(CurrentUser.Id, Id);

                Organization.SubOrganizations = subOrganization;
                Organization.Contents         = Content;
                Organization.Processes        = Process;
                Organization.PersonRoles      = PersonRoles;
                Organization.PersonPositions  = PersonPositions;
                Organization.Addresses        = Address;
                Organization.Telecoms         = Telecom;
                //      var x= await _frontOrganizationProvider.IndexGetSubOrganizationTree(CurrentUser.Id, Id);
                //    Organization.SubOrganizationTree = JObject.Parse(x);

                return(Ok(Organization));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
        public async Task <FrontOrganizationDashboard> Dashboard(string UserId, int OrganizationId)
        {
            FrontOrganizationDashboard Organization = new FrontOrganizationDashboard();

            Organization.CanCreate              = true;
            Organization.CanEdit                = true;
            Organization.CreatedDate            = DateTime.Now;
            Organization.CreatorId              = 1;
            Organization.CreatorName            = "John Cleese";
            Organization.Description            = "Absegami High School is a four-year comprehensive public high school serving students in ninth through twelfth grades in Galloway Township, Atlantic County, New Jersey, United States The student body comes from Galloway Township.";
            Organization.ModifiedDate           = DateTime.Now;
            Organization.ModifierId             = 1;
            Organization.ModifierName           = "John Cleese";
            Organization.Name                   = "Absegami High School";
            Organization.OrganizationId         = 1;
            Organization.OrganizationTypeId     = 1;
            Organization.OrganizationTypeName   = "High school";
            Organization.ParentOrganizationId   = 2;
            Organization.ParentOrganizationName = "Greater Egg Harbor Regional High School District";
            Organization.SecurityLevelId        = 5;
            Organization.SecurityLevelName      = "Level 5";
            Organization.StatusName             = "Active";
            return(Organization);
        }