Exemple #1
0
        public void clickFinancialYear(QuarterEntity quarter)
        {
            if (financialYearPopWin.IsShowing)
            {
                financialYearPopWin.Dismiss();
            }

            if (BaseApplication.GetInstance().quarterList != null && BaseApplication.GetInstance().quarterList.Any())
            {
                var selected = BaseApplication.GetInstance().quarterList.FirstOrDefault(i => i.IsCurrent);
                if (quarter.QuarterName == selected.QuarterName)
                {
                    return;
                }
                foreach (var item in BaseApplication.GetInstance().quarterList)
                {
                    if (quarter.QuarterName == item.QuarterName)
                    {
                        item.IsCurrent = true;
                    }
                    else
                    {
                        item.IsCurrent = false;
                    }
                }
                financialYearPopWin.SetSelectedColor();
                GetRenewData();
            }
        }
Exemple #2
0
        protected override void InitVariables()
        {
            Bundle bundle = Intent.Extras;

            if (bundle != null)
            {
                var reportJsonStr = bundle.GetString("reportJsonStr");
                currReportInfo = JsonSerializer.ToObject <RenewInfo>(reportJsonStr);

                avgRenewRateScope = decimal.Parse(bundle.GetString("avgRenewRate", "1"));

                var searchQuarterJsonStr = bundle.GetString("searchQuarter");
                searchQuarter = JsonSerializer.ToObject <QuarterEntity>(searchQuarterJsonStr);
                var searchGradeListStr = bundle.GetString("searchGradeList");
                if (!string.IsNullOrEmpty(searchGradeListStr))
                {
                    searchGradeList = searchGradeListStr.Split(',').ToList();
                }
                searchDistrict = bundle.GetString("searchDistrict");

                classStatus = bundle.GetInt("classStatus");


                Android.Util.Log.Verbose("classStatus-1", classStatus.ToString());
            }

            Android.Util.Log.Verbose("classStatus-2", classStatus.ToString());
        }
Exemple #3
0
 public void SetData(List <PaymentSumAreaEntity> data, decimal avgGrowthRate, QuarterEntity searchQuarter, int dataType, string searchCourse)
 {
     this.sumList       = data;
     this.avgGrowthRate = avgGrowthRate;
     this.searchQuarter = searchQuarter;
     this.dataType      = dataType;
     this.searchCourse  = searchCourse;
 }
Exemple #4
0
        public SumAccountAdapter2(Context context, List <PaymentSumBaseEntity> gradeSumList, decimal avgGrowthRate, QuarterEntity searchQuarter, int dataType, string searchCourse, string areaCode, string areaName)
        {
            this.mContext            = context;
            this.dynamicGradeSumList = gradeSumList;
            this.avgGrowthRate       = avgGrowthRate;

            this.searchQuarter = searchQuarter;
            this.dataType      = dataType;
            this.searchCourse  = searchCourse;
            this.areaCode      = areaCode;
            this.areaName      = areaName;
        }
Exemple #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();
        }
Exemple #6
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();
        }
