protected void SetUpStudents()
        {
            if (Request.IsMobileDevice())
            {
                mfbIlOfflineEndorsements.Columns = 1;
            }
            mfuOfflineEndorsements.Class = MyFlightbook.Image.MFBImageInfo.ImageClass.OfflineEndorsement;
            mfbIlOfflineEndorsements.Key = Page.User.Identity.Name;
            mfbIlOfflineEndorsements.Refresh();
            byte[] rgbDefaultScribble = CFIStudentMap.DefaultScribbleForInstructor(m_pf);
            mvDefaultSig.SetActiveView(vwCurrentSig);
            if (rgbDefaultScribble == null || rgbDefaultScribble.Length == 0)
            {
                lnkEditDefaultSig.Text = Resources.LocalizedText.StudentSigningDefaultScribbleAdd;
                imgCurrSig.Src         = string.Empty;
            }
            else
            {
                imgCurrSig.Src = ScribbleImage.DataLinkForByteArray(rgbDefaultScribble);
            }

            Profile pf = Profile.GetUser(Page.User.Identity.Name);

            pnlCertificate.Visible          = String.IsNullOrEmpty(pf.Certificate);
            txtCertificate.Text             = pf.Certificate;
            mfbTypeInDateCFIExpiration.Date = pf.CertificateExpiration;

            mfbScribbleSignature.WatermarkRef = ResolveClientUrl("~/images/rubberstamp.png");
        }
Exemple #2
0
        protected Endorsement(MySqlDataReader dr)
        {
            if (dr == null)
            {
                throw new ArgumentNullException(nameof(dr));
            }
            CFICertificate    = dr["CFINum"].ToString();
            StudentName       = dr["Student"].ToString();
            StudentType       = (StudentTypes)Convert.ToInt16(dr["StudentType"], CultureInfo.InvariantCulture);
            ID                = Convert.ToInt32(dr["id"], CultureInfo.InvariantCulture);
            InstructorName    = dr["CFI"].ToString();
            Date              = Convert.ToDateTime(dr["Date"], CultureInfo.InvariantCulture);
            CreationDate      = Convert.ToDateTime(util.ReadNullableField(dr, "DateCreated", DateTime.MinValue), CultureInfo.InvariantCulture);
            CFIExpirationDate = Convert.ToDateTime(dr["CFIExpiration"], CultureInfo.InvariantCulture);
            EndorsementText   = dr["Endorsement"].ToString();
            Title             = dr["Title"].ToString();
            FARReference      = dr["FARRef"].ToString();
            CFICachedName     = util.ReadNullableString(dr, "CFIFullName");

            byte[] rgb;

            if (!(dr["FileSize"] is DBNull))
            {
                int FileSize = Convert.ToInt32(dr["FileSize"], CultureInfo.InvariantCulture);
                rgb = new byte[FileSize];
                dr.GetBytes(dr.GetOrdinal("DigitizedSignature"), 0, rgb, 0, FileSize);
            }
            else
            {
                rgb = CFIStudentMap.DefaultScribbleForInstructor(InstructorName);
            }

            if (rgb != null && rgb.Length == 0)
            {
                rgb = null;
            }

            SetDigitizedSig(rgb);
        }