コード例 #1
0
        public void OnItemClick(View itemView, int position)
        {
            var reportItem = teachReportList[position];

            if (!string.IsNullOrEmpty(reportItem.Item2))
            {
                //Toast.MakeText(CurrActivity, reportItem.Item3, ToastLength.Short).Show();
                Intent intent = new Intent(CurrActivity, typeof(ReportListByGroup));
                intent.PutExtra("reportJsonStr", JsonSerializer.ToJsonString(reportItem));
                // 搜索条件
                intent.PutExtra("searchQuarter", JsonSerializer.ToJsonString <QuarterEntity>(searchQuarter));
                var selectedgrade = "";
                if (searchGradeList.Count != gradeList.Count)
                {
                    selectedgrade = string.Join(",", searchGradeList.ToArray());
                }
                intent.PutExtra("searchGradeList", selectedgrade);
                intent.PutExtra("searchDistrict", searchDistrict);
                intent.PutExtra("avgRenewRate", reportItem.Item6.ToString());

                intent.PutExtra("classStatus", classStatus);

                StartActivity(intent);
                CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
            }
        }
コード例 #2
0
        public void OnItemClick(View itemView, int position)
        {
            var    assistantItem = assistantList[position];
            Intent intent        = new Intent(CurrActivity, typeof(AssistantAddActivity));

            intent.PutExtra("assistantJsonStr", JsonSerializer.ToJsonString(assistantItem));
            StartActivity(intent);
            CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
        }
コード例 #3
0
        public void OnItemClick(View itemView, int position)
        {
            var    teacherItem = teacherList[position];
            Intent intent      = new Intent(CurrActivity, typeof(TeacherAddActivity));

            intent.PutExtra("scopeName", teacherItem.ScopeName);
            intent.PutExtra("teacherJsonStr", JsonSerializer.ToJsonString(teacherItem));
            StartActivity(intent);
            CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
        }
コード例 #4
0
ファイル: MineFragment.cs プロジェクト: NingMoe/ybk_manager
        /// <summary>
        /// 退出登录
        /// </summary>
        public void DoLogout()
        {
            SharedPreferencesUtil.SetParam(CurrActivity, AppConfig.SP_USERINFO, "");

            Intent intent = new Intent(CurrActivity, typeof(Login));

            StartActivity(intent);
            CurrActivity.Finish();
            CurrActivity.OverridePendingTransition(Android.Resource.Animation.FadeIn, Android.Resource.Animation.FadeOut);
        }
コード例 #5
0
        /// <summary>
        /// 行点击事件
        /// </summary>
        public void OnItemClick(View itemView, int position)
        {
            var    data   = shopManagerList[position];
            Intent intent = new Intent(CurrActivity, typeof(ShopManagerAddActivity));

            intent.PutExtra("areaCodes", data.AreaCodes);
            intent.PutExtra("areaNames", data.AreaNames);
            intent.PutExtra("ShopManagerJsonStr", JsonSerializer.ToJsonString(data));
            StartActivity(intent);
            CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
        }
コード例 #6
0
ファイル: TeacherManage.cs プロジェクト: NingMoe/ybk_manager
        public void OnItemClick(View itemView, int position)
        {
            var    scopeItem = teachScopeList[position];
            Intent intent    = new Intent(CurrActivity, typeof(TeacherListActivity));

            intent.PutExtra("scopeId", scopeItem.Id);
            intent.PutExtra("scopeName", scopeItem.Name);
            intent.PutExtra("teacherCount", scopeItem.TeacherCount ?? 0);
            StartActivity(intent);
            CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
        }
