コード例 #1
0
ファイル: ClassRenewInfo.cs プロジェクト: NingMoe/ybk_manager
        /// <summary>
        /// 获取报表数据
        /// </summary>
        private void GetStudentRenewInfoListByClassCode()
        {
            try
            {
                new Thread(new ThreadStart(() =>
                {
                    var result = RenewService.GetStudentRenewInfoListByClassCode(CurrUserInfo.SchoolId, currRenewInfo.ClassCode);
                    RunOnUiThread(() =>
                    {
                        LoadingDialogUtil.DismissLoadingDialog();

                        if (result != null)
                        {
                            renewStudentList    = result.RenewStudents;
                            notRenewStudentList = result.NotRenewStudents;

                            LoadStudents();
                        }
                    });
                })).Start();
            }
            catch (Exception ex)
            {
                var msg = ex.Message.ToString();
                LoadingDialogUtil.DismissLoadingDialog();
            }
        }
コード例 #2
0
        /// <summary>
        /// 获取报表数据
        /// </summary>
        private void GetClassListOfStudentFromDataMart()
        {
            try
            {
                new Thread(new ThreadStart(() =>
                {
                    classList = RenewService.GetClassListOfStudent(CurrUserInfo.SchoolId, studentCode, classStatus);
                    CurrActivity.RunOnUiThread(() =>
                    {
                        LoadingDialogUtil.DismissLoadingDialog();
                        mSwipeRefreshLayout.Refreshing = false;

                        if (classList != null && classList.Count > 0)
                        {
                            mAdapter.SetData(classList);
                            mAdapter.NotifyDataSetChanged();
                        }
                        else
                        {
                            mSwipeRefreshLayout.Visibility = ViewStates.Gone;
                            ll_none.Visibility             = ViewStates.Visible;
                        }
                    });
                })).Start();
            }
            catch (Exception ex)
            {
                var msg = ex.Message.ToString();
                LoadingDialogUtil.DismissLoadingDialog();
            }
        }
コード例 #3
0
        public void BindData()
        {
            LoadingDialogUtil.ShowLoadingDialog(CurrActivity, "获取数据中...");

            try
            {
                var schoolId       = CurrUserInfo.SchoolId;
                var year           = searchQuarter.Year;
                var quarter        = searchQuarter.Quarter;
                var district       = searchDistrict;
                var categoryEntity = categoryEntityList.FirstOrDefault(p => p.CategoryName == searchCagetory);
                var category       = categoryEntity == null?"":categoryEntity.CategoryValue;

                //负责校区
                var areaCodes = "";                 //店长登录用
                if (CurrUserInfo.Type == (int)UserType.ShopManager)
                {
                    areaCodes = CurrUserInfo.AreaCodes;
                }
                //年级
                var gradeList = RenewService.GetGradeList(CurrUserInfo.SchoolId);
                var grade     = string.Join(",", gradeList.Select(p => p.GradeName));

                new System.Threading.Thread(new ThreadStart(() =>
                {
                    var list = NewService.GetSumNewStudentList(schoolId, year, quarter, dataType, sortType, district, category, grade, out totalCount, 1, 1, 500, areaCodes);
                    CurrActivity.RunOnUiThread(() =>
                    {
                        LoadingDialogUtil.DismissLoadingDialog();
                        mSwipeRefreshLayout.Refreshing = false;

                        if (list != null)
                        {
                            var totalData      = list.TotalData;
                            this.avgGrowthRate = totalData.Rate;
                            this.sumList       = list.List;
                            var totalEntity    = new NewStudentSumAreaEntity()
                            {
                                Name = totalData.Name, StudentCount = totalData.StudentCount, Total = totalData.Total, Rate = totalData.Rate
                            };
                            this.sumList.Add(totalEntity);


                            mAdapter.SetData(this.sumList, this.avgGrowthRate);
                            mAdapter.NotifyDataSetChanged();
                        }
                    });
                })).Start();
            }
            catch (Exception ex)
            {
                var msg = ex.Message.ToString();
                LoadingDialogUtil.DismissLoadingDialog();
                mSwipeRefreshLayout.Refreshing = false;
            }
        }
