Beispiel #1
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);
        }
Beispiel #2
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);
        }
Beispiel #3
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 self_document()
        {
            InitializeComponent();

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

            var args = new InstanceArgs("api/auth/users/", User.Get().authentication.username, 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", EditAbleStatus.Writeable));
            args.items.Add(new InstanceArgs.Item("gender", "性别", "choice", EditAbleStatus.Writeable, data: gender_choices));
            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);

            template2 = new InstanceTemplate();
            var args2 = new InstanceArgs("api/auth/students/", User.Get().authentication.username, User.Api, "学生信息", Deleteable: false);

            args2.margin = new Thickness(0, 10, 0, 10);
            args2.items.Add(new InstanceArgs.Item("classs_name_related", "班级", "text"));
            args2.items.Add(new InstanceArgs.Item("course_name_related", "课程列表", "multitext"));
            template2.Construct(args2);
            ContentGrid2.Children.Add(template2);
        }
Beispiel #5
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 modify()
        {
            InitializeComponent();
            default_auth = new AuthSetting[] {
                new AuthSetting(Authority.CourseManage)
            };
            template = new InstanceTemplate();
            var args = new InstanceArgs("api/courses/basic/", null, User.Api, Title, Onlywrite: true);

            args.items.Add(new InstanceArgs.Item("id", "课程编号", "text"));
            args.items.Add(new InstanceArgs.Item("name", "课程名称", "text"));
            args.items.Add(new InstanceArgs.Item("teacher", "教师(工号)", "text"));
            args.items.Add(new InstanceArgs.Item("as_student_set", "学生(工号)", "multitext"));
            template.Construct(args);
            ContentGrid.Children.Add(template);
        }
Beispiel #7
0
        public manager_document()
        {
            InitializeComponent();
            default_auth = new AuthSetting[] {
                new AuthSetting(Authority.StudentManage)
            };

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

            var args = new InstanceArgs("api/auth/users/", null, User.Api, Title, Deleteable: true, Onlywrite: true);

            args.margin = new Thickness(0, 10, 0, 10);
            args.items.Add(new InstanceArgs.Item("name", "姓名", "text"));
            args.items.Add(new InstanceArgs.Item("gender", "性别", "choice", data: gender_choices.ToArray()));
            template.Construct(args);
            ContentGrid.Children.Add(template);
        }
Beispiel #8
0
        public modify()
        {
            InitializeComponent();
            default_auth = new AuthSetting[] {
                new AuthSetting(Authority.ClassManage)
            };
            template = new InstanceTemplate();
            var args = new InstanceArgs("api/classes/", null, User.Api, Title, Onlywrite: true);

            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"));
            args.items.Add(new InstanceArgs.Item("as_instructor_set", "辅导员(工号)", "multitext"));
            args.items.Add(new InstanceArgs.Item("as_student_set", "学生(学号)", "multitext"));
            template.Construct(args);
            ContentGrid.Children.Add(template);
        }
        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);
        }
Beispiel #10
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);
        }
        public modify()
        {
            InitializeComponent();
            default_auth = new AuthSetting[] {
                new AuthSetting(Authority.ClassroomManage)
            };
            template = new InstanceTemplate();
            var args = new InstanceArgs("api/classrooms/basic/", null, User.Api, Title, Onlywrite: true);

            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);

            pw_temp = new InstanceTemplate();
            var pargs = new InstanceArgs("api/classrooms/manage/", null, User.Api, "教室验证码", Deleteable: false);

            pargs.items.Add(new InstanceArgs.Item("password", "验证码", "text", Editable: EditAbleStatus.Writeable));
            pw_temp.Construct(pargs);
            PwGrid.Children.Add(pw_temp);
        }