Some year ago, a fellow guy in the company made as a first approach to ABL learning, this code... and wanted to share to see it gain traction....
Tryed to post to wiki or documents, up here, but I wasn't allowed...
So let's see expand it and hear some observations...
couldn't attach, si here it goes:
/*------------------------------------------------------------------------ File : BioLogin.cls Purpose : Access control Syntax : Description : Author(s) : Isai Padron Created : Mon Nov 23 15:04:32 CST 2015 Notes : ----------------------------------------------------------------------*/ USING Progress.Lang.*. USING Progress.Windows.Form. USING Suprema.*. USING System.Drawing.*. USING System.ComponentModel.AddingNewEventHandler FROM ASSEMBLY. USING System.Windows.Forms.MessageBox FROM ASSEMBLY. USING System.Windows.Forms.FormBorderStyle FROM ASSEMBLY. USING System.Windows.Forms.Button FROM ASSEMBLY. USING System.Windows.Forms.DialogResult FROM ASSEMBLY. USING System.Windows.Forms.TextBox FROM ASSEMBLY. USING System.Windows.Forms.HorizontalAlignment FROM ASSEMBLY. USING System.StringSplitOptions FROM ASSEMBLY. USING System.String FROM ASSEMBLY. USING System.Runtime.Serialization.*. USING System.Runtime.Serialization.Formatters.Binary.*. USING System.IO.FileStream FROM ASSEMBLY. USING Interop.QBFC8.*. USING System.IO.MemoryStream FROM ASSEMBLY. USING System.Convert FROM ASSEMBLY. USING procs.enroll.act.FormUser FROM PROPATH. USING procs.enroll.act.DialogUserId FROM PROPATH. BLOCK-LEVEL ON ERROR UNDO, THROW. CLASS procs.enroll.Act.BioLogin INHERITS Form: DEFINE PRIVATE VARIABLE btnIdentificar AS CLASS System.Windows.Forms.Button NO-UNDO. DEFINE PRIVATE VARIABLE btnSave AS CLASS System.Windows.Forms.Button NO-UNDO. DEFINE PRIVATE VARIABLE btnStart AS CLASS System.Windows.Forms.Button NO-UNDO. DEFINE PRIVATE VARIABLE button1 AS CLASS System.Windows.Forms.Button NO-UNDO. DEFINE PRIVATE VARIABLE components AS CLASS System.ComponentModel.IContainer NO-UNDO. DEFINE PRIVATE VARIABLE lbFinger AS CLASS System.Windows.Forms.Label NO-UNDO. DEFINE PRIVATE VARIABLE lbStatus AS CLASS System.Windows.Forms.ToolStripStatusLabel NO-UNDO. DEFINE PRIVATE VARIABLE lbSerial AS CLASS System.Windows.Forms.ToolStripStatusLabel NO-UNDO. DEFINE PRIVATE VARIABLE pBoxfPrint AS CLASS System.Windows.Forms.PictureBox NO-UNDO. DEFINE PRIVATE VARIABLE pbScan1 AS CLASS System.Windows.Forms.ToolStripProgressBar NO-UNDO. DEFINE PRIVATE VARIABLE statusStrip1 AS CLASS System.Windows.Forms.StatusStrip NO-UNDO. DEFINE PRIVATE VARIABLE scannerManager AS CLASS Suprema.UFScannerManager NO-UNDO. DEFINE PRIVATE VARIABLE matcher AS CLASS UFMatcher NO-UNDO . DEFINE PRIVATE VARIABLE template_size AS INTEGER NO-UNDO. DEFINE PRIVATE VARIABLE template1 AS CLASS "System.Byte[][]" NO-UNDO. DEFINE PRIVATE VARIABLE template_size1 AS CLASS "System.Int32[]" NO-UNDO. DEFINE PRIVATE VARIABLE template2 AS CLASS "System.Byte[][]" NO-UNDO. DEFINE PRIVATE VARIABLE template_size2 AS CLASS "System.Int32[]" NO-UNDO. DEFINE PRIVATE VARIABLE template_num AS INTEGER NO-UNDO. DEFINE PRIVATE VARIABLE timer1 AS CLASS System.Windows.Forms.Timer NO-UNDO. DEFINE PRIVATE VARIABLE usuarioID AS LONGCHAR NO-UNDO. DEFINE PRIVATE VARIABLE quality AS INTEGER NO-UNDO. DEFINE PRIVATE VARIABLE nType AS INTEGER NO-UNDO. DEFINE PRIVATE VARIABLE max_template_size AS INTEGER NO-UNDO INITIAL 512. DEFINE PRIVATE VARIABLE max_template_num AS INTEGER NO-UNDO INITIAL 50. DEF PRIVATE VAR Template AS CLASS "System.Byte[]" NO-UNDO. DEF PRIVATE VAR TemplateSize AS INTEGER NO-UNDO. DEF PRIVATE VAR templateData AS CLASS "System.Byte[]" NO-UNDO. DEF PRIVATE VAR TemplateSizeData AS INTEGER NO-UNDO. DEF PRIVATE VAR Usuario AS CHARACTER NO-UNDO. DEF PRIVATE VAR memo AS CHARACTER NO-UNDO. DEF PRIVATE VAR serial AS INTEGER NO-UNDO. DEF PRIVATE VAR frm AS CLASS FormUser NO-UNDO. DEF PRIVATE VAR formUserId AS CLASS DialogUserId NO-UNDO. DEF PRIVATE VAR formStatus AS LOGICAL NO-UNDO. DEF PRIVATE VAR templateOk AS LOGICAL NO-UNDO. CONSTRUCTOR PUBLIC BioLogin ( ): SUPER(). InitializeComponent(). THIS-OBJECT:ComponentsCollection:ADD(THIS-OBJECT:components). CATCH e AS Progress.Lang.Error: UNDO, THROW e. END CATCH. END CONSTRUCTOR. /*------------------------------------------------------------------------------ Purpose: Notes: ------------------------------------------------------------------------------*/ @VisualDesigner. METHOD PRIVATE VOID BioLogin_KeyDown( INPUT sender AS System.Object, INPUT e AS System.Windows.Forms.KeyEventArgs ): MESSAGE e:KeyValue VIEW-AS ALERT-BOX. END METHOD. /*------------------------------------------------------------------------------ Purpose:When the form loads, it checks if scanner is connected. Notes: ------------------------------------------------------------------------------*/ @VisualDesigner. METHOD PRIVATE VOID BioLogin_Load( INPUT sender AS System.Object, INPUT e AS System.EventArgs ): DEF VAR ufs_res AS UFS_STATUS NO-UNDO. DEF VAR Scanner AS UFScanner NO-UNDO. DEF VAR x AS INTEGER NO-UNDO. Scanner = ?. scannerManager = NEW UFScannerManager(THIS-OBJECT). ufs_res = scannerManager:Init(). IF GetScanner(Scanner) THEN DO: lbStatus:Text = "Scanner connected". Scanner = scannerManager:Scanners[0]. lbSerial:Text = Scanner:ScannerType:ToString() + " Serial: " + Scanner:Serial. Scanner:Timeout = 9000. Scanner:TemplateSize = max_template_size. Scanner:DetectCore = FALSE. matcher = NEW UFMatcher(). matcher:FastMode = TRUE. template_num = 0. quality = 40. END. END METHOD. /*------------------------------------------------------------------------------ Purpose: Notes: ------------------------------------------------------------------------------*/ @VisualDesigner. METHOD PRIVATE VOID btnIdentificar_Click( INPUT sender AS System.Object, INPUT e AS System.EventArgs ): DEF VAR ufs_res AS UFS_STATUS NO-UNDO. DEF VAR ufm_res AS UFM_STATUS NO-UNDO. DEF VAR Scanner AS UFScanner NO-UNDO. DEF VAR EnrollQuality AS INTEGER NO-UNDO. DEF VAR Template1 AS "System.Byte[]" NO-UNDO. DEF VAR TemplateSize1 AS INTEGER NO-UNDO. DEF VAR Template_all AS "System.Byte[][]" NO-UNDO. DEF VAR TemplateSize_all AS "System.Int32[]" NO-UNDO. DEF VAR Template2num AS INTEGER NO-UNDO. DEF VAR MatchIndex AS INTEGER NO-UNDO. DEF VAR nMaxTemplateNum AS INTEGER NO-UNDO INITIAL 0. DEF VAR i AS INTEGER NO-UNDO. DEF VAR b64String AS CHARACTER NO-UNDO. DEF VAR b64Template AS "System.Byte[]" NO-UNDO. DEF VAR templateSizeData AS INTEGER NO-UNDO. DEF VAR mst AS System.IO.MemoryStream NO-UNDO. DEF VAR formatter AS BinaryFormatter NO-UNDO. matcher = NEW UFMatcher(). matcher:SecurityLevel = 4. matcher:FastMode = TRUE. formUserId = NEW DialogUserId(). WAIT-FOR formUserId:ShowDialog(). IF STRING(formUserId:DialogResult) = STRING(DialogResult:OK) THEN DO: FIND FingerPrint NO-LOCK WHERE FingerPrint.Serial = formUserId:usuarioId NO-ERROR. IF AVAILABLE (FingerPrint) THEN DO: ASSIGN serial = FingerPrint.Serial Usuario = FingerPrint.UsuarioID templateSizeData = FingerPrint.FingerIndex b64String = FingerPrint.Template1. templateData = NEW "System.Byte[]" (max_template_size). b64Template = Convert:FromBase64String(b64String). mst = NEW MemoryStream(b64Template). formatter = NEW BinaryFormatter(). templateData = CAST(formatter:Deserialize(mst), "System.Byte[]"). mst:Close(). Template1 = NEW "System.Byte[]" (max_template_size). TemplateSize_all = NEW "System.Int32[]"(max_template_num){}. Template_all = NEW "System.Byte[][]" (max_template_size){}. DO i = 0 TO max_template_num - 1: Template_all:SetValue( NEW "System.Byte[]" (max_template_size), i). TemplateSize_all:SetValue(0,i). END. Template_all:SetValue(TemplateData,0). TemplateSize_all:SetValue(templateSizeData,0). nMaxTemplateNum = 1. IF GetScanner(Scanner) THEN DO: Scanner = scannerManager:Scanners[0]. Scanner:ClearCaptureImageBuffer(). lbFinger:Visible = TRUE. ufs_res = Scanner:CaptureSingleImage(). IF STRING(ufs_res) = STRING( UFS_STATUS:OK) THEN DO: Scanner:nTemplateType = 2003. ufs_res = Scanner:Extract(Template1,TemplateSize1,EnrollQuality). IF STRING(ufs_res) = STRING( UFS_STATUS:OK) THEN DO: DrawCaptureImage(Scanner). matcher:nTemplateType = 2003. ufm_res = matcher:Identify(Template1,TemplateSize1,Template_all,TemplateSize_all,nMaxTemplateNum, 5000, MatchIndex). IF MatchIndex <> -1 THEN MESSAGE "ID: " + STRING( serial) + " Usuario: " + Usuario VIEW-AS ALERT-BOX. ELSE MESSAGE "Usuario no identificado." VIEW-AS ALERT-BOX. END. END. // STRING(ufs_res) = STRING( UFS_STATUS:OK) END. // IF GetScanner(Scanner) END. // AVAILABLE (FingerPrint) ELSE MESSAGE "Usuario no encontrado." VIEW-AS ALERT-BOX. END. RETURN. END METHOD. /*------------------------------------------------------------------------------ Purpose: Store new biometric user. Notes: ------------------------------------------------------------------------------*/ @VisualDesigner. METHOD PRIVATE VOID btnSave_Click( INPUT sender AS System.Object, INPUT e AS System.EventArgs ): DEF VAR formatter AS BinaryFormatter NO-UNDO. DEF VAR mst AS System.IO.MemoryStream NO-UNDO. DEF VAR b64String AS CHARACTER NO-UNDO. DEF VAR b64Template AS "System.Byte[]" NO-UNDO. IF formStatus AND templateOk THEN DO: formatter = NEW BinaryFormatter(). mst = NEW MemoryStream(). formatter:Serialize(mst,Template). mst:Close(). b64String = Convert:ToBase64String(mst:ToArray()). CREATE FingerPrint. ASSIGN FingerPrint.UsuarioID = usuario FingerPrint.FingerIndex = TemplateSize FingerPrint.Memo = memo FingerPrint.Template1 = b64String. END. ELSE DO: MESSAGE "Ingresa los datos usuario." VIEW-AS ALERT-BOX. END. END METHOD. /*------------------------------------------------------------------------------ Purpose:Start scanning Notes: ------------------------------------------------------------------------------*/ @VisualDesigner. METHOD PRIVATE VOID btnStart_Click( INPUT sender AS System.Object, INPUT e AS System.EventArgs ): DEF VAR ufs_res AS UFS_STATUS NO-UNDO. DEF VAR Scanner AS UFScanner NO-UNDO. DEF VAR EnrollQuality AS INTEGER NO-UNDO. DEF VAR EnrollMode AS INTEGER NO-UNDO. DEF VAR template_enrolled AS INT64 NO-UNDO. IF GetScanner(Scanner) THEN DO: Scanner = scannerManager:Scanners[0]. Scanner:nTemplateType = 2003. EnrollMode = 1. template_enrolled = 0. frm = NEW FormUser(). IF NOT formStatus THEN DO: WAIT-FOR frm:ShowDialog(). IF STRING(frm:DialogResult) = STRING( DialogResult:OK) THEN DO: usuario = frm:UserName + " " + frm:UserFirstName. memo = frm:AdditionalData. formStatus = frm:formStatus. END. ELSE DO: LEAVE. END. END. pbScan1:Visible = TRUE. pbScan1:Style = System.Windows.Forms.ProgressBarStyle:Marquee. lbFinger:Visible = TRUE. Scanner:ClearCaptureImageBuffer(). scanning: DO WHILE TRUE : ufs_res = Scanner:CaptureSingleImage(). IF STRING(ufs_res) <> STRING(UFS_STATUS:OK) THEN LEAVE. IF template_enrolled = 0 THEN DO: Template = NEW "System.Byte[]" (max_template_size). ufs_res = Scanner:Extract(Template,TemplateSize, EnrollQuality). END. DrawCaptureImage(Scanner). lbFinger:Visible = FALSE. IF STRING(ufs_res) = STRING(UFS_STATUS:OK) THEN DO: IF EnrollQuality > quality AND formStatus THEN DO: templateOk = TRUE. pbScan1:Style = System.Windows.Forms.ProgressBarStyle:Blocks. pbScan1:Visible = FALSE. LEAVE. END. END. END. END. RETURN. END METHOD. /*------------------------------------------------------------------------------ Purpose:It checks if scanner is connected. Notes: ------------------------------------------------------------------------------*/ METHOD PRIVATE LOGICAL GetScanner(INPUT Scanner AS UFScanner): DEFINE VARIABLE result AS LOGICAL INITIAL FALSE NO-UNDO. Scanner = scannerManager:Scanners[0]. IF Scanner <> ? THEN result = TRUE. ELSE lbStatus:Text = "Scanner is not connected". RETURN result. END METHOD. /*------------------------------------------------------------------------------ Purpose:Drawing a image from scanner. Notes: ------------------------------------------------------------------------------*/ METHOD PRIVATE VOID DrawCaptureImage(INPUT Scanner AS UFScanner): DEF VAR gp AS Graphics NO-UNDO. DEF VAR rec AS Rectangle NO-UNDO. gp = pBoxfPrint:CreateGraphics(). rec = NEW Rectangle(0,0, pBoxfPrint:Width, pBoxfPrint:Height). Scanner:DrawCaptureImageBuffer(gp, rec, FALSE). gp:Dispose(). END. METHOD PRIVATE VOID InitializeComponent( ): /* NOTE: The following method is automatically generated. We strongly suggest that the contents of this method only be modified using the Visual Designer to avoid any incompatible modifications. Modifying the contents of this method using a code editor will invalidate any support for this file. */ THIS-OBJECT:components = NEW System.ComponentModel.Container(). @VisualDesigner.FormMember (NeedsInitialize="true"). DEFINE VARIABLE resources AS Progress.Util.ResourceManager NO-UNDO. resources = NEW Progress.Util.ResourceManager("procs.Act.BioLogin"). THIS-OBJECT:statusStrip1 = NEW System.Windows.Forms.StatusStrip(). THIS-OBJECT:lbStatus = NEW System.Windows.Forms.ToolStripStatusLabel(). THIS-OBJECT:lbSerial = NEW System.Windows.Forms.ToolStripStatusLabel(). THIS-OBJECT:pbScan1 = NEW System.Windows.Forms.ToolStripProgressBar(). THIS-OBJECT:pBoxfPrint = NEW System.Windows.Forms.PictureBox(). THIS-OBJECT:btnStart = NEW System.Windows.Forms.Button(). THIS-OBJECT:button1 = NEW System.Windows.Forms.Button(). THIS-OBJECT:lbFinger = NEW System.Windows.Forms.Label(). THIS-OBJECT:btnIdentificar = NEW System.Windows.Forms.Button(). THIS-OBJECT:btnSave = NEW System.Windows.Forms.Button(). THIS-OBJECT:timer1 = NEW System.Windows.Forms.Timer(THIS-OBJECT:components). THIS-OBJECT:statusStrip1:SuspendLayout(). CAST(THIS-OBJECT:pBoxfPrint, System.ComponentModel.ISupportInitialize):BeginInit(). THIS-OBJECT:SuspendLayout(). /* */ /* statusStrip1 */ /* */ THIS-OBJECT:statusStrip1:GripStyle = System.Windows.Forms.ToolStripGripStyle:Visible. @VisualDesigner.FormMember (NeedsInitialize="false", InitializeArray="true"). DEFINE VARIABLE arrayvar0 AS System.Windows.Forms.ToolStripItem EXTENT 3 NO-UNDO. arrayvar0[1] = THIS-OBJECT:lbStatus. arrayvar0[2] = THIS-OBJECT:lbSerial. arrayvar0[3] = THIS-OBJECT:pbScan1. THIS-OBJECT:statusStrip1:Items:AddRange(arrayvar0). THIS-OBJECT:statusStrip1:LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle:Flow. THIS-OBJECT:statusStrip1:Location = NEW System.Drawing.Point(0, 356). THIS-OBJECT:statusStrip1:Name = "statusStrip1". THIS-OBJECT:statusStrip1:Size = NEW System.Drawing.Size(518, 22). THIS-OBJECT:statusStrip1:TabIndex = 0. THIS-OBJECT:statusStrip1:Text = "statusStrip1". /* */ /* lbStatus */ /* */ THIS-OBJECT:lbStatus:BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides:Right. THIS-OBJECT:lbStatus:Font = NEW System.Drawing.Font("Segoe UI", Progress.Util.CastUtil:ToSingle(8.25), System.Drawing.FontStyle:Regular, System.Drawing.GraphicsUnit:Point, System.Convert:ToByte(0)). THIS-OBJECT:lbStatus:Name = "lbStatus". THIS-OBJECT:lbStatus:Size = NEW System.Drawing.Size(141, 17). THIS-OBJECT:lbStatus:Text = "Scanner is not connected". /* */ /* lbSerial */ /* */ THIS-OBJECT:lbSerial:BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides:Right. THIS-OBJECT:lbSerial:Font = NEW System.Drawing.Font("Segoe UI", Progress.Util.CastUtil:ToSingle(8.25), System.Drawing.FontStyle:Regular, System.Drawing.GraphicsUnit:Point, System.Convert:ToByte(0)). THIS-OBJECT:lbSerial:Name = "lbSerial". THIS-OBJECT:lbSerial:Size = NEW System.Drawing.Size(69, 17). THIS-OBJECT:lbSerial:Text = "Serial: 0000". /* */ /* pbScan1 */ /* */ THIS-OBJECT:pbScan1:AutoSize = FALSE. THIS-OBJECT:pbScan1:Name = "pbScan1". THIS-OBJECT:pbScan1:Size = NEW System.Drawing.Size(100, 15). THIS-OBJECT:pbScan1:Visible = FALSE. /* */ /* pBoxfPrint */ /* */ THIS-OBJECT:pBoxfPrint:BackColor = System.Drawing.SystemColors:AppWorkspace. THIS-OBJECT:pBoxfPrint:Location = NEW System.Drawing.Point(12, 12). THIS-OBJECT:pBoxfPrint:Name = "pBoxfPrint". THIS-OBJECT:pBoxfPrint:Size = NEW System.Drawing.Size(170, 231). THIS-OBJECT:pBoxfPrint:TabIndex = 1. THIS-OBJECT:pBoxfPrint:TabStop = FALSE. /* */ /* btnStart */ /* */ THIS-OBJECT:btnStart:Location = NEW System.Drawing.Point(13, 277). THIS-OBJECT:btnStart:Name = "btnStart". THIS-OBJECT:btnStart:Size = NEW System.Drawing.Size(83, 23). THIS-OBJECT:btnStart:TabIndex = 2. THIS-OBJECT:btnStart:Text = "Escanear". THIS-OBJECT:btnStart:UseCompatibleTextRendering = TRUE. THIS-OBJECT:btnStart:UseVisualStyleBackColor = TRUE. THIS-OBJECT:btnStart:Click:Subscribe(THIS-OBJECT:btnStart_Click). /* */ /* button1 */ /* */ THIS-OBJECT:button1:Location = NEW System.Drawing.Point(0, 0). THIS-OBJECT:button1:Name = "button1". THIS-OBJECT:button1:Size = NEW System.Drawing.Size(75, 23). THIS-OBJECT:button1:TabIndex = 0. THIS-OBJECT:button1:Text = "button1". THIS-OBJECT:button1:UseCompatibleTextRendering = TRUE. THIS-OBJECT:button1:UseVisualStyleBackColor = TRUE. /* */ /* lbFinger */ /* */ THIS-OBJECT:lbFinger:Image = CAST(resources:GetObject("lbFinger.Image"), System.Drawing.Image). THIS-OBJECT:lbFinger:Location = NEW System.Drawing.Point(12, 246). THIS-OBJECT:lbFinger:Name = "lbFinger". THIS-OBJECT:lbFinger:Size = NEW System.Drawing.Size(170, 28). THIS-OBJECT:lbFinger:TabIndex = 3. THIS-OBJECT:lbFinger:UseCompatibleTextRendering = TRUE. THIS-OBJECT:lbFinger:Visible = FALSE. /* */ /* btnIdentificar */ /* */ THIS-OBJECT:btnIdentificar:Location = NEW System.Drawing.Point(13, 306). THIS-OBJECT:btnIdentificar:Name = "btnIdentificar". THIS-OBJECT:btnIdentificar:Size = NEW System.Drawing.Size(169, 23). THIS-OBJECT:btnIdentificar:TabIndex = 8. THIS-OBJECT:btnIdentificar:Text = "Identificar". THIS-OBJECT:btnIdentificar:UseCompatibleTextRendering = TRUE. THIS-OBJECT:btnIdentificar:UseVisualStyleBackColor = TRUE. THIS-OBJECT:btnIdentificar:Click:Subscribe(THIS-OBJECT:btnIdentificar_Click). /* */ /* btnSave */ /* */ THIS-OBJECT:btnSave:Location = NEW System.Drawing.Point(102, 277). THIS-OBJECT:btnSave:Name = "btnSave". THIS-OBJECT:btnSave:Size = NEW System.Drawing.Size(80, 23). THIS-OBJECT:btnSave:TabIndex = 9. THIS-OBJECT:btnSave:Text = "Guardar". THIS-OBJECT:btnSave:UseCompatibleTextRendering = TRUE. THIS-OBJECT:btnSave:UseVisualStyleBackColor = TRUE. THIS-OBJECT:btnSave:Click:Subscribe(THIS-OBJECT:btnSave_Click). /* */ /* BioLogin */ /* */ THIS-OBJECT:ClientSize = NEW System.Drawing.Size(518, 378). THIS-OBJECT:Controls:Add(THIS-OBJECT:btnSave). THIS-OBJECT:Controls:Add(THIS-OBJECT:btnIdentificar). THIS-OBJECT:Controls:Add(THIS-OBJECT:lbFinger). THIS-OBJECT:Controls:Add(THIS-OBJECT:btnStart). THIS-OBJECT:Controls:Add(THIS-OBJECT:pBoxfPrint). THIS-OBJECT:Controls:Add(THIS-OBJECT:statusStrip1). THIS-OBJECT:FormBorderStyle = System.Windows.Forms.FormBorderStyle:FixedSingle. THIS-OBJECT:Name = "BioLogin". THIS-OBJECT:StartPosition = System.Windows.Forms.FormStartPosition:CenterScreen. THIS-OBJECT:Text = "BioLogin". THIS-OBJECT:Load:Subscribe(THIS-OBJECT:BioLogin_Load). THIS-OBJECT:KeyDown:Subscribe(THIS-OBJECT:BioLogin_KeyDown). THIS-OBJECT:statusStrip1:ResumeLayout(FALSE). THIS-OBJECT:statusStrip1:PerformLayout(). CAST(THIS-OBJECT:pBoxfPrint, System.ComponentModel.ISupportInitialize):EndInit(). THIS-OBJECT:ResumeLayout(FALSE). THIS-OBJECT:PerformLayout(). CATCH e AS Progress.Lang.Error: UNDO, THROW e. END CATCH. END METHOD. DESTRUCTOR PUBLIC BioLogin ( ): END DESTRUCTOR. END CLASS.
File : DialogUserId.cls Purpose : Syntax : Description : Author(s) : ISAI-PC Created : Sat Dec 12 16:54:11 CST 2015 Notes : ----------------------------------------------------------------------*/ USING Progress.Windows.Form. BLOCK-LEVEL ON ERROR UNDO, THROW. CLASS procs.enroll.Act.DialogUserId INHERITS Form : DEFINE PRIVATE VARIABLE components AS System.ComponentModel.IContainer NO-UNDO. DEFINE PRIVATE VARIABLE buttonOk AS System.Windows.Forms.Button NO-UNDO. DEFINE PRIVATE VARIABLE buttonCancel AS System.Windows.Forms.Button NO-UNDO. DEFINE PRIVATE VARIABLE tbName AS System.Windows.Forms.TextBox NO-UNDO. DEFINE PRIVATE VARIABLE label1 AS System.Windows.Forms.Label NO-UNDO. DEFINE PRIVATE VARIABLE groupBox1 AS System.Windows.Forms.GroupBox NO-UNDO. DEFINE PUBLIC PROPERTY usuarioId AS INTEGER INITIAL ? NO-UNDO GET. PROTECTED SET (INPUT nm AS INTEGER): ASSIGN usuarioId = nm. END SET. CONSTRUCTOR PUBLIC DialogUserId( ): SUPER(). InitializeComponent ( ). CATCH e AS Progress.Lang.Error: UNDO, THROW e. END CATCH. END CONSTRUCTOR. DESTRUCTOR PUBLIC DialogUserId( ): IF VALID-OBJECT(components) THEN DO: CAST(components, System.IDisposable):Dispose(). END. END DESTRUCTOR. METHOD PRIVATE VOID okButton_Click (sender AS System.Object, e AS System.EventArgs): usuarioId = INTEGER(tbName:Text). THIS-OBJECT:DialogResult = System.Windows.Forms.DialogResult:Ok. THIS-OBJECT:Close ( ). END METHOD. METHOD PRIVATE VOID cancelButton_Click (sender AS System.Object, e AS System.EventArgs): THIS-OBJECT:DialogResult = System.Windows.Forms.DialogResult:Cancel. THIS-OBJECT:Close ( ). END METHOD. METHOD PRIVATE VOID InitializeComponent ( ): /* NOTE: The following method is automatically generated. We strongly suggest that the contents of this method only be modified using the Visual Designer to avoid any incompatible modifications. Modifying the contents of this method using a code editor will invalidate any support for this file. */ THIS-OBJECT:buttonOk = NEW System.Windows.Forms.Button(). THIS-OBJECT:buttonCancel = NEW System.Windows.Forms.Button(). THIS-OBJECT:groupBox1 = NEW System.Windows.Forms.GroupBox(). THIS-OBJECT:label1 = NEW System.Windows.Forms.Label(). THIS-OBJECT:tbName = NEW System.Windows.Forms.TextBox(). THIS-OBJECT:groupBox1:SuspendLayout(). THIS-OBJECT:SuspendLayout(). /* */ /* buttonOk */ /* */ DEFINE VARIABLE nestedvar0 AS System.Windows.Forms.AnchorStyles NO-UNDO. nestedvar0 = System.Windows.Forms.AnchorStyles:Bottom. THIS-OBJECT:buttonOk:Anchor = CAST(Progress.Util.EnumHelper:Or(nestedvar0, System.Windows.Forms.AnchorStyles:Right), System.Windows.Forms.AnchorStyles). THIS-OBJECT:buttonOk:Enabled = FALSE. THIS-OBJECT:buttonOk:Location = NEW System.Drawing.Point(124, 86). THIS-OBJECT:buttonOk:Name = "buttonOk". THIS-OBJECT:buttonOk:Size = NEW System.Drawing.Size(75, 23). THIS-OBJECT:buttonOk:TabIndex = 0. THIS-OBJECT:buttonOk:Text = "OK". THIS-OBJECT:buttonOk:UseCompatibleTextRendering = TRUE. THIS-OBJECT:buttonOk:Click:Subscribe(THIS-OBJECT:okButton_Click). /* */ /* buttonCancel */ /* */ DEFINE VARIABLE nestedvar1 AS System.Windows.Forms.AnchorStyles NO-UNDO. nestedvar1 = System.Windows.Forms.AnchorStyles:Bottom. THIS-OBJECT:buttonCancel:Anchor = CAST(Progress.Util.EnumHelper:Or(nestedvar1, System.Windows.Forms.AnchorStyles:Right), System.Windows.Forms.AnchorStyles). THIS-OBJECT:buttonCancel:DialogResult = System.Windows.Forms.DialogResult:Cancel. THIS-OBJECT:buttonCancel:Location = NEW System.Drawing.Point(205, 86). THIS-OBJECT:buttonCancel:Name = "buttonCancel". THIS-OBJECT:buttonCancel:Size = NEW System.Drawing.Size(75, 23). THIS-OBJECT:buttonCancel:TabIndex = 1. THIS-OBJECT:buttonCancel:Text = "Cancelar". THIS-OBJECT:buttonCancel:UseCompatibleTextRendering = TRUE. THIS-OBJECT:buttonCancel:Click:Subscribe(THIS-OBJECT:cancelButton_Click). /* */ /* groupBox1 */ /* */ THIS-OBJECT:groupBox1:Controls:Add(THIS-OBJECT:label1). THIS-OBJECT:groupBox1:Controls:Add(THIS-OBJECT:tbName). THIS-OBJECT:groupBox1:Location = NEW System.Drawing.Point(13, 7). THIS-OBJECT:groupBox1:Name = "groupBox1". THIS-OBJECT:groupBox1:Size = NEW System.Drawing.Size(269, 75). THIS-OBJECT:groupBox1:TabIndex = 2. THIS-OBJECT:groupBox1:TabStop = FALSE. THIS-OBJECT:groupBox1:Text = "Usuario". THIS-OBJECT:groupBox1:UseCompatibleTextRendering = TRUE. /* */ /* label1 */ /* */ THIS-OBJECT:label1:Location = NEW System.Drawing.Point(6, 22). THIS-OBJECT:label1:Name = "label1". THIS-OBJECT:label1:Size = NEW System.Drawing.Size(100, 13). THIS-OBJECT:label1:TabIndex = 1. THIS-OBJECT:label1:Text = "ID:". THIS-OBJECT:label1:UseCompatibleTextRendering = TRUE. /* */ /* tbName */ /* */ THIS-OBJECT:tbName:Location = NEW System.Drawing.Point(6, 41). THIS-OBJECT:tbName:Name = "tbName". THIS-OBJECT:tbName:Size = NEW System.Drawing.Size(257, 20). THIS-OBJECT:tbName:TabIndex = 0. THIS-OBJECT:tbName:TextChanged:Subscribe(THIS-OBJECT:textBox1_TextChanged). /* */ /* DialogUserId */ /* */ THIS-OBJECT:AcceptButton = THIS-OBJECT:buttonOk. THIS-OBJECT:CancelButton = THIS-OBJECT:buttonCancel. THIS-OBJECT:ClientSize = NEW System.Drawing.Size(294, 120). THIS-OBJECT:Controls:Add(THIS-OBJECT:groupBox1). THIS-OBJECT:Controls:Add(THIS-OBJECT:buttonCancel). THIS-OBJECT:Controls:Add(THIS-OBJECT:buttonOk). THIS-OBJECT:FormBorderStyle = System.Windows.Forms.FormBorderStyle:FixedDialog. THIS-OBJECT:MaximizeBox = FALSE. THIS-OBJECT:MinimizeBox = FALSE. THIS-OBJECT:Name = "DialogUserId". THIS-OBJECT:ShowInTaskbar = FALSE. THIS-OBJECT:StartPosition = System.Windows.Forms.FormStartPosition:CenterScreen. THIS-OBJECT:Text = "Identificación". THIS-OBJECT:groupBox1:ResumeLayout(FALSE). THIS-OBJECT:groupBox1:PerformLayout(). THIS-OBJECT:ResumeLayout(FALSE). CATCH e AS Progress.Lang.Error: UNDO, THROW e. END CATCH. END METHOD. METHOD PUBLIC VOID ShowModalDialog( ): WAIT-FOR THIS-OBJECT:ShowDialog(). END METHOD. /*------------------------------------------------------------------------------ Purpose: Notes: ------------------------------------------------------------------------------*/ @VisualDesigner. METHOD PRIVATE VOID textBox1_TextChanged( INPUT sender AS System.Object, INPUT e AS System.EventArgs ): IF tbName:TextLength > 0 THEN DO: buttonOk:Enabled = TRUE. END. ELSE DO: buttonOk:Enabled = FALSE. END. RETURN. END METHOD. END CLASS.
/*------------------------------------------------------------------------ File : FormUser.cls Purpose : Syntax : Description : Author(s) : ISAI-PC Created : Fri Dec 11 16:21:24 CST 2015 Notes : ----------------------------------------------------------------------*/ USING Progress.Lang.*. USING Progress.Windows.Form. USING OpenEdge.Core.String FROM PROPATH. BLOCK-LEVEL ON ERROR UNDO, THROW. CLASS procs.enroll.Act.FormUser INHERITS Form: DEFINE PRIVATE VARIABLE btnCancelar AS System.Windows.Forms.Button NO-UNDO. DEFINE PRIVATE VARIABLE btnAceptar AS System.Windows.Forms.Button NO-UNDO. DEFINE PRIVATE VARIABLE components AS System.ComponentModel.IContainer NO-UNDO. DEFINE PRIVATE VARIABLE lbName AS System.Windows.Forms.Label NO-UNDO. DEFINE PRIVATE VARIABLE lbFirstName AS System.Windows.Forms.Label NO-UNDO. DEFINE PRIVATE VARIABLE lbDataAd AS System.Windows.Forms.Label NO-UNDO. DEFINE PRIVATE VARIABLE groupBox1 AS System.Windows.Forms.GroupBox NO-UNDO. DEFINE PRIVATE VARIABLE errpName AS System.Windows.Forms.ErrorProvider NO-UNDO. DEFINE PRIVATE VARIABLE tbName AS System.Windows.Forms.TextBox NO-UNDO. DEFINE PRIVATE VARIABLE tbFirstName AS System.Windows.Forms.TextBox NO-UNDO. DEFINE PRIVATE VARIABLE tbAddData AS System.Windows.Forms.TextBox NO-UNDO. DEFINE PRIVATE VARIABLE NameValidated AS LOGICAL NO-UNDO. DEFINE PRIVATE VARIABLE FirstNameValidated AS LOGICAL NO-UNDO. DEFINE PUBLIC PROPERTY UserName AS CHARACTER INITIAL ? NO-UNDO GET. PRIVATE SET (INPUT nm AS CHARACTER): ASSIGN UserName = nm. END SET. DEFINE PUBLIC PROPERTY UserFirstName AS CHARACTER INITIAL ? NO-UNDO GET. PRIVATE SET (INPUT setValue AS CHARACTER): ASSIGN UserFirstName = setValue. END SET. DEFINE PUBLIC PROPERTY AdditionalData AS CHARACTER INITIAL ? NO-UNDO GET. PRIVATE SET (INPUT setValue AS CHARACTER): ASSIGN AdditionalData = setValue. END SET. DEFINE PUBLIC PROPERTY formStatus AS LOGICAL INITIAL FALSE NO-UNDO GET. PROTECTED SET (INPUT setValue AS LOGICAL): ASSIGN formStatus = setValue. END SET. CONSTRUCTOR PUBLIC FormUser (): SUPER(). InitializeComponent(). THIS-OBJECT:ComponentsCollection:ADD(THIS-OBJECT:components). CATCH e AS Progress.Lang.Error: UNDO, THROW e. END CATCH. END CONSTRUCTOR. /*------------------------------------------------------------------------------ Purpose: Notes: ------------------------------------------------------------------------------*/ @VisualDesigner. METHOD PRIVATE VOID btnAceptar_Click( INPUT sender AS System.Object, INPUT e AS System.EventArgs ): IF NameValidated AND FirstNameValidated THEN DO: UserName = tbName:Text. UserFirstName = tbFirstName:Text. AdditionalData = tbAddData:Text. formStatus = TRUE. THIS-OBJECT:DialogResult = System.Windows.Forms.DialogResult:Ok. THIS-OBJECT:Close ( ). END. RETURN. END METHOD. /*------------------------------------------------------------------------------ Purpose: Notes: ------------------------------------------------------------------------------*/ @VisualDesigner. METHOD PRIVATE VOID btnCancelar_Click( INPUT sender AS System.Object, INPUT e AS System.EventArgs ): THIS-OBJECT:DialogResult = System.Windows.Forms.DialogResult:Cancel. THIS-OBJECT:Close ( ). RETURN. END METHOD. METHOD PRIVATE VOID InitializeComponent( ): /* NOTE: The following method is automatically generated. We strongly suggest that the contents of this method only be modified using the Visual Designer to avoid any incompatible modifications. Modifying the contents of this method using a code editor will invalidate any support for this file. */ THIS-OBJECT:components = NEW System.ComponentModel.Container(). THIS-OBJECT:groupBox1 = NEW System.Windows.Forms.GroupBox(). THIS-OBJECT:tbAddData = NEW System.Windows.Forms.TextBox(). THIS-OBJECT:lbDataAd = NEW System.Windows.Forms.Label(). THIS-OBJECT:tbFirstName = NEW System.Windows.Forms.TextBox(). THIS-OBJECT:lbFirstName = NEW System.Windows.Forms.Label(). THIS-OBJECT:tbName = NEW System.Windows.Forms.TextBox(). THIS-OBJECT:lbName = NEW System.Windows.Forms.Label(). THIS-OBJECT:errpName = NEW System.Windows.Forms.ErrorProvider(THIS-OBJECT:components). THIS-OBJECT:btnCancelar = NEW System.Windows.Forms.Button(). THIS-OBJECT:btnAceptar = NEW System.Windows.Forms.Button(). THIS-OBJECT:groupBox1:SuspendLayout(). CAST(THIS-OBJECT:errpName, System.ComponentModel.ISupportInitialize):BeginInit(). THIS-OBJECT:SuspendLayout(). /* */ /* groupBox1 */ /* */ THIS-OBJECT:groupBox1:Controls:Add(THIS-OBJECT:tbAddData). THIS-OBJECT:groupBox1:Controls:Add(THIS-OBJECT:lbDataAd). THIS-OBJECT:groupBox1:Controls:Add(THIS-OBJECT:tbFirstName). THIS-OBJECT:groupBox1:Controls:Add(THIS-OBJECT:lbFirstName). THIS-OBJECT:groupBox1:Controls:Add(THIS-OBJECT:tbName). THIS-OBJECT:groupBox1:Controls:Add(THIS-OBJECT:lbName). THIS-OBJECT:groupBox1:Location = NEW System.Drawing.Point(12, 12). THIS-OBJECT:groupBox1:Name = "groupBox1". THIS-OBJECT:groupBox1:Size = NEW System.Drawing.Size(268, 194). THIS-OBJECT:groupBox1:TabIndex = 0. THIS-OBJECT:groupBox1:TabStop = FALSE. THIS-OBJECT:groupBox1:Text = "Usuario". THIS-OBJECT:groupBox1:UseCompatibleTextRendering = TRUE. /* */ /* tbAddData */ /* */ THIS-OBJECT:tbAddData:Location = NEW System.Drawing.Point(6, 152). THIS-OBJECT:tbAddData:Name = "tbAddData". THIS-OBJECT:tbAddData:Size = NEW System.Drawing.Size(243, 20). THIS-OBJECT:tbAddData:TabIndex = 5. /* */ /* lbDataAd */ /* */ THIS-OBJECT:lbDataAd:Location = NEW System.Drawing.Point(7, 133). THIS-OBJECT:lbDataAd:Name = "lbDataAd". THIS-OBJECT:lbDataAd:Size = NEW System.Drawing.Size(100, 16). THIS-OBJECT:lbDataAd:TabIndex = 4. THIS-OBJECT:lbDataAd:Text = "Datos adicionales:". THIS-OBJECT:lbDataAd:UseCompatibleTextRendering = TRUE. /* */ /* tbFirstName */ /* */ THIS-OBJECT:tbFirstName:Location = NEW System.Drawing.Point(7, 100). THIS-OBJECT:tbFirstName:Name = "tbFirstName". THIS-OBJECT:tbFirstName:Size = NEW System.Drawing.Size(242, 20). THIS-OBJECT:tbFirstName:TabIndex = 3. THIS-OBJECT:tbFirstName:Validated:Subscribe(THIS-OBJECT:tbFirstName_Validated). /* */ /* lbFirstName */ /* */ THIS-OBJECT:lbFirstName:Location = NEW System.Drawing.Point(7, 80). THIS-OBJECT:lbFirstName:Name = "lbFirstName". THIS-OBJECT:lbFirstName:Size = NEW System.Drawing.Size(100, 16). THIS-OBJECT:lbFirstName:TabIndex = 2. THIS-OBJECT:lbFirstName:Text = "Apellidos:". THIS-OBJECT:lbFirstName:UseCompatibleTextRendering = TRUE. /* */ /* tbName */ /* */ THIS-OBJECT:tbName:Location = NEW System.Drawing.Point(7, 47). THIS-OBJECT:tbName:Name = "tbName". THIS-OBJECT:tbName:Size = NEW System.Drawing.Size(242, 20). THIS-OBJECT:tbName:TabIndex = 1. THIS-OBJECT:tbName:Validated:Subscribe(THIS-OBJECT:tbName_Validated). /* */ /* lbName */ /* */ THIS-OBJECT:lbName:Location = NEW System.Drawing.Point(7, 27). THIS-OBJECT:lbName:Name = "lbName". THIS-OBJECT:lbName:Size = NEW System.Drawing.Size(100, 16). THIS-OBJECT:lbName:TabIndex = 0. THIS-OBJECT:lbName:Text = "Nombre(s):". THIS-OBJECT:lbName:UseCompatibleTextRendering = TRUE. /* */ /* errpName */ /* */ THIS-OBJECT:errpName:BlinkStyle = System.Windows.Forms.ErrorBlinkStyle:NeverBlink. THIS-OBJECT:errpName:ContainerControl = THIS-OBJECT. /* */ /* btnCancelar */ /* */ THIS-OBJECT:btnCancelar:CausesValidation = FALSE. THIS-OBJECT:btnCancelar:DialogResult = System.Windows.Forms.DialogResult:Cancel. THIS-OBJECT:btnCancelar:Location = NEW System.Drawing.Point(205, 212). THIS-OBJECT:btnCancelar:Name = "btnCancelar". THIS-OBJECT:btnCancelar:Size = NEW System.Drawing.Size(75, 23). THIS-OBJECT:btnCancelar:TabIndex = 1. THIS-OBJECT:btnCancelar:Text = "Cancelar". THIS-OBJECT:btnCancelar:UseCompatibleTextRendering = TRUE. THIS-OBJECT:btnCancelar:UseVisualStyleBackColor = TRUE. THIS-OBJECT:btnCancelar:Click:Subscribe(THIS-OBJECT:btnCancelar_Click). /* */ /* btnAceptar */ /* */ THIS-OBJECT:btnAceptar:Location = NEW System.Drawing.Point(124, 212). THIS-OBJECT:btnAceptar:Name = "btnAceptar". THIS-OBJECT:btnAceptar:Size = NEW System.Drawing.Size(75, 23). THIS-OBJECT:btnAceptar:TabIndex = 2. THIS-OBJECT:btnAceptar:Text = "Aceptar". THIS-OBJECT:btnAceptar:UseCompatibleTextRendering = TRUE. THIS-OBJECT:btnAceptar:UseVisualStyleBackColor = TRUE. THIS-OBJECT:btnAceptar:Click:Subscribe(THIS-OBJECT:btnAceptar_Click). /* */ /* FormUser */ /* */ THIS-OBJECT:AcceptButton = THIS-OBJECT:btnAceptar. THIS-OBJECT:CancelButton = THIS-OBJECT:btnCancelar. THIS-OBJECT:CausesValidation = FALSE. THIS-OBJECT:ClientSize = NEW System.Drawing.Size(292, 241). THIS-OBJECT:Controls:Add(THIS-OBJECT:btnAceptar). THIS-OBJECT:Controls:Add(THIS-OBJECT:btnCancelar). THIS-OBJECT:Controls:Add(THIS-OBJECT:groupBox1). THIS-OBJECT:FormBorderStyle = System.Windows.Forms.FormBorderStyle:FixedSingle. THIS-OBJECT:MaximizeBox = FALSE. THIS-OBJECT:MinimizeBox = FALSE. THIS-OBJECT:Name = "FormUser". THIS-OBJECT:StartPosition = System.Windows.Forms.FormStartPosition:CenterScreen. THIS-OBJECT:Text = "Nuevo registro". THIS-OBJECT:TransparencyKey = System.Drawing.Color:FromArgb(System.Convert:ToInt32(System.Convert:ToByte(224)), System.Convert:ToInt32(System.Convert:ToByte(224)), System.Convert:ToInt32(System.Convert:ToByte(224))). THIS-OBJECT:groupBox1:ResumeLayout(FALSE). THIS-OBJECT:groupBox1:PerformLayout(). CAST(THIS-OBJECT:errpName, System.ComponentModel.ISupportInitialize):EndInit(). THIS-OBJECT:ResumeLayout(FALSE). CATCH e AS Progress.Lang.Error: UNDO, THROW e. END CATCH. END METHOD. /*------------------------------------------------------------------------------ Purpose: Notes: ------------------------------------------------------------------------------*/ @VisualDesigner. METHOD PRIVATE VOID tbFirstName_Validated( INPUT sender AS System.Object, INPUT e AS System.EventArgs ): IF tbFirstName:TextLength > 0 THEN DO: errpName:SetError(tbFirstName,""). FirstNameValidated = TRUE. END. ELSE DO: errpName:SetError(tbFirstName, "Apellidos son requeridos"). FirstNameValidated = FALSE. END. RETURN. END METHOD. /*------------------------------------------------------------------------------ Purpose: Notes: ------------------------------------------------------------------------------*/ @VisualDesigner. METHOD PRIVATE VOID tbName_Validated( INPUT sender AS System.Object, INPUT e AS System.EventArgs ): IF tbName:TextLength > 0 THEN DO: errpName:SetError(tbName,""). NameValidated = TRUE. END. ELSE DO: errpName:SetError(tbName, "Nombre es requerido"). NameValidated = FALSE. END. RETURN. END METHOD. DESTRUCTOR PUBLIC FormUser ( ): END DESTRUCTOR. END CLASS.
Consider contributing to OE Hive http://www.oehive.org/ where it will be indexed so people can find it.
Thanks.. bet on int
I had a very bad time trying to login... I setup a account several years ago, but can't get access... Trying to register, won't get confirmation email, and trying to re-register, it says is taken that username alread, and try to login with that name, and it says that name is not registered...
What user name? Contact me offline at thomas@cintegrity.com
Same to me Thomas. I just sent you an email concerning ABL2DB. My username on oehive is "mabraton".
Your account has been activated. Enjoy!