コード例 #4
0
        protected override void LoadData()
        {
            if (!NetUtil.CheckNetWork(CurrActivity))
            {
                ToastUtil.ShowWarningToast(CurrActivity, "网络未连接!");
                return;
            }
            //年级数据
            if (BaseApplication.GetInstance().gradeList == null)
            {
                BaseApplication.GetInstance().gradeList = RenewService.GetGradeList(CurrUserInfo.SchoolId);
            }
            if (BaseApplication.GetInstance().gradeList != null && BaseApplication.GetInstance().gradeList.Any())
            {
                gradeList = new List <string>(BaseApplication.GetInstance().gradeList.Select(i => i.GradeName).ToArray());
            }
            //默认年级全选
            if (searchGradeList != null && searchGradeList.Any())
            {
                var selectedgrade = "全部年级";
                if (searchGradeList.Count > 0 && searchGradeList.Count != gradeList.Count)
                {
                    selectedgrade = string.Join(",", searchGradeList.ToArray());
                }

                tv_grade.Text = selectedgrade;
            }
            else
            {
                searchGradeList = new List <string>(gradeList.ToArray());
            }

            //科目数据
            if (BaseApplication.GetInstance().courseList == null)
            {
                BaseApplication.GetInstance().courseList = DistrictService.GetCourseList(CurrUserInfo.SchoolId);
            }
            if (BaseApplication.GetInstance().courseList != null && BaseApplication.GetInstance().courseList.Any())
            {
                courseList = new List <string>(BaseApplication.GetInstance().courseList.Select(t => t.CourseName).ToArray());
            }
            //默认科目
            if (!string.IsNullOrEmpty(searchCourse))
            {
                tv_course.Text = searchCourse;
            }
            else
            {
                searchCourse   = BaseApplication.GetInstance().courseList[0].CourseName;
                tv_course.Text = searchCourse;
            }


            BindData();
        }
コード例 #5
0
        protected void LoadData()
        {
            if (!NetUtil.CheckNetWork(CurrActivity))
            {
                ToastUtil.ShowWarningToast(CurrActivity, "网络未连接!");
                return;
            }

            //财年数据
            if (BaseApplication.GetInstance().quarterList == null)
            {
                BaseApplication.GetInstance().quarterList = RenewService.GetQuarter(CurrUserInfo.SchoolId);
            }
            //区域数据
            if (BaseApplication.GetInstance().districtList == null)
            {
                BaseApplication.GetInstance().districtList = RenewService.GetDistrictList(CurrUserInfo.SchoolId);
            }

            //默认财年
            if (BaseApplication.GetInstance().quarterList != null && BaseApplication.GetInstance().quarterList.Any())
            {
                quarterList   = BaseApplication.GetInstance().quarterList;
                searchQuarter = BaseApplication.GetInstance().quarterList.Find(t => t.IsCurrent);
                tv_year.Text  = searchQuarter.QuarterName;
            }
            //默认区域
            if (BaseApplication.GetInstance().districtList != null && BaseApplication.GetInstance().districtList.Any())
            {
                districtList = new List <string>(BaseApplication.GetInstance().districtList.Select(i => i.DistrictName).ToArray());
                //加区域的权限判断--区域经理登录
                if (CurrUserInfo.Type == (int)UserType.AreaManager)
                {
                    districtList     = districtList.Where(p => p == CurrUserInfo.DistrictName).ToList();
                    tv_district.Text = CurrUserInfo.DistrictName;
                    searchDistrict   = CurrUserInfo.DistrictName;
                }
            }

            //默认新生类型
            if (categoryList != null && categoryList.Any())
            {
                searchCagetory   = categoryList[0];
                tv_cagetory.Text = searchCagetory;
            }
            else
            {
                BindCategoryList();
            }

            BindData();
        }
コード例 #6
0
 /// <summary>
 /// 获取财年季度数据
 /// </summary>
 private void LoadQuarterData()
 {
     try
     {
         new Thread(new ThreadStart(() =>
         {
             BaseApplication.GetInstance().quarterList = RenewService.GetQuarter(currUserInfo.SchoolId);
         })).Start();
     }
     catch (Exception ex)
     {
         var msg = ex.Message.ToString();
     }
 }