Exemple #7
0
        public void OnClick(View v)
        {
            if (v.Id == Resource.Id.tv_year)
            {
                #region Quarter
                if (quarterList != null && quarterList.Any())
                {
                    if (popYear == null)
                    {
                        View                 popViwe1  = layoutInflater.Inflate(Resource.Layout.popup_select1, null);
                        ListView             listview1 = popViwe1.FindViewById <ListView>(Resource.Id.lv);
                        QuarterSelectAdapter adaptera  = new QuarterSelectAdapter(CurrActivity, quarterList);
                        adaptera.SetSelectedValue(searchQuarter.QuarterName);
                        listview1.Adapter = adaptera;

                        popYear                  = new PopupWindow(popViwe1, ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
                        popYear.Touchable        = true;
                        popYear.Focusable        = true;
                        popYear.OutsideTouchable = false;
                        popYear.SetBackgroundDrawable(new BitmapDrawable());

                        popYear.DismissEvent += (sender, e) =>
                        {
                            tv_year.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorPrimary)));
                            var arrowDown = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.arrow_down);
                            arrowDown.SetBounds(0, 0, arrowDown.MinimumWidth, arrowDown.MinimumHeight);
                            tv_year.SetCompoundDrawables(null, null, arrowDown, null);
                        };
                        //每一行的点击事件
                        listview1.ItemClick += (sender, e) =>
                        {
                            searchQuarter = this.quarterList[e.Position];
                            tv_year.Text  = searchQuarter.QuarterName;

                            popYear.Dismiss();

                            adaptera.SetSelectedValue(searchQuarter.QuarterName);
                            adaptera.NotifyDataSetChanged();

                            BindData();
                        };
                    }
                    if (!popYear.IsShowing)
                    {
                        tv_year.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorHigh)));
                        var arrowDownOn = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.arrow_down_on);
                        arrowDownOn.SetBounds(0, 0, arrowDownOn.MinimumWidth, arrowDownOn.MinimumHeight);
                        tv_year.SetCompoundDrawables(null, null, arrowDownOn, null);

                        if ((int)(Build.VERSION.SdkInt) >= 24)
                        {
                            int[] a = new int[2];
                            v.GetLocationInWindow(a);
                            popYear.ShowAtLocation(this.Activity.Window.DecorView, GravityFlags.NoGravity, 0, a[1] + v.Height + AppUtils.dip2px(CurrActivity, 11));
                        }
                        else
                        {
                            popYear.ShowAsDropDown(v, 0, AppUtils.dip2px(CurrActivity, 11));
                        }
                    }
                }
                #endregion
            }
            else if (v.Id == Resource.Id.tv_district)
            {
                #region Distirct
                if (districtList != null && districtList.Any())
                {
                    if (popDistrict == null)
                    {
                        View     popViwe3              = layoutInflater.Inflate(Resource.Layout.popup_select1, null);
                        ListView listview3             = popViwe3.FindViewById <ListView>(Resource.Id.lv);
                        DistrictSelectAdapter adaptera = new DistrictSelectAdapter(CurrActivity, districtList);
                        adaptera.SetSelectedValue(searchDistrict);
                        listview3.Adapter = adaptera;

                        popDistrict                  = new PopupWindow(popViwe3, ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
                        popDistrict.Touchable        = true;
                        popDistrict.Focusable        = true;
                        popDistrict.OutsideTouchable = true;;
                        popDistrict.SetBackgroundDrawable(new BitmapDrawable());

                        popDistrict.DismissEvent += (sender, e) =>
                        {
                            tv_district.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorPrimary)));
                            var arrowDown = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.arrow_down);
                            arrowDown.SetBounds(0, 0, arrowDown.MinimumWidth, arrowDown.MinimumHeight);
                            tv_district.SetCompoundDrawables(null, null, arrowDown, null);
                        };
                        //每一行的点击事件
                        listview3.ItemClick += (sender, e) =>
                        {
                            searchDistrict   = this.districtList[e.Position];
                            tv_district.Text = searchDistrict;

                            popDistrict.Dismiss();

                            adaptera.SetSelectedValue(searchDistrict);
                            adaptera.NotifyDataSetChanged();

                            BindData();
                        };
                    }
                    if (!popDistrict.IsShowing)
                    {
                        tv_district.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorHigh)));
                        var arrowDownOn = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.arrow_down_on);
                        arrowDownOn.SetBounds(0, 0, arrowDownOn.MinimumWidth, arrowDownOn.MinimumHeight);
                        tv_district.SetCompoundDrawables(null, null, arrowDownOn, null);

                        if ((int)(Build.VERSION.SdkInt) >= 24)
                        {
                            int[] a = new int[2];
                            v.GetLocationInWindow(a);
                            popDistrict.ShowAtLocation(this.Activity.Window.DecorView, GravityFlags.NoGravity, 0, a[1] + v.Height + AppUtils.dip2px(CurrActivity, 11));
                        }
                        else
                        {
                            popDistrict.ShowAsDropDown(v, 0, AppUtils.dip2px(CurrActivity, 11));
                        }
                    }
                }
                #endregion
            }
            else if (v.Id == Resource.Id.tv_category)
            {
                #region Category
                if (categoryList != null && categoryList.Any())
                {
                    if (popCategory == null)
                    {
                        View                popViwe3  = layoutInflater.Inflate(Resource.Layout.popup_select1, null);
                        ListView            listview3 = popViwe3.FindViewById <ListView>(Resource.Id.lv);
                        CourseSelectAdapter adaptera  = new CourseSelectAdapter(CurrActivity, categoryList);
                        adaptera.SetSelectedValue(searchCagetory);
                        listview3.Adapter = adaptera;

                        popCategory                  = new PopupWindow(popViwe3, ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
                        popCategory.Touchable        = true;
                        popCategory.Focusable        = true;
                        popCategory.OutsideTouchable = true;;
                        popCategory.SetBackgroundDrawable(new BitmapDrawable());

                        popCategory.DismissEvent += (sender, e) =>
                        {
                            tv_cagetory.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorPrimary)));
                            var arrowDown = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.arrow_down);
                            arrowDown.SetBounds(0, 0, arrowDown.MinimumWidth, arrowDown.MinimumHeight);
                            tv_cagetory.SetCompoundDrawables(null, null, arrowDown, null);
                        };

                        listview3.ItemClick += (sender, e) =>
                        {
                            searchCagetory   = this.categoryList[e.Position];
                            tv_cagetory.Text = searchCagetory;

                            popCategory.Dismiss();

                            adaptera.SetSelectedValue(searchCagetory);
                            adaptera.NotifyDataSetChanged();

                            BindData();
                        };
                    }
                    if (!popCategory.IsShowing)
                    {
                        tv_cagetory.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorHigh)));
                        var arrowDownOn = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.arrow_down_on);
                        arrowDownOn.SetBounds(0, 0, arrowDownOn.MinimumWidth, arrowDownOn.MinimumHeight);
                        tv_cagetory.SetCompoundDrawables(null, null, arrowDownOn, null);

                        if ((int)(Build.VERSION.SdkInt) >= 24)
                        {
                            int[] a = new int[2];
                            v.GetLocationInWindow(a);
                            popCategory.ShowAtLocation(this.Activity.Window.DecorView, GravityFlags.NoGravity, 0, a[1] + v.Height + AppUtils.dip2px(CurrActivity, 11));
                        }
                        else
                        {
                            popCategory.ShowAsDropDown(v, 0, AppUtils.dip2px(CurrActivity, 11));
                        }
                    }
                }
                #endregion
            }
        }
