Ejemplo n.º 1
0
        public course_list()
        {
            InitializeComponent();
            default_auth = new AuthSetting[] {
                new AuthSetting(Authority.CourseManage)
            };
            template = new ListTemplate();

            var cargs = new CreateArgs("api/courses/basic/", User.Api, "创建课程", Margin: new Thickness(0, 10, 0, 10));

            cargs.items.Add(new CreateArgs.Item("id", "课程编号", "text"));
            cargs.items.Add(new CreateArgs.Item("name", "课程名称", "text"));
            cargs.items.Add(new CreateArgs.Item("teacher", "教师(工号)", "text"));
            cargs.items.Add(new CreateArgs.Item("as_student_set", "学生列表(学号)", "multitext"));


            var args = new ListArgs("api/courses/basic/", User.Api, Title, Searchable: true, Createable: true, Createargs: cargs);

            args.columns.Add(new ListArgs.Column("id", "课程编号", ordering: "id",
                                                 hyperlink: ListArgs.autohyperlink("course-instance").add("id").lambda));
            args.columns.Add(new ListArgs.Column("name", "课程名称", ordering: "name",
                                                 hyperlink: ListArgs.autohyperlink("course-instance").add("id").lambda));
            args.columns.Add(new ListArgs.Column("teacher", "任课教师", ordering: "teacher",
                                                 hyperlink: ListArgs.autohyperlink("teacher-other-document").add("id", "teacher").lambda));

            template.Construct(args);
            ContentGrid.Children.Add(template);
        }
Ejemplo n.º 2
0
        public instructor_list()
        {
            InitializeComponent();
            default_auth = new AuthSetting[] {
                new AuthSetting(Authority.InstructorManage)
            };
            template = new ListTemplate();

            var cargs = new CreateArgs("api/auth/instructors/", User.Api, "创建辅导员用户", Margin: new Thickness(0, 10, 0, 10));

            cargs.items.Add(new CreateArgs.Item("username", "工号", "text"));
            cargs.items.Add(new CreateArgs.Item("password", "密码", "text"));
            cargs.items.Add(new CreateArgs.Item("name", "姓名", "text"));
            cargs.items.Add(new CreateArgs.Item("gender", "性别", "choice", data: gender_choices.ToArray()));
            var args = new ListArgs("api/auth/instructors/", User.Api, Title, Searchable: true, Createable: true, Createargs: cargs);

            args.columns.Add(new ListArgs.Column("id", "工号", ordering: "id",
                                                 hyperlink: ListArgs.autohyperlink("instructor-other-document").add("id").lambda));
            args.columns.Add(new ListArgs.Column("user", "姓名", ordering: "username",
                                                 hyperlink: ListArgs.autohyperlink("instructor-other-document").add("id").lambda));
            args.columns.Add(new ListArgs.Column("gender_related", "性别", type: "choice", data: gender_choices));

            template.Construct(args);
            ContentGrid.Children.Add(template);
        }
Ejemplo n.º 3
0
        public instance()
        {
            InitializeComponent();

            template = new InstanceTemplate();
            var args = new InstanceArgs("api/classrooms/basic/", null, User.Api, Title,
                                        Margin: new Thickness(0, 10, 0, 10));

            args.items.Add(new InstanceArgs.Item("id", "教室编号", "text"));
            args.items.Add(new InstanceArgs.Item("name", "教室名称", "text"));
            args.items.Add(new InstanceArgs.Item("size", "教室大小", "text"));
            template.Construct(args);
            ContentGrid.Children.Add(template);

            list_temp = new ListTemplate();
            var largs = new ListArgs("api/record/classroom-records/", User.Api, "教室使用记录", Searchable: true);

            largs.columns.Add(new ListArgs.Column("id", "编号"));
            largs.columns.Add(new ListArgs.Column("student_name_related", "学生姓名",
                                                  hyperlink: ListArgs.autohyperlink("student-other-document").add("id", "student").lambda));
            largs.columns.Add(new ListArgs.Column("time_in", "进入时间"));
            largs.columns.Add(new ListArgs.Column("time_out", "离开时间"));
            list_temp.Construct(largs);
            //ListGrid.Children.Add(list_temp);
        }
