public ActionResult Visitor(Visitor model, string id) { //TODO if (model.Biodata != null) { //Check identification M2SysBiometricService.BioPluginService bioplugin = new M2SysBiometricService.BioPluginService(); var id_result = bioplugin.IdentifyQuick(model.Biodata, 0, 1, 1); _logger.Debug(string.Format("IDENTIFY | GATE [{0}] RESULT [(1)]", "Visitor Gate", id_result)); Guid visitor_id; if (Guid.TryParse(id_result, out visitor_id)) { model.Result = LogAccessIdentity(id_result, id); model.PassId = CreateVisitorPass(model, visitor_id); if (model.PassId != Guid.Empty) { model.AllowPrintPass = true; model.RptUrl = string.Format("../reports/ReportViewer.aspx?RptParams=pPassId,{0}", model.PassId); return RenderVisitorPass(model.PassId); } } else model.Result = "Your finger scan was not recognized. Please see terminal officer for enrollment in the identification system."; } model.Biodata = null; return View(model); }
private Guid CreateVisitorPass(Visitor model, Guid registrationId) { var sqlConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString; SqlService sql = new SqlService(sqlConnectionString); sql.AddParameter("pRegistrationId", System.Data.SqlDbType.UniqueIdentifier, registrationId); sql.AddParameter("pToSee", System.Data.SqlDbType.VarChar, model.ToSee); sql.AddParameter("pDepartment", System.Data.SqlDbType.VarChar, model.Department); sql.AddParameter("pPurpose", System.Data.SqlDbType.VarChar, model.Purpose); sql.AddParameter("pIssuedBy", System.Data.SqlDbType.VarChar, User.Identity.Name); using (SqlDataReader reader = sql.ExecuteSPReader("ICMS_spCreateVisitorPass")) { if (reader.HasRows) { reader.Read(); return reader.GetGuid(0); } } return Guid.Empty; }
public ActionResult Visitor(string id) { Visitor model = new Visitor(); //model.AllowPrintPass = true; //model.RptUrl = string.Format("../reports/ReportViewer.aspx?RptParams={0}", "pPassId,101f2dfd-eb01-4539-816e-708aaf8ad262"); return View(model); }