コード例 #7
0
ファイル: MineFragment.cs プロジェクト: NingMoe/ybk_manager
        /// <summary>
        /// 页面事件
        /// </summary>
        protected void InitEvents()
        {
            // 教师管理
            rlTeacherManage.Click += (sender, e) =>
            {
                if (CurrUserInfo.Type == (int)UserType.TeacherDirector)
                {
                    Intent intent = new Intent(CurrActivity, typeof(TeacherListActivity));
                    intent.PutExtra("scopeId", int.Parse(CurrUserInfo.ScopeCode ?? "0"));
                    intent.PutExtra("scopeName", CurrUserInfo.ScopeName);

                    var teacherTotalCount = 0;
                    var scopeTeacherList  = new DataService.MeService().GetTeacherListByScope(CurrUserInfo.SchoolId, int.Parse(CurrUserInfo.ScopeCode), 1, 1, out teacherTotalCount);
                    intent.PutExtra("teacherCount", teacherTotalCount);

                    StartActivity(intent);
                    CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
                }
                else
                {
                    Intent intent = new Intent(CurrActivity, typeof(TeacherManage));
                    StartActivity(intent);
                    CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
                }
            };
            // 教学主管
            rlDirector.Click += (sender, e) =>
            {
                Intent intent = new Intent(CurrActivity, typeof(DirectorListActivity));
                StartActivity(intent);
                CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
            };
            // 助教组长
            rlAssistantLeader.Click += (sender, e) =>
            {
                Intent intent = new Intent(CurrActivity, typeof(AssistantLeaderList));
                StartActivity(intent);
                CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
            };
            // 店长管理
            rlShopManager.Click += (sender, e) =>
            {
                Intent intent = new Intent(CurrActivity, typeof(ShopManagerListActivity));
                StartActivity(intent);
                CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
            };
            // 退出操作
            rlLogout.Click += (sender, e) =>
            {
                var callbackFunc = new AppUtils.ShowDialogClick(CallbackFun);
                AppUtils.ShowDialog(CurrActivity, "提示", "您确认要退出账号吗?", 2, callbackFunc);
            };
        }
コード例 #8
0
        public void OnItemClick(View itemView, int position)
        {
            var renewItem = renewInfoList[position];

            if (renewItem.ID > 0)
            {
                Intent intent = new Intent(CurrActivity, typeof(ClassRenewInfo));
                intent.PutExtra("renewJsonStr", JsonSerializer.ToJsonString(renewItem));

                intent.PutExtra("classStatus", classStatus);

                StartActivity(intent);
                CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
            }
        }
コード例 #9
0
        /// <summary>
        /// 初始化事件
        /// </summary>
        protected override void InitEvents()
        {
            // 返回
            FindViewById <ImageButton>(Resource.Id.imgBtn_back).Click += (sender, e) =>
            {
                CurrActivity.Finish();
                OverridePendingTransition(Resource.Animation.left_in, Resource.Animation.right_out);
            };

            llAdd.Click += (sender, e) =>
            {
                Intent intent = new Intent(CurrActivity, typeof(ShopManagerAddActivity));
                StartActivity(intent);
                CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
            };
        }
コード例 #10
0
        protected override void InitEvents()
        {
            // 返回
            imgbtnBack.Click += (sender, e) =>
            {
                CurrActivity.Finish();
                OverridePendingTransition(Resource.Animation.left_in, Resource.Animation.right_out);
            };

            // 选择教研组
            rlGroup.Click += (sender, e) =>
            {
                Intent intent = new Intent(CurrActivity, typeof(TeacherScopeSelectActivity));
                intent.PutExtra("scopeId", tScopeCode);
                StartActivityForResult(intent, 1);
                CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
            };

            // 选择角色
            rlRole.Click += (sender, e) =>
            {
                Intent intent = new Intent(CurrActivity, typeof(TeacherRoleSelectActivity));
                intent.PutExtra("roleId", tType);
                StartActivityForResult(intent, 0);
                CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
            };

            btnAdd.Click += (sender, e) =>
            {
                DoSave(true);
            };

            tvSave.Click += (sender, e) =>
            {
                DoSave(false);
            };

            btnDelete.Click += (sender, e) =>
            {
                var callbackFunc = new AppUtils.ShowDialogClick(CallbackFun);
                AppUtils.ShowDialog(CurrActivity, "提示", "您确认要删除此信息吗?", 2, callbackFunc);
            };
        }
