public IHttpActionResult GetStatisticAboutOrganization()
        {
            try
            {
                StatisticManageBasicInforDTO statistic = new StatisticManageBasicInforDTO();

                using (var db = new OrganizationDAL())
                {
                    statistic = db.GetStatisticAboutOrgaization();
                }

                return(Ok(new HTTPMessageDTO
                {
                    Status = WsConstant.HttpMessageType.SUCCESS,
                    Message = "",
                    Type = "",
                    Data = statistic
                }));
            }
            catch (Exception)
            {
                return(Ok(new HTTPMessageDTO
                {
                    Status = WsConstant.HttpMessageType.ERROR,
                    Message = "",
                    Type = ""
                }));
            }
        }
Ejemplo n.º 2
0
        public IHttpActionResult GetStatisticManageBasicInfor()
        {
            try
            {
                StatisticManageBasicInforDTO statistic = new StatisticManageBasicInforDTO();

                using (var db = new UserDAL())
                {
                    statistic.NumberActiveUser    = db.CountUserActiveOrNot(true);
                    statistic.NumberNotActiveUser = db.CountUserActiveOrNot(false);
                    statistic.NumberVerifyUser    = db.CountUserVerifyOrNot(true);
                    statistic.NumberNotVerifyUser = db.CountUserVerifyOrNot(false);
                    statistic.NumberNewCreateUser = db.CountNewUser();
                    statistic.NumberTotalUser     = db.CountTotalUser();

                    //Get number of event
                    statistic.NumberTotalEvent = db.CountTotalEvent();
                    //Get number of post
                    statistic.NumberTotalThread = db.CountTotalThread();
                }

                using (var db = new OrganizationDAL())
                {
                    //Get number of organization
                    statistic.NumberTotalOrganization = db.CountTotalOrganization();
                }

                return(Ok(new HTTPMessageDTO
                {
                    Status = WsConstant.HttpMessageType.SUCCESS,
                    Message = "",
                    Type = "",
                    Data = statistic
                }));
            }
            catch (Exception)
            {
                return(Ok(new HTTPMessageDTO
                {
                    Status = WsConstant.HttpMessageType.ERROR,
                    Message = "",
                    Type = ""
                }));
            }
        }
Ejemplo n.º 3
0
        public StatisticManageBasicInforDTO GetStatisticAboutOrgaization()
        {
            StatisticManageBasicInforDTO statistic = new StatisticManageBasicInforDTO();

            try
            {
                statistic.NumberActiveOrganization    = CountOrganizationActiveOrNot(true);
                statistic.NumberNotActiveOrganization = CountOrganizationActiveOrNot(false);
                statistic.NumberNotVerifyOrganization = CountOrganizationVerifyOrNot(false);
                statistic.NumberTotalOrganization     = CountTotalOrganization();
            }
            catch (Exception)
            {
                //throw;
            }

            return(statistic);
        }