Esempio n. 1
0
        public async Task <IActionResult> OnGetAsync()
        {
            if (!base.CheckPermitions(this.Request.Headers))
            {
                return(Redirect("/error"));
            }
            ViewDepartmentsPermition = CheckPermition(this.Request.Headers, "311");
            EditDepartmentsPermition = CheckPermition(this.Request.Headers, "312");
            Departments = await _db.Departments.Include(d => d.Positions).ToListAsync();

            if (Departments == null)
            {
                return(Page());                     //Todo make empty field
            }
            Departments.ForEach(x =>
            {
                x.Positions = x.Positions.OrderBy(p => p.Grade).ToList();
            });
            return(Page());
        }
Esempio n. 2
0
        public void Serialise(Writer Out)
        {
            Out.Write(Bookings.Count);
            Bookings.ForEach(b => b.Serialise(Out));

            Out.Write(Departments.Count);
            Departments.ForEach(d => d.Serialise(Out));

            Out.Write(Periods.Count);
            Periods.ForEach(p => p.Serialise(Out));

            Out.Write(Rooms.Count);
            Rooms.ForEach(r => r.Serialise(Out));

            Out.Write(Users.Count);
            Users.ForEach(t => t.Serialise(Out));

            Out.Write(Subjects.Count);
            Subjects.ForEach(s => s.Serialise(Out));

            Out.Write(Classes.Count);
            Classes.ForEach(c => c.Serialise(Out));
        }