コード例 #11
0
        protected override void InitEvents()
        {
            // 取消
            FindViewById <TextView>(Resource.Id.tv_cancel).Click += (sender, e) =>
            {
                CurrActivity.Finish();
                OverridePendingTransition(Resource.Animation.left_in, Resource.Animation.right_out);
            };

            // 选择学区
            rlArea.Click += (sender, e) =>
            {
                Intent intent = new Intent(CurrActivity, typeof(AreaSelectActivity));
                intent.PutExtra("sname", currAssistant.AreaName);
                StartActivityForResult(intent, 0);
                CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
            };

            btnAdd.Click += (sender, e) =>
            {
                DoSave(true);
            };

            tvSave.Click += (sender, e) =>
            {
                if (isNewAdd)
                {
                    DoSave(false);
                }
                else
                {
                    DoUpdate();
                }
            };

            btnDelete.Click += (sender, e) =>
            {
                var callbackFunc = new AppUtils.ShowDialogClick(CallbackFun);
                AppUtils.ShowDialog(CurrActivity, "提示", "您确认要删除此账号吗?", 2, callbackFunc);
            };
        }
コード例 #12
0
        /// <summary>
        /// 初始化事件
        /// </summary>
        protected override void InitEvents()
        {
            // 返回
            imgbtnBack.Click += (sender, e) =>
            {
                CurrActivity.Finish();
                OverridePendingTransition(Resource.Animation.left_in, Resource.Animation.right_out);
            };

            // 选择负责校区
            rlAreas.Click += (sender, e) =>
            {
                Intent intent = new Intent(CurrActivity, typeof(AreaSelectMultiActivity));
                if (currShopManager != null)
                {
                    intent.PutExtra("areaCodes", AreaCodes);
                }
                StartActivityForResult(intent, 1);
                CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
            };
            //保存并继续添加
            btnAdd.Click += (sender, e) =>
            {
                DoSave(true);
            };
            //完成
            tvSave.Click += (sender, e) =>
            {
                DoSave(false);
            };
            //删除
            btnDelete.Click += (sender, e) =>
            {
                var callbackFunc = new AppUtils.ShowDialogClick(CallbackFun);
                AppUtils.ShowDialog(CurrActivity, "提示", "您确认要删除此信息吗?", 2, callbackFunc);
            };
        }