Ejemplo n.º 4
0
        public classroom_list()
        {
            InitializeComponent();
            default_auth = new AuthSetting[] {
                new AuthSetting(Authority.ClassroomManage)
            };
            template = new ListTemplate();

            var cargs = new CreateArgs("api/classrooms/basic/", User.Api, "创建教室", Margin: new Thickness(0, 10, 0, 10));

            cargs.items.Add(new CreateArgs.Item("id", "教室编号", "text"));
            cargs.items.Add(new CreateArgs.Item("name", "教室名称", "text"));
            cargs.items.Add(new CreateArgs.Item("size", "教室大小", "text"));
            cargs.items.Add(new CreateArgs.Item("password", "教室密码", "text"));

            var args = new ListArgs("api/classrooms/basic/", User.Api, Title, Searchable: true, Createable: true, Createargs: cargs);

            args.columns.Add(new ListArgs.Column("id", "教室编号",
                                                 hyperlink: ListArgs.autohyperlink("classroom-instance").add("id").lambda));
            args.columns.Add(new ListArgs.Column("name", "教室名称", ordering: "name",
                                                 hyperlink: ListArgs.autohyperlink("classroom-instance").add("id").lambda));
            args.columns.Add(new ListArgs.Column("size", "教室大小", ordering: "size"));

            template.Construct(args);
            ContentGrid.Children.Add(template);
        }
Ejemplo n.º 5
0
        public other_document()
        {
            InitializeComponent();

            //txt_gender.Choices = gender_choices;
            template = new InstanceTemplate();

            var args = new InstanceArgs("api/auth/users/", null, User.Api, "个人资料", Deleteable: false);

            args.margin = new Thickness(0, 10, 0, 10);
            args.items.Add(new InstanceArgs.Item("id", "用户名", "text"));
            args.items.Add(new InstanceArgs.Item("name", "姓名", "text"));
            args.items.Add(new InstanceArgs.Item("gender", "性别", "choice", data: gender_choices.ToArray()));
            args.items.Add(new InstanceArgs.Item("register_time", "注册时间", "text"));
            args.items.Add(new InstanceArgs.Item("last_login_time", "最近登录", "text"));

            template.Construct(args);
            ContentGrid.Children.Add(template);

            list_temp = new ListTemplate();
            var largs = new ListArgs(null, User.Api, "管理的班级");

            largs.columns.Add(new ListArgs.Column("id", "班级编号",
                                                  hyperlink: ListArgs.autohyperlink("class-instance").add("id").lambda));
            largs.columns.Add(new ListArgs.Column("name", "班级名称",
                                                  hyperlink: ListArgs.autohyperlink("class-instance").add("id").lambda));

            list_temp.Construct(largs);
            ListGrid.Children.Add(list_temp);
        }
        public admin_schedule()
        {
            InitializeComponent();

            default_auth = new AuthSetting[] {
                new AuthSetting(Authority.Admin)
            };
            template = new ListTemplate();

            var cargs = new CreateArgs("api/schedule/system-schedules/", User.Api, "创建时间表", Margin: new Thickness(0, 10, 0, 10));

            cargs.items.Add(new CreateArgs.Item("year", "学年", "text"));
            cargs.items.Add(new CreateArgs.Item("term", "学期", "text"));
            cargs.items.Add(new CreateArgs.Item("begin", "开始时间", "text"));
            cargs.items.Add(new CreateArgs.Item("end", "结束时间", "text"));


            var args = new ListArgs("api/schedule/system-schedules/", User.Api, Title, Searchable: true, Createable: true, Createargs: cargs);

            args.columns.Add(new ListArgs.Column("id", "编号", ordering: "id",
                                                 hyperlink: ListArgs.autohyperlink("admin-admin-schedule-instance").add("id").lambda));
            args.columns.Add(new ListArgs.Column("year", "学年"));
            args.columns.Add(new ListArgs.Column("term", "学期"));
            args.columns.Add(new ListArgs.Column("begin", "开始时间"));
            args.columns.Add(new ListArgs.Column("end", "结束时间"));

            template.Construct(args);
            ContentGrid.Children.Add(template);
        }
