Closed srinivas1910 closed 6 years ago
It looks like the 'searchdb' data is really three fields per row, is that correct? Wouldn't you just define a table in the database with three text fields (the code doesn't show any limits on field size that I could see with a quick glance, so maybe nvarchar(max) fields?) then use sergen to generate the C# code. To read the data you'd use the repository method Retrieve method to get existing records from the database. To write new records you could use code like the following to insert new rows, one at a time, (after deleting all existing rows using the UnitOfWork connection and a 'delete' statement or something similar for your backend database system):
private void InsertNewRecord(string mainText, string subText1, string subText2)
{
xyzRow newRow = new xyzRow
{
MainText = mainText,
SubText1 = subText1,
SubText2 = subText2
};
Repositories.xyzRepository _xyzRepository = new xyzRepository();
SaveRequest<xyzRow> xyzSaveRequest = new SaveRequest<xyzRow>()
{
Entity = newRow
};
_xyzRepository.Create(UnitOfWork, xyzSaveRequest);
xyzSaveRequest = null;
newRow = null;
}
Note the 'Repositories' collection may be in some other namespace based upon where the code is located within your project so just look at the namespace within the repository class generated as compared to the namespace in which you place the above code.
Hi @srinivas1910 ,
what exactly would you like to achieve?
Using a Fingerprint sensor attached to a Computer/tablet which then should be used as a 2 factor authentication via a serenity-powered application?
With Kind regards,
John
Hi @JohnRanger ,
You are exactly right, along this i want the same fingerprint to be used for attendance module also. Once the Employee Scans his finger the web app will verify the fingerprint from the database and take the attendance. How to achieve this in Serenity please give me an idea to work this out.
With Best Regards, Srinivas
This is pretty out of scope for issues, and converting a .NET Winforms component to web is not something we do here.
Hi,
Can any body help me out with the following c# code to integrate with the serenity. My main hurdle is with the database side. How to save data from local variables to Database and retrieve the same to the local variable using sergen. The following code is from Nitgen fingerprint SDK.
using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.IO;
using NITGEN.SDK.NBioBSP;
namespace IndexSearchDemoCS { ///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
NBioAPI m_NBioAPI;
NBioAPI.IndexSearch m_IndexSearch;
}
thank you Srinivas