コード例 #7
0
        /// <summary>
        /// 页面数据
        /// </summary>
        protected void LoadData()
        {
            if (!NetUtil.CheckNetWork(CurrActivity))
            {
                ToastUtil.ShowWarningToast(CurrActivity, "网络未连接!");
                return;
            }
            else
            {
                LoadingDialogUtil.ShowLoadingDialog(CurrActivity, "获取数据中...");

                if (BaseApplication.GetInstance().quarterList == null || !BaseApplication.GetInstance().quarterList.Any())
                {
                    BaseApplication.GetInstance().quarterList = RenewService.GetQuarter(CurrUserInfo.SchoolId);
                }
                if (BaseApplication.GetInstance().gradeList == null)
                {
                    BaseApplication.GetInstance().gradeList = RenewService.GetGradeList(CurrUserInfo.SchoolId);
                }

                GetRenewData();

                // 财年选择
                #region
                if (BaseApplication.GetInstance().quarterList != null && BaseApplication.GetInstance().quarterList.Any())
                {
                    tv_year.Visibility = ViewStates.Visible;
                    tv_year.Click     += (sender, e) =>
                    {
                        if (financialYearPopWin == null)
                        {
                            financialYearPopWin            = new PopWin_IndexFinancialYear(CurrActivity, BaseApplication.GetInstance().quarterList);
                            financialYearPopWin.clickItem += new PopWin_IndexFinancialYear.ClickItem(clickFinancialYear);
                        }

                        financialYearPopWin.OutsideTouchable = true;
                        if (!financialYearPopWin.IsShowing)
                        {
                            financialYearPopWin.ShowAsDropDown(tv_year, 0, -15);
                        }
                    };
                }
                #endregion
            }
        }
コード例 #8
0
        /// <summary>
        /// 页面数据
        /// </summary>
        protected void LoadData()
        {
            if (!NetUtil.CheckNetWork(CurrActivity))
            {
                ToastUtil.ShowWarningToast(CurrActivity, "网络未连接!");
                return;
            }
            LoadingDialogUtil.ShowLoadingDialog(CurrActivity, "获取数据中...");

            if (BaseApplication.GetInstance().quarterList == null)
            {
                BaseApplication.GetInstance().quarterList = RenewService.GetQuarter(CurrUserInfo.SchoolId);
            }
            if (BaseApplication.GetInstance().gradeList == null)
            {
                BaseApplication.GetInstance().gradeList = RenewService.GetGradeList(CurrUserInfo.SchoolId);
            }
            if (BaseApplication.GetInstance().districtList == null)
            {
                BaseApplication.GetInstance().districtList = RenewService.GetDistrictList(CurrUserInfo.SchoolId);
            }

            if (BaseApplication.GetInstance().quarterList != null && BaseApplication.GetInstance().quarterList.Any())
            {
                quarterList   = BaseApplication.GetInstance().quarterList;
                searchQuarter = BaseApplication.GetInstance().quarterList.Find(t => t.IsCurrent);
                tv_btn1.Text  = searchQuarter.QuarterName;
            }
            if (BaseApplication.GetInstance().gradeList != null && BaseApplication.GetInstance().gradeList.Any())
            {
                gradeList = new List <string>(BaseApplication.GetInstance().gradeList.Select(i => i.GradeName).ToArray());
                // 默认全选
                searchGradeList = new List <string>(gradeList.ToArray());
            }
            if (BaseApplication.GetInstance().districtList != null && BaseApplication.GetInstance().districtList.Any())
            {
                districtList = new List <string>(BaseApplication.GetInstance().districtList.Select(i => i.DistrictName).ToArray());
            }


            GetRenewInfoInGroup();
        }