コード例 #13
0
ファイル: ClassRenewInfo.cs プロジェクト: NingMoe/ybk_manager
        private void LoadStudents()
        {
            var screenWidth  = Resources.DisplayMetrics.WidthPixels;
            var screenHeight = Resources.DisplayMetrics.HeightPixels;

            var view = FindViewById <RelativeLayout>(Resource.Id.ll_top);

            view.Measure(0, 0);
            var height = view.MeasuredHeight;

            height = screenHeight - height - AppUtils.dip2px(CurrContext, 45 + 30 + 30);

            if ((int)(Build.VERSION.SdkInt) < 21)
            {
                {
                    Rect frame = new Rect();
                    Window.DecorView.GetWindowVisibleDisplayFrame(frame);
                    var statusBarHeight = frame.Top;
                    height = height - statusBarHeight;
                }
            }

            // 计算头像的高度(容器高度-上下padding-姓名的view高度)*0.8
            var avatarHeihgt = (int)(((height / 2 - AppUtils.dip2px(CurrContext, (2 * 15 + 2 * 30))) / 2));


            var wrapperWidth = screenWidth - AppUtils.dip2px(CurrContext, 24);
            var itemWidth    = avatarHeihgt;//(int)Math.Round((wrapperWidth / avatarColumns) * 0.8);
            var marginRight  = (wrapperWidth - itemWidth * avatarColumns) / 3;

            // 设置scrollview高度(2行高度)
            var scrollviewHeight = (itemWidth + AppUtils.dip2px(CurrContext, 30)) * 2;

            LinearLayout.LayoutParams scrollParas = new LinearLayout.LayoutParams(wrapperWidth, scrollviewHeight);
            scrolllview_1.LayoutParameters = scrollParas;
            scrolllview_2.LayoutParameters = scrollParas;

            tv_renewNum.Text = string.Format("已续班({0}人)", renewStudentList.Count);
            for (var i = 0; i < renewStudentList.Count; i++)
            {
                var student = renewStudentList[i];

                var itemBox = LayoutInflater.From(CurrContext).Inflate(Resource.Layout.item_renew_avatar, gridlayout_1, false);

                ImageView ivAvatar = itemBox.FindViewById <ImageView>(Resource.Id.iv_avatar);
                // 设置照片宽度和高度
                var avatarWidth  = itemWidth;
                var avatarHeight = avatarWidth;
                LinearLayout.LayoutParams parasAvatar = new LinearLayout.LayoutParams(avatarWidth, avatarHeight);
                parasAvatar.Gravity       = GravityFlags.Center;
                ivAvatar.LayoutParameters = parasAvatar;
                if (!string.IsNullOrEmpty(student.avatar))
                {
                    picasso.Load(student.avatar).Placeholder(Resource.Drawable.avatar_student).Error(Resource.Drawable.avatar_student)
                    .Transform(new CircleImageTransformation(picasso))
                    .Into(ivAvatar);
                }
                else
                {
                    picasso.Load(Resource.Drawable.avatar_student).Placeholder(Resource.Drawable.avatar_student).Error(Resource.Drawable.avatar_student)
                    .Transform(new CircleImageTransformation(picasso))
                    .Into(ivAvatar);
                }

                TextView tvName = itemBox.FindViewById <TextView>(Resource.Id.tv_name);
                tvName.Text = student.name;
                if (avatarHeihgt < 60)
                {
                    tvName.SetTextSize(Android.Util.ComplexUnitType.Sp, 11);
                }

                GridLayout.LayoutParams parasBox = new GridLayout.LayoutParams();
                parasBox.Width = itemWidth;
                if (i % avatarColumns != 3)
                {
                    parasBox.RightMargin = marginRight;
                }
                itemBox.LayoutParameters = parasBox;
                gridlayout_1.AddView(itemBox);

                // 添加点击事件
                itemBox.Click += (sender, e) =>
                {
                    Intent intent = new Intent(CurrActivity, typeof(StuentClassActivity));
                    intent.PutExtra("studentJsonStr", JsonSerializer.ToJsonString(student));
                    StartActivity(intent);
                    CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
                };
            }

            tv_noRenewNum.Text = string.Format("未续班({0}人)", notRenewStudentList.Count);
            for (var i = 0; i < notRenewStudentList.Count; i++)
            {
                var student = notRenewStudentList[i];

                var itemBox = LayoutInflater.From(CurrContext).Inflate(Resource.Layout.item_renew_avatar, gridlayout_2, false);

                ImageView ivAvatar = itemBox.FindViewById <ImageView>(Resource.Id.iv_avatar);
                // 设置照片宽度和高度
                var avatarWidth  = itemWidth;
                var avatarHeight = avatarWidth;
                LinearLayout.LayoutParams parasAvatar = new LinearLayout.LayoutParams(avatarWidth, avatarHeight);
                parasAvatar.Gravity       = GravityFlags.Center;
                ivAvatar.LayoutParameters = parasAvatar;
                if (!string.IsNullOrEmpty(student.avatar))
                {
                    picasso.Load(student.avatar).Placeholder(Resource.Drawable.avatar_student).Error(Resource.Drawable.avatar_student)
                    .Transform(new CircleImageTransformation(picasso))
                    .Into(ivAvatar);
                }

                TextView tvName = itemBox.FindViewById <TextView>(Resource.Id.tv_name);
                tvName.Text = student.name;

                GridLayout.LayoutParams parasBox = new GridLayout.LayoutParams();
                parasBox.Width = itemWidth;
                if (i % avatarColumns != 3)
                {
                    parasBox.RightMargin = marginRight;
                }
                itemBox.LayoutParameters = parasBox;
                gridlayout_2.AddView(itemBox);

                // 添加点击事件
                itemBox.Click += (sender, e) =>
                {
                    Intent intent = new Intent(CurrActivity, typeof(StuentClassActivity));
                    intent.PutExtra("studentJsonStr", JsonSerializer.ToJsonString(student));
                    StartActivity(intent);
                    CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
                };
            }
        }