Exemple #8
0
        /// <summary>
        /// 页面点击事件处理
        /// </summary>
        /// <param name="v">V.</param>
        public void OnClick(View v)
        {
            if (v.Id == Resource.Id.tv_btn1)
            {
                if (quarterList != null && quarterList.Any())
                {
                    if (popWin1 == null)
                    {
                        View                 popViwe1  = layoutInflater.Inflate(Resource.Layout.popup_select1, null);
                        ListView             listview1 = popViwe1.FindViewById <ListView>(Resource.Id.lv);
                        QuarterSelectAdapter adaptera  = new QuarterSelectAdapter(CurrActivity, quarterList);
                        adaptera.SetSelectedValue(searchQuarter.QuarterName);
                        listview1.Adapter = adaptera;

                        popWin1                  = new PopupWindow(popViwe1, ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
                        popWin1.Touchable        = true;
                        popWin1.Focusable        = true;
                        popWin1.OutsideTouchable = false;
                        popWin1.SetBackgroundDrawable(new BitmapDrawable());

                        popWin1.DismissEvent += (sender, e) =>
                        {
                            tv_btn1.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorPrimary)));
                            var arrowDown = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.arrow_down);
                            arrowDown.SetBounds(0, 0, arrowDown.MinimumWidth, arrowDown.MinimumHeight);
                            tv_btn1.SetCompoundDrawables(null, null, arrowDown, null);
                        };

                        listview1.ItemClick += (sender, e) =>
                        {
                            searchQuarter = this.quarterList[e.Position];
                            tv_btn1.Text  = searchQuarter.QuarterName;

                            popWin1.Dismiss();

                            adaptera.SetSelectedValue(searchQuarter.QuarterName);
                            adaptera.NotifyDataSetChanged();

                            //Toast.MakeText(CurrActivity, searchQuarter.QuarterName, ToastLength.Short).Show();
                            GetRenewInfoInGroup();
                        };
                    }
                    if (!popWin1.IsShowing)
                    {
                        tv_btn1.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorHigh)));
                        var arrowDownOn = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.arrow_down_on);
                        arrowDownOn.SetBounds(0, 0, arrowDownOn.MinimumWidth, arrowDownOn.MinimumHeight);
                        tv_btn1.SetCompoundDrawables(null, null, arrowDownOn, null);

                        if ((int)(Build.VERSION.SdkInt) >= 24)
                        {
                            int[] a = new int[2];
                            v.GetLocationInWindow(a);
                            popWin1.ShowAtLocation(this.Activity.Window.DecorView, GravityFlags.NoGravity, 0, a[1] + v.Height + AppUtils.dip2px(CurrActivity, 11));
                        }
                        else
                        {
                            popWin1.ShowAsDropDown(v, 0, AppUtils.dip2px(CurrActivity, 11));
                        }
                    }
                }
            }
            else if (v.Id == Resource.Id.tv_btn2)
            {
                if (gradeList != null && gradeList.Any())
                {
                    if (popWin2 == null)
                    {
                        View   popViwe2 = layoutInflater.Inflate(Resource.Layout.popup_grade, null);
                        Button btnOk    = popViwe2.FindViewById <Button>(Resource.Id.btn_ok);

                        var screenWidth  = Resources.DisplayMetrics.WidthPixels;
                        var wrapperWidth = screenWidth - AppUtils.dip2px(CurrActivity, 24);
                        var itemWidth    = (int)Math.Round((wrapperWidth / 4) * 0.8);
                        var marginRight  = (wrapperWidth - itemWidth * 4) / 3;

                        var tvAll = popViwe2.FindViewById <TextView>(Resource.Id.tv_all);
                        ViewGroup.LayoutParams tvallParams = tvAll.LayoutParameters;
                        tvallParams.Width      = itemWidth;
                        tvAll.LayoutParameters = tvallParams;

                        GridLayout gridlayout_1 = popViwe2.FindViewById <GridLayout>(Resource.Id.gridlayout_1);
                        for (var i = 0; i < gradeList.Count; i++)
                        {
                            TextView tvGrade   = new TextView(CurrActivity);
                            var      itemGrade = gradeList[i];
                            GridLayout.LayoutParams gradeParams = new GridLayout.LayoutParams();
                            gradeParams.Width = itemWidth;
                            //parasBox.Height =
                            if (i % 4 != 3)
                            {
                                gradeParams.RightMargin = marginRight;
                            }
                            gradeParams.TopMargin    = AppUtils.dip2px(CurrActivity, 5);
                            gradeParams.BottomMargin = AppUtils.dip2px(CurrActivity, 5);
                            tvGrade.LayoutParameters = gradeParams;
                            tvGrade.Text             = itemGrade;
                            tvGrade.TextSize         = 14;
                            tvGrade.Gravity          = GravityFlags.Center;
                            tvGrade.Background       = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.textview_bg_on);
                            tvGrade.SetPadding(0, AppUtils.dip2px(CurrActivity, 5), 0, AppUtils.dip2px(CurrActivity, 5));
                            tvGrade.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorHigh)));

                            gridlayout_1.AddView(tvGrade);

                            #region tvGrade.Click
                            tvGrade.Click += (sender, e) =>
                            {
                                if (!searchGradeList.Contains(itemGrade))
                                {
                                    searchGradeList.Add(itemGrade);

                                    tvGrade.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorHigh)));
                                    tvGrade.Background = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.textview_bg_on);
                                }
                                else
                                {
                                    searchGradeList.Remove(itemGrade);

                                    tvGrade.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorSecond)));
                                    tvGrade.Background = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.textview_bg);

                                    tvAll.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorSecond)));
                                    tvAll.Background = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.textview_bg);
                                }

                                //控制全部年级按钮颜色
                                if (gradeList.Count == searchGradeList.Count)
                                {
                                    tvAll.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorHigh)));
                                    tvAll.Background = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.textview_bg_on);
                                }
                                //控制确定按钮是否可用
                                if (searchGradeList.Count == 0)
                                {
                                    btnOk.Enabled = false;
                                    btnOk.SetBackgroundResource(Resource.Drawable.button_bg_disabled);
                                }
                                else
                                {
                                    btnOk.Enabled = true;
                                    btnOk.SetBackgroundResource(Resource.Drawable.button_bg);
                                }
                            };
                        }
                        #endregion

                        #region tvAll.Click
                        tvAll.Click += (sender, e) =>
                        {
                            if (tvAll.CurrentTextColor == ContextCompat.GetColor(CurrActivity, Resource.Color.textColorHigh))
                            {
                                tvAll.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorSecond)));
                                tvAll.Background = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.textview_bg);

                                for (var i = 0; i < gridlayout_1.ChildCount; i++)
                                {
                                    var tv = (TextView)gridlayout_1.GetChildAt(i);
                                    tv.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorSecond)));
                                    tv.Background = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.textview_bg);
                                }
                                searchGradeList = new List <string>();
                            }
                            else
                            {
                                tvAll.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorHigh)));
                                tvAll.Background = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.textview_bg_on);

                                for (var i = 0; i < gridlayout_1.ChildCount; i++)
                                {
                                    var tv = (TextView)gridlayout_1.GetChildAt(i);
                                    tv.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorHigh)));
                                    tv.Background = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.textview_bg_on);
                                }
                                searchGradeList = new List <string>(gradeList.ToArray());
                            }

                            //控制确定按钮是否可用
                            if (searchGradeList.Count == 0)
                            {
                                btnOk.Enabled = false;
                                btnOk.SetBackgroundResource(Resource.Drawable.button_bg_disabled);
                            }
                            else
                            {
                                btnOk.Enabled = true;
                                btnOk.SetBackgroundResource(Resource.Drawable.button_bg);
                            }
                        };
                        #endregion

                        #region btnOK.Click
                        btnOk.Click += (sender, e) =>
                        {
                            popWin2.Dismiss();
                            var selectedgrade = "全部年级";
                            if (searchGradeList.Count != gradeList.Count)
                            {
                                selectedgrade = string.Join(",", searchGradeList.ToArray());
                            }

                            tv_btn2.Text = selectedgrade;

                            GetRenewInfoInGroup();
                        };
                        #endregion

                        popWin2                  = new PopupWindow(popViwe2, ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
                        popWin2.Touchable        = true;
                        popWin2.Focusable        = true;
                        popWin2.OutsideTouchable = true;;
                        popWin2.SetBackgroundDrawable(new BitmapDrawable());

                        popWin2.DismissEvent += (sender, e) =>
                        {
                            tv_btn2.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorPrimary)));
                            var arrowDown = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.arrow_down);
                            arrowDown.SetBounds(0, 0, arrowDown.MinimumWidth, arrowDown.MinimumHeight);
                            tv_btn2.SetCompoundDrawables(null, null, arrowDown, null);
                        };
                    }
                    if (!popWin2.IsShowing)
                    {
                        tv_btn2.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorHigh)));
                        var arrowDownOn = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.arrow_down_on);
                        arrowDownOn.SetBounds(0, 0, arrowDownOn.MinimumWidth, arrowDownOn.MinimumHeight);
                        tv_btn2.SetCompoundDrawables(null, null, arrowDownOn, null);


                        if ((int)(Build.VERSION.SdkInt) >= 24)
                        {
                            int[] a = new int[2];
                            v.GetLocationInWindow(a);
                            popWin2.ShowAtLocation(this.Activity.Window.DecorView, GravityFlags.NoGravity, 0, a[1] + v.Height + AppUtils.dip2px(CurrActivity, 11));
                        }
                        else
                        {
                            popWin2.ShowAsDropDown(v, 0, AppUtils.dip2px(CurrActivity, 11));
                        }
                    }
                }
            }
            else if (v.Id == Resource.Id.tv_btn3)
            {
                if (districtList != null && districtList.Any())
                {
                    if (popWin3 == null)
                    {
                        View     popViwe3              = layoutInflater.Inflate(Resource.Layout.popup_select1, null);
                        ListView listview3             = popViwe3.FindViewById <ListView>(Resource.Id.lv);
                        DistrictSelectAdapter adaptera = new DistrictSelectAdapter(CurrActivity, districtList);
                        adaptera.SetSelectedValue(searchDistrict);
                        listview3.Adapter = adaptera;

                        popWin3                  = new PopupWindow(popViwe3, ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
                        popWin3.Touchable        = true;
                        popWin3.Focusable        = true;
                        popWin3.OutsideTouchable = true;;
                        popWin3.SetBackgroundDrawable(new BitmapDrawable());

                        popWin3.DismissEvent += (sender, e) =>
                        {
                            tv_btn3.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorPrimary)));
                            var arrowDown = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.arrow_down);
                            arrowDown.SetBounds(0, 0, arrowDown.MinimumWidth, arrowDown.MinimumHeight);
                            tv_btn3.SetCompoundDrawables(null, null, arrowDown, null);
                        };

                        listview3.ItemClick += (sender, e) =>
                        {
                            searchDistrict = this.districtList[e.Position];
                            tv_btn3.Text   = searchDistrict;

                            popWin3.Dismiss();

                            adaptera.SetSelectedValue(searchDistrict);
                            adaptera.NotifyDataSetChanged();

                            //Toast.MakeText(CurrActivity, searchDistrict, ToastLength.Short).Show();
                            GetRenewInfoInGroup();
                        };
                    }
                    if (!popWin3.IsShowing)
                    {
                        tv_btn3.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorHigh)));
                        var arrowDownOn = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.arrow_down_on);
                        arrowDownOn.SetBounds(0, 0, arrowDownOn.MinimumWidth, arrowDownOn.MinimumHeight);
                        tv_btn3.SetCompoundDrawables(null, null, arrowDownOn, null);

                        if ((int)(Build.VERSION.SdkInt) >= 24)
                        {
                            int[] a = new int[2];
                            v.GetLocationInWindow(a);
                            popWin3.ShowAtLocation(this.Activity.Window.DecorView, GravityFlags.NoGravity, 0, a[1] + v.Height + AppUtils.dip2px(CurrActivity, 11));
                        }
                        else
                        {
                            popWin3.ShowAsDropDown(v, 0, AppUtils.dip2px(CurrActivity, 11));
                        }
                    }
                }
            }
        }
Exemple #9
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();
        }
        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();
        }