コード例 #9
0
        /// <summary>
        /// 获取报表数据
        /// </summary>
        private void GetRenewInfoInGroup()
        {
            try
            {
                new Thread(new ThreadStart(() =>
                {
                    var gradeStr = "";
                    if (searchGradeList.Any())
                    {
                        gradeStr = string.Join(",", searchGradeList.ToArray());
                    }
                    var districtStr = "";
                    if (!string.IsNullOrEmpty(searchDistrict) && !searchDistrict.Equals("全部区域"))
                    {
                        districtStr = searchDistrict;
                    }

                    var result = RenewService.GetRenewInfoInGroup(CurrUserInfo.SchoolId, searchQuarter.Year, searchQuarter.Quarter, gradeStr, districtStr, 1, 6, 1, 30, classStatus);

                    CurrActivity.RunOnUiThread(() =>
                    {
                        LoadingDialogUtil.DismissLoadingDialog();
                        mSwipeRefreshLayout.Refreshing = false;

                        if (result != null)
                        {
                            teachReportList = result.RenewInfo;
                            mAdapter.SetData(teachReportList);
                            mAdapter.NotifyDataSetChanged();
                        }
                    });
                })).Start();
            }
            catch (Exception ex)
            {
                var msg = ex.Message.ToString();
                LoadingDialogUtil.DismissLoadingDialog();
                mSwipeRefreshLayout.Refreshing = false;
            }
        }
コード例 #10
0
        /// <summary>
        /// 获取续班率,返回如:{"State":1,"Data":[{"SchoolId":1,"Year":2017,"Season":2,"Type":1,"RenewRate":0.3209},{"SchoolId":1,"Year":2017,"Season":2,"Type":2,"RenewRate":0.2541},{"SchoolId":1,"Year":2017,"Season":2,"Type":3,"RenewRate":0.2920}],"Error":null,"DataCount":0}
        /// </summary>
        private void GetRenewData()
        {
            var schoolId = CurrUserInfo.SchoolId;

            try
            {
                var currQuarter = BaseApplication.GetInstance().quarterList.FirstOrDefault(p => p.IsCurrent);
                if (currQuarter != null)
                {
                    year    = currQuarter.Year;
                    quarter = currQuarter.Quarter;
                }
                tvTitle1.Text      = string.Format("{0}财年Q{1}续班率", year, quarter);
                tvTitle2.Text      = string.Format("{0}财年Q{1}续班率排名", year, quarter);
                tvBudgetTitle.Text = string.Format("{0}财年{1}预算完成率", year, quarter);
                try
                {
                    #region 教学模块
                    new Thread(new ThreadStart(() =>
                    {
                        var renewList = RenewService.GetIndexRenewInfoByDepartment(schoolId, year, quarter);

                        CurrActivity.RunOnUiThread(() =>
                        {
                            //初中续班率
                            var middleInfo = renewList.FirstOrDefault(p => p.Type == 1);
                            if (middleInfo != null)
                            {
                                tvRate1.Text = (middleInfo.RenewRate * 100).ToString("f1") + "%";
                            }
                            else
                            {
                                tvRate1.Text = "0.0%";
                            }

                            //高中续班率
                            var hightInfo = renewList.FirstOrDefault(p => p.Type == 2);
                            if (hightInfo != null)
                            {
                                tvRate2.Text = (hightInfo.RenewRate * 100).ToString("f1") + "%";
                            }
                            else
                            {
                                tvRate2.Text = "0.0%";
                            }
                        });
                    })).Start();


                    var grade = "";
                    if (BaseApplication.GetInstance().gradeList != null)
                    {
                        grade = string.Join(",", BaseApplication.GetInstance().gradeList.Select(t => t.GradeName).ToArray());
                    }
                    // 前三名
                    new Thread(new ThreadStart(() =>
                    {
                        var beforeList = RenewService.GetIndexRenewInfoInGroup(schoolId, year, quarter, grade, "", 0, 6, 1, 3);

                        CurrActivity.RunOnUiThread(() =>
                        {
                            InitRenewViews(beforeList, 6);
                        });
                    })).Start();

                    // 后三名
                    new Thread(new ThreadStart(() =>
                    {
                        var lastList = RenewService.GetIndexRenewInfoInGroup(schoolId, year, quarter, grade, "", 0, 5, 1, 3);

                        CurrActivity.RunOnUiThread(() =>
                        {
                            InitRenewViews(lastList, 5);
                        });
                    })).Start();
                    #endregion

                    #region 区域模块
                    new Thread(new ThreadStart(() =>
                    {
                        //query
                        //6-按预算完成率倒序排
                        int sortType = 6;
                        //1-预收款
                        int dataType      = 1;
                        var allBudgetlist = BudgetService.GetAreaPaymentList(schoolId, year, quarter, "", sortType, dataType);
                        //预收款与完成率 取总计行
                        var budget         = "0";
                        var completionRate = "0.0%";
                        var totalModel     = allBudgetlist.FirstOrDefault(p => p.AreaName == "总计");
                        if (totalModel != null)
                        {
                            budget         = (totalModel.Budget / 10000).ToString("f1");
                            completionRate = (totalModel.CompletionRate * 100).ToString("f1") + "%";
                        }


                        PaymentEntity[] budgetBefore = new PaymentEntity[3];
                        PaymentEntity[] budgetAfter  = new PaymentEntity[3];
                        if (allBudgetlist.Count > 0)
                        {
                            //移除总计行后,取前三名&后三名
                            allBudgetlist.RemoveAt(allBudgetlist.Count - 1);
                            //移除营收目标=0的行
                            allBudgetlist.RemoveAll(p => p.Budget == 0);
                        }
                        var budgetCount = allBudgetlist.Count;
                        if (allBudgetlist.Count > 3)
                        {
                            budgetCount = 3;
                        }
                        if (budgetCount > 0)
                        {
                            allBudgetlist.CopyTo(0, budgetBefore, 0, budgetCount);
                            allBudgetlist.CopyTo(allBudgetlist.Count - budgetCount, budgetAfter, 0, budgetCount);

                            budgetBefore = budgetBefore.Where(t => t != null).ToArray();
                            budgetAfter  = budgetAfter.Where(t => t != null).ToArray();
                        }

                        CurrActivity.RunOnUiThread(() =>
                        {
                            //预收款
                            tvBudget.Text = budget;
                            //预收款完成率
                            tvBudgetRate.Text = ((totalModel != null && totalModel.Budget == 0) ? "--" : completionRate);

                            //前三名
                            InitBudgetViews(budgetBefore.ToList(), true);
                            //后三名
                            InitBudgetViews(budgetAfter.Reverse().ToList(), false);

                            mSwipeRefreshLayout.Refreshing = false;
                        });
                    })).Start();

                    #endregion
                }
                catch (Exception ex)
                {
                    var msg = ex.Message.ToString();
                }
            }
            catch (Exception ex)
            {
                var msg = ex.Message.ToString();
            }
        }