Ejemplo n.º 7
0
        public instance()
        {
            InitializeComponent();

            template = new InstanceTemplate();
            var args = new InstanceArgs("api/classes/", null, User.Api, Title,
                                        Margin: new Thickness(0, 10, 0, 10));

            args.items.Add(new InstanceArgs.Item("id", "班级编号", "text"));
            args.items.Add(new InstanceArgs.Item("grade", "年级", "text"));
            args.items.Add(new InstanceArgs.Item("college", "学院", "text"));
            args.items.Add(new InstanceArgs.Item("major", "专业", "text"));
            args.items.Add(new InstanceArgs.Item("number", "班号", "text"));
            template.Construct(args);
            ContentGrid.Children.Add(template);

            list_temp = new ListTemplate();
            var largs = new ListArgs(null, User.Api, "学生列表");

            largs.columns.Add(new ListArgs.Column("id", "学号", customaction: HyperlinkToStudent));
            largs.columns.Add(new ListArgs.Column("name", "姓名", customaction: HyperlinkToStudent));
            list_temp.Construct(largs);
            ListGrid.Children.Add(list_temp);

            list_temp2 = new ListTemplate();
            var largs2 = new ListArgs(null, User.Api, "辅导员列表");

            largs2.columns.Add(new ListArgs.Column("id", "工号", customaction: HyperlinkToInstructor));
            largs2.columns.Add(new ListArgs.Column("name", "姓名", customaction: HyperlinkToInstructor));
            list_temp2.Construct(largs2);
            ListGrid2.Children.Add(list_temp2);
        }
        public class_list()
        {
            InitializeComponent();
            default_auth = new AuthSetting[] {
                new AuthSetting(Authority.ClassManage)
            };
            template = new ListTemplate();

            var cargs = new CreateArgs("api/classes/", User.Api, "创建班级", Margin: new Thickness(0, 10, 0, 10));

            cargs.items.Add(new CreateArgs.Item("id", "班级编号", "text"));
            cargs.items.Add(new CreateArgs.Item("grade", "年级", "text"));
            cargs.items.Add(new CreateArgs.Item("college", "学院", "text"));
            cargs.items.Add(new CreateArgs.Item("major", "专业", "text"));
            cargs.items.Add(new CreateArgs.Item("number", "班级", "text"));
            cargs.items.Add(new CreateArgs.Item("as_instructor_set", "辅导员列表(工号)", "multitext"));
            cargs.items.Add(new CreateArgs.Item("as_student_set", "学生列表(学号)", "multitext"));

            var args = new ListArgs("api/classes/", User.Api, Title, Searchable: true, Createable: true, Createargs: cargs);

            args.columns.Add(new ListArgs.Column("id", "班级编号",
                                                 hyperlink: ListArgs.autohyperlink("class-instance").add("id").lambda));
            args.columns.Add(new ListArgs.Column("grade", "年级", ordering: "grade"));
            args.columns.Add(new ListArgs.Column("college", "学院", ordering: "college"));
            args.columns.Add(new ListArgs.Column("major", "专业", ordering: "major"));
            args.columns.Add(new ListArgs.Column("number", "班级", ordering: "number"));

            template.Construct(args);
            ContentGrid.Children.Add(template);
        }
