Exemple #1
0
        protected void Page_Fill()
        {
            RolesTable.DataSource = SystemLists.User.Roles.Where(x => x != Role.AllRoles && x != Role.Unknown).ToList();
            var departments = new GeneralManager().GetDepartments(Settings.GetCompanyName());

            selectDepartment.DataSource = departments;
            selectDepartment.DataBind();

            if (EdittedUser.Department == null)
            {
                EdittedUser.Department = departments.First();
            }

            selectDepartment.SelectItem(EdittedUser.Department.ID.ToString());

            if ((EdittedUser.Photo?.ID ?? 0) != 0)
            {
                if (!string.IsNullOrWhiteSpace(EdittedUser.Photo.FileName))
                {
                    UserPhoto.ImageUrl = EdittedUser.Photo.FileName;
                }
            }

            DataBind();
        }