コード例 #11
0
        /// <summary>
        /// 获取数据
        /// </summary>
        protected override void LoadData()
        {
            if (!NetUtil.CheckNetWork(CurrActivity))
            {
                ToastUtil.ShowWarningToast(CurrActivity, "网络未连接!");
                return;
            }
            LoadingDialogUtil.ShowLoadingDialog(CurrActivity, "获取数据中...");

            if (BaseApplication.GetInstance().quarterList == null)
            {
                BaseApplication.GetInstance().quarterList = RenewService.GetQuarter(CurrUserInfo.SchoolId);
            }
            if (BaseApplication.GetInstance().gradeList == null)
            {
                BaseApplication.GetInstance().gradeList = RenewService.GetGradeList(CurrUserInfo.SchoolId);
            }
            if (BaseApplication.GetInstance().districtList == null)
            {
                BaseApplication.GetInstance().districtList = RenewService.GetDistrictList(CurrUserInfo.SchoolId);
            }

            if (BaseApplication.GetInstance().quarterList != null && BaseApplication.GetInstance().quarterList.Any())
            {
                quarterList = BaseApplication.GetInstance().quarterList;
            }
            if (searchQuarter != null)
            {
                tv_btn1.Text = searchQuarter.QuarterName;
            }
            else
            {
                if (BaseApplication.GetInstance().quarterList != null && BaseApplication.GetInstance().quarterList.Any())
                {
                    searchQuarter = BaseApplication.GetInstance().quarterList.Find(t => t.IsCurrent);
                    tv_btn1.Text  = searchQuarter.QuarterName;
                }
            }
            if (BaseApplication.GetInstance().gradeList != null && BaseApplication.GetInstance().gradeList.Any())
            {
                gradeList = new List <string>(BaseApplication.GetInstance().gradeList.Select(i => i.GradeName).ToArray());
            }
            if (searchGradeList != null && searchGradeList.Any())
            {
                var selectedgrade = "全部年级";
                if (searchGradeList.Count > 0 && searchGradeList.Count != gradeList.Count)
                {
                    selectedgrade = string.Join(",", searchGradeList.ToArray());
                }

                tv_btn2.Text = selectedgrade;
            }
            else
            {
                // 默认全选
                searchGradeList = new List <string>(gradeList.ToArray());
            }
            if (BaseApplication.GetInstance().districtList != null && BaseApplication.GetInstance().districtList.Any())
            {
                districtList = new List <string>(BaseApplication.GetInstance().districtList.Select(i => i.DistrictName).ToArray());
            }
            if (!string.IsNullOrEmpty(searchDistrict))
            {
                tv_btn3.Text = searchDistrict;
            }


            LoadingDialogUtil.ShowLoadingDialog(CurrActivity, "获取数据中...");
            GetRenewInfoInTeacherByGroupCode();
        }