Ejemplo n.º 9
0
        public admin_schedule_instance()
        {
            InitializeComponent();
            //生成概要信息区域
            template = new InstanceTemplate();
            var args = new InstanceArgs("api/schedule/system-schedules/", null, User.Api, Title);

            args.margin = new Thickness(0, 10, 0, 10);
            args.items.Add(new InstanceArgs.Item("id", "编号", "text"));
            args.items.Add(new InstanceArgs.Item("year", "学年", "text", EditAbleStatus.Writeable));
            args.items.Add(new InstanceArgs.Item("term", "学期", "text", EditAbleStatus.Writeable));
            args.items.Add(new InstanceArgs.Item("begin", "开始时间", "text", EditAbleStatus.Writeable));
            args.items.Add(new InstanceArgs.Item("end", "结束时间", "text", EditAbleStatus.Writeable));
            template.Construct(args);
            ContentGrid.Children.Add(template);
            //生成列表区域
            list_temp = new ListTemplate();
            var clargs = new CreateArgs("api/schedule/system-schedule-items/", User.Api, "创建时间表项");

            clargs.items.Add(new CreateArgs.Item("no", "节次", "text"));
            clargs.items.Add(new CreateArgs.Item("begin", "上课时间", "text"));
            clargs.items.Add(new CreateArgs.Item("end", "下课时间", "text"));
            clargs.items.Add(new CreateArgs.Item("system_schedule", "系统时间表", "hidden", data: "system_schedule"));

            var largs = new ListArgs("api/schedule/system-schedule-items/", User.Api, "时间表项", Createable: true, Createargs: clargs);

            largs.columns.Add(new ListArgs.Column("id", "编号", customaction: UpdateScheduleItemInstance));
            largs.columns.Add(new ListArgs.Column("no", "节次", customaction: UpdateScheduleItemInstance));
            largs.columns.Add(new ListArgs.Column("begin", "上课时间"));
            largs.columns.Add(new ListArgs.Column("end", "下课时间"));

            list_temp.Construct(largs);
            ListGrid.Children.Add(list_temp);
            //生成项的详情区域
            instance_temp = new InstanceTemplate();
            var iargs = new InstanceArgs("api/schedule/system-schedule-items/", null, User.Api, "表项信息");

            iargs.items.Add(new InstanceArgs.Item("id", "编号", "text"));
            iargs.items.Add(new InstanceArgs.Item("no", "节次", "text", EditAbleStatus.Writeable));
            iargs.items.Add(new InstanceArgs.Item("begin", "上课时间", "text", EditAbleStatus.Writeable));
            iargs.items.Add(new InstanceArgs.Item("end", "下课时间", "text", EditAbleStatus.Writeable));
            iargs.deleteaction = () => {       //当按下子项的删除按钮时
                InstanceGrid.Children.Clear(); //仅仅是不显示该区域。
                list_temp.UpdateData();        //刷新列表。
            };

            instance_temp.Construct(iargs);
        }
        public detail()
        {
            InitializeComponent();

            list_temp = new ListTemplate();
            var largs = new ListArgs(null, User.Api, "出勤记录表", Searchable: true);

            largs.columns.Add(new ListArgs.Column("id", "编号"));
            largs.columns.Add(new ListArgs.Column("student", "学生姓名"));
            largs.columns.Add(new ListArgs.Column("course_manage", "课程编号"));
            largs.columns.Add(new ListArgs.Column("date", "日期"));
            largs.columns.Add(new ListArgs.Column("course_number", "节次"));
            largs.columns.Add(new ListArgs.Column("status", "出勤状态", type: "choice", data: AttendanceState.attendance_state));
            list_temp.Construct(largs);
            ListGrid.Children.Add(list_temp);
        }
        public self_teacher()
        {
            InitializeComponent();
            default_auth = new AuthSetting[] {
                new AuthSetting(Authority.Office)
            };
            template = new ListTemplate();

            var args = new ListArgs("api/auth/teachers/", User.Api, Title, Searchable: true);

            args.columns.Add(new ListArgs.Column("id", "工号", ordering: "id",
                                                 hyperlink: ListArgs.autohyperlink("teacher-other-document").add("id").lambda));
            args.columns.Add(new ListArgs.Column("user", "姓名", ordering: "username",
                                                 hyperlink: ListArgs.autohyperlink("teacher-other-document").add("id").lambda));
            args.columns.Add(new ListArgs.Column("gender_related", "性别", type: "choice", data: gender_choices));

            template.Construct(args);
            ContentGrid.Children.Add(template);
        }
        public self_attendances()
        {
            InitializeComponent();
            default_auth = new AuthSetting[] {
                new AuthSetting(Authority.Student)
            };

            template = new ListTemplate();
            var args = new ListArgs("api/record/attendance-records/", User.Api, Title, Searchable: true);

            args.columns.Add(new ListArgs.Column("id", "编号"));
            args.columns.Add(new ListArgs.Column("date", "日期"));
            args.columns.Add(new ListArgs.Column("course_number", "节次"));
            args.columns.Add(new ListArgs.Column("status", "状态"));
            args.columns.Add(new ListArgs.Column("course_manage", "课程编号",
                                                 hyperlink: ListArgs.autohyperlink("course-instance").add("id", "course_manage").lambda));
            template.Construct(args);
            ContentGrid.Children.Add(template);
        }
        public class_list()
        {
            InitializeComponent();
            default_auth = new AuthSetting[] {
                new AuthSetting(Authority.Office),
                new AuthSetting(Authority.Instructor)
            };
            template = new ListTemplate();

            var args = new ListArgs("api/classes/", User.Api, Title, Searchable: true);

            args.columns.Add(new ListArgs.Column("id", "班级编号",
                                                 hyperlink: ListArgs.autohyperlink("class-instance").add("id").lambda));
            args.columns.Add(new ListArgs.Column("grade", "年级", ordering: "grade"));
            args.columns.Add(new ListArgs.Column("college", "学院", ordering: "college"));
            args.columns.Add(new ListArgs.Column("major", "专业", ordering: "major"));
            args.columns.Add(new ListArgs.Column("number", "班级", ordering: "number"));

            template.Construct(args);
            ContentGrid.Children.Add(template);
        }
