Ejemplo n.º 1
0
        protected void Display(EmployeeInfo employee)
        {
            var fullname = employee.FullName();

            if (IsInPopup)
            {
                // set popup title to employee name
                ((CDefault)this.Page).Title = fullname;
            }
            else if (InViewModule)
            {
                if (Settings.AutoTitle)
                {
                    UniversityModuleHelper.UpdateModuleTitle(TabModuleId, fullname);
                }
            }
            else
            {
                // display employee name in label
                literalFullName.Text = "<h2>" + fullname + "</h2>";
            }

            // occupied positions
            var positions = employee.Positions
                            .OrderByDescending(op => op.Position.Weight)
                            .GroupByDivision(HttpContext.Current.Timestamp, IsEditable);

            // TODO: Grey out not published divisions
            if (positions.Any())
            {
                repeaterPositions.DataSource = positions;
                repeaterPositions.DataBind();
            }
            else
            {
                panelPositions.Visible = false;
            }

            EmployeePhotoLogic.Bind(employee, imagePhoto, PhotoWidth);

            BindContacts(employee);
            BindBarcode(employee);

            BindExperience(employee);
            BindDisciplines(employee);

            // about
            if (!string.IsNullOrWhiteSpace(employee.Biography))
            {
                litAbout.Text = Server.HtmlDecode(employee.Biography);
            }
            else
            {
                // hide entire About tab
                tabAbout.Visible = false;
            }
        }
Ejemplo n.º 2
0
        // TODO: Use IEmployee
        void BindBarcode(EmployeeInfo employee)
        {
            labelBarcodeEmployeeName.Text = employee.FullName();

            // barcode image
            var barcodeWidth = UniversityConfig.Instance.Barcode.DefaultWidth;

            imageBarcode.ImageUrl = UniversityUrlHelper.FullUrl(string.Format(
                                                                    "/imagehandler.ashx?barcode=1&width={0}&height={1}&type=qrcode&encoding=UTF-8&content={2}",
                                                                    barcodeWidth, barcodeWidth,
                                                                    Server.UrlEncode(employee.VCard().ToString()
                                                                                     .Replace("+", "%2b")) // fix for "+" signs in phone numbers
                                                                    ));

            imageBarcode.ToolTip       = LocalizeString("imageBarcode.ToolTip");
            imageBarcode.AlternateText = LocalizeString("imageBarcode.AlternateText");
        }