コード例 #12
0
        protected void LoadData()
        {
            if (!NetUtil.CheckNetWork(CurrActivity))
            {
                ToastUtil.ShowWarningToast(CurrActivity, "网络未连接!");
                return;
            }

            //财年数据
            if (BaseApplication.GetInstance().quarterList == null)
            {
                BaseApplication.GetInstance().quarterList = RenewService.GetQuarter(CurrUserInfo.SchoolId);
            }
            //区域数据
            if (BaseApplication.GetInstance().districtList == null)
            {
                BaseApplication.GetInstance().districtList = RenewService.GetDistrictList(CurrUserInfo.SchoolId);
            }
            //年级数据
            if (BaseApplication.GetInstance().gradeList == null)
            {
                BaseApplication.GetInstance().gradeList = RenewService.GetGradeList(CurrUserInfo.SchoolId);
            }
            //科目数据
            if (BaseApplication.GetInstance().courseList == null)
            {
                BaseApplication.GetInstance().courseList = DistrictService.GetCourseList(CurrUserInfo.SchoolId);
            }

            //默认财年
            if (BaseApplication.GetInstance().quarterList != null && BaseApplication.GetInstance().quarterList.Any())
            {
                quarterList   = BaseApplication.GetInstance().quarterList;
                searchQuarter = BaseApplication.GetInstance().quarterList.Find(t => t.IsCurrent);
                tv_year.Text  = searchQuarter.QuarterName;
            }
            //默认区域
            if (BaseApplication.GetInstance().districtList != null && BaseApplication.GetInstance().districtList.Any())
            {
                districtList = new List <string>(BaseApplication.GetInstance().districtList.Select(i => i.DistrictName).ToArray());
                //加区域的权限判断--区域经理登录
                if (CurrUserInfo.Type == (int)UserType.AreaManager)
                {
                    districtList     = districtList.Where(p => p == CurrUserInfo.DistrictName).ToList();
                    tv_district.Text = CurrUserInfo.DistrictName;
                    searchDistrict   = CurrUserInfo.DistrictName;
                }
            }
            //默认年级
            if (BaseApplication.GetInstance().gradeList != null && BaseApplication.GetInstance().gradeList.Any())
            {
                gradeList = new List <string>(BaseApplication.GetInstance().gradeList.Select(i => i.GradeName).ToArray());
            }
            if (searchGradeList != null && searchGradeList.Any())
            {
                var selectedgrade = "全部年级";
                if (searchGradeList.Count > 0 && searchGradeList.Count != gradeList.Count)
                {
                    selectedgrade = string.Join(",", searchGradeList.ToArray());
                }

                tv_grade.Text = selectedgrade;
            }
            else
            {
                // 默认全选
                searchGradeList = new List <string>(gradeList.ToArray());
            }
            //默认科目
            if (BaseApplication.GetInstance().courseList != null && BaseApplication.GetInstance().courseList.Any())
            {
                courseList     = new List <string>(BaseApplication.GetInstance().courseList.Select(t => t.CourseName).ToArray());
                searchCourse   = BaseApplication.GetInstance().courseList[0].CourseName;
                tv_course.Text = searchCourse;
            }

            BindData();
        }