Ejemplo n.º 14
0
        public course_list()
        {
            InitializeComponent();
            default_auth = new AuthSetting[] {
                new AuthSetting(Authority.Teacher),
                new AuthSetting(Authority.Office),
            };
            template = new ListTemplate();

            var args = new ListArgs("api/courses/basic/", User.Api, Title, Searchable: true);

            args.columns.Add(new ListArgs.Column("id", "课程编号", ordering: "id",
                                                 hyperlink: ListArgs.autohyperlink("course-instance").add("id").lambda));
            args.columns.Add(new ListArgs.Column("name", "课程名称", ordering: "name",
                                                 hyperlink: ListArgs.autohyperlink("course-instance").add("id").lambda));
            args.columns.Add(new ListArgs.Column("teacher", "任课教师", ordering: "teacher",
                                                 hyperlink: ListArgs.autohyperlink("teacher-other-document").add("id", "teacher").lambda));

            template.Construct(args);
            ContentGrid.Children.Add(template);
        }
Ejemplo n.º 15
0
        public instance()
        {
            InitializeComponent();

            template = new InstanceTemplate();
            var args = new InstanceArgs("api/courses/basic/", null, User.Api, Title,
                                        Margin: new Thickness(0, 10, 0, 10));

            args.items.Add(new InstanceArgs.Item("id", "课程编号", "text"));
            args.items.Add(new InstanceArgs.Item("name", "课程名称", "text"));
            args.items.Add(new InstanceArgs.Item("teacher_name_related", "教师", "text"));
            template.Construct(args);
            ContentGrid.Children.Add(template);

            list_temp = new ListTemplate();
            var largs = new ListArgs(null, User.Api, "学生列表");

            largs.columns.Add(new ListArgs.Column("id", "学号", customaction: HyperlinkToStudent));
            largs.columns.Add(new ListArgs.Column("name", "姓名", customaction: HyperlinkToStudent));
            list_temp.Construct(largs);
            ListGrid.Children.Add(list_temp);
        }