public dynamic GetDefaultInfo()
        {
            FPTemplate model = new FPTemplate();

            model.Errors = new Dictionary <string, string>();
            try
            {
                model = _fpTemplateService.GetQueryable().FirstOrDefault();
            }
            catch (Exception ex)
            {
                LOG.Error("GetInfo", ex);
                model.Errors.Add("Generic", "Error " + ex);

                return(Json(new
                {
                    model.Errors
                }, JsonRequestBehavior.AllowGet));
            }

            return(Json(new
            {
                model.Id,
                model.PIN,
                model.FPUserId,
                FPUserPIN = model.FPUser.PIN,
                FPUser = model.FPUser.Name,
                model.FingerID,
                model.Valid,
                model.Size,
                model.Template,
                model.Errors
            }, JsonRequestBehavior.AllowGet));
        }
        public dynamic Insert(FPTemplate model)
        {
            model.Errors = new Dictionary <string, string>();
            try
            {
                if (!AuthenticationModel.IsAllowed("Create", Core.Constants.Constant.MenuName.FPUser, Core.Constants.Constant.MenuGroupName.Setting))
                {
                    model.Errors.Add("Generic", "You are Not Allowed to Add record");

                    return(Json(new
                    {
                        model.Errors
                    }, JsonRequestBehavior.AllowGet));
                }

                model.Size     = model.Template.Length;
                model.IsInSync = false;
                model          = _fpTemplateService.CreateObject(model, _fpUserService);
            }
            catch (Exception ex)
            {
                LOG.Error("Insert Failed", ex);
                model.Errors.Add("Generic", "Error " + ex);

                return(Json(new
                {
                    model.Errors
                }, JsonRequestBehavior.AllowGet));
            }

            return(Json(new
            {
                model.Errors
            }));
        }
Exemple #3
0
 public bool ValidCreateObject(FPTemplate fpTemplate, IFPTemplateService _fpTemplateService, IFPUserService _fpUserService)
 {
     VHasUser(fpTemplate, _fpUserService);
     if (!isValid(fpTemplate))
     {
         return(false);
     }
     VHasUniqueFingerID(fpTemplate, _fpTemplateService);
     return(isValid(fpTemplate));
 }
Exemple #4
0
        public FPTemplate VHasUser(FPTemplate fpTemplate, IFPUserService _fpUserService)
        {
            FPUser fpUser = _fpUserService.GetObjectById(fpTemplate.FPUserId);

            if (fpUser == null)
            {
                fpTemplate.Errors.Add("FPUser", "Tidak ada");
            }
            return(fpTemplate);
        }
Exemple #5
0
 public FPTemplate VHasUniqueFingerID(FPTemplate fpTemplate, IFPTemplateService _fpTemplateService)
 {
     if (fpTemplate.FingerID < 0 || fpTemplate.FingerID > 9)
     {
         fpTemplate.Errors.Add("FingerID", "Harus antara 0 sampai 9");
     }
     else if (_fpTemplateService.IsFingerIDDuplicated(fpTemplate))
     {
         fpTemplate.Errors.Add("FingerID", "Tidak boleh ada duplikasi");
     }
     return(fpTemplate);
 }
Exemple #6
0
        public string PrintError(FPTemplate obj)
        {
            string erroroutput = "";
            KeyValuePair <string, string> first = obj.Errors.ElementAt(0);

            erroroutput += first.Key + "," + first.Value;
            foreach (KeyValuePair <string, string> pair in obj.Errors.Skip(1))
            {
                erroroutput += Environment.NewLine;
                erroroutput += pair.Key + "," + pair.Value;
            }
            return(erroroutput);
        }
 public FPTemplate SoftDeleteObject(FPTemplate fpTemplate, IFPUserService _fpUserService)
 {
     if (_validator.ValidDeleteObject(fpTemplate))
     {
         //fpTemplate.IsInSync = false;
         _repository.SoftDeleteObject(fpTemplate);
         //FPUser fpUser = _fpUserService.GetObjectById(fpTemplate.FPUserId);
         //if (fpUser != null && fpUser.IsInSync)
         //{
         //    fpUser.IsInSync = false;
         //    _fpUserService.GetRepository().Update(fpUser);
         //}
     }
     return(fpTemplate);
 }
        public FPTemplate UpdateOrCreateObject(FPTemplate fpTemplate, IFPUserService _fpUserService)
        {
            //fpTemplate.Errors = new Dictionary<String, String>();
            FPTemplate obj = GetObjectById(fpTemplate.Id);

            if (obj == null)
            {
                CreateObject(fpTemplate, _fpUserService);
                fpTemplate = GetObjectById(fpTemplate.Id); // so virtual can be accessed/included
            }
            else
            {
                UpdateObject(fpTemplate, _fpUserService);
            }
            return(fpTemplate);
        }
 public FPTemplate UpdateObject(FPTemplate fpTemplate, IFPUserService _fpUserService)
 {
     fpTemplate.Errors = new Dictionary <String, String>();
     if (_validator.ValidUpdateObject(fpTemplate, this, _fpUserService))
     {
         //fpTemplate.IsInSync = false;
         _repository.UpdateObject(fpTemplate);
         //FPUser fpUser = _fpUserService.GetObjectById(fpTemplate.FPUserId);
         //if (fpUser != null && fpUser.IsInSync)
         //{
         //    fpUser.IsInSync = false;
         //    _fpUserService.GetRepository().Update(fpUser);
         //}
     }
     return(fpTemplate);
 }
        public dynamic Update(FPTemplate model)
        {
            model.Errors = new Dictionary <string, string>();
            try
            {
                if (!AuthenticationModel.IsAllowed("Edit", Core.Constants.Constant.MenuName.FPUser, Core.Constants.Constant.MenuGroupName.Setting))
                {
                    model.Errors.Add("Generic", "You are Not Allowed to Edit record");

                    return(Json(new
                    {
                        model.Errors
                    }, JsonRequestBehavior.AllowGet));
                }

                var data = _fpTemplateService.GetObjectById(model.Id);
                data.FPUserId = model.FPUserId;
                data.PIN      = model.PIN;
                data.FingerID = model.FingerID;
                data.Valid    = model.Valid;
                data.Template = model.Template;
                data.Size     = model.Template.Length; //model.Size;
                data.IsInSync = false;

                model = _fpTemplateService.UpdateObject(data, _fpUserService);
            }
            catch (Exception ex)
            {
                LOG.Error("Update Failed", ex);
                model.Errors.Add("Generic", "Error " + ex);

                return(Json(new
                {
                    model.Errors
                }, JsonRequestBehavior.AllowGet));
            }

            return(Json(new
            {
                model.Errors
            }));
        }
        public dynamic Delete(FPTemplate model)
        {
            model.Errors = new Dictionary <string, string>();
            try
            {
                if (!AuthenticationModel.IsAllowed("Delete", Core.Constants.Constant.MenuName.FPUser, Core.Constants.Constant.MenuGroupName.Setting))
                {
                    model.Errors.Add("Generic", "You are Not Allowed to Delete Record");

                    return(Json(new
                    {
                        model.Errors
                    }, JsonRequestBehavior.AllowGet));
                }

                var data = _fpTemplateService.GetObjectById(model.Id);
                data.IsInSync = false;
                model         = _fpTemplateService.SoftDeleteObject(data, _fpUserService);
            }

            catch (Exception ex)
            {
                LOG.Error("Delete Failed", ex);
                model.Errors.Add("Generic", "Error " + ex);

                return(Json(new
                {
                    model.Errors
                }, JsonRequestBehavior.AllowGet));
            }

            return(Json(new
            {
                model.Errors
            }));
        }
Exemple #12
0
        public bool IsFingerIDDuplicated(FPTemplate fpTemplate)
        {
            IQueryable <FPTemplate> objs = _repository.FindAll(x => x.FingerID == fpTemplate.FingerID && x.FPUserId == fpTemplate.FPUserId && !x.IsDeleted && x.Id != fpTemplate.Id);

            return(objs.Count() > 0 ? true : false);
        }
Exemple #13
0
        private void VerifyDone(object obj)
        {
            DpSdkEngLib.AISecureModeMask nullSecureModeMask = new DpSdkEngLib.AISecureModeMask();

            bool notMatched = false;
            bool verifyOK   = false;

            object nullObject = 0;
            bool   nullBool   = true;


            {
                DataTable dt = DAT_Biometric.ViewFingerPrintTemplate();

                if (dt.Rows.Count <= 0)
                {
                    this.lblStatus.Text = "No fingerprint template in databse";
                }

                foreach (DataRow dataRow in dt.Rows)
                {
                    FPTemplate      verifyTemplate = (FPTemplate)obj;
                    FPTemplateClass RegTemplate    = new FPTemplateClass();


                    RegTemplate.Import(dataRow["FingerprintTemplate"]);

                    FPVerifyClass verify = new FPVerifyClass();
                    verify.Compare(RegTemplate,
                                   verifyTemplate,
                                   ref verifyOK,
                                   ref nullObject,
                                   ref nullObject,
                                   ref nullBool,
                                   ref nullSecureModeMask);

                    if (verifyOK)
                    {
                        this.txtUserID.Text = dataRow["UserID"].ToString();
                        this.lblStatus.Text = "Fingerprint Verified";

                        #region Show Employee Information
                        SqlDataAdapter sqlDataAdapter2 = new SqlDataAdapter("SELECT * FROM tblUsers WHERE UserID = '" + dataRow["UserID"] + "'", DAT_Biometric.cs);
                        DataTable      dataTable2      = new DataTable();
                        sqlDataAdapter2.Fill(dataTable2);

                        txtUsername.Text = dataTable2.Rows[0]["Username"].ToString();
                        txtFName.Text    = dataTable2.Rows[0]["FName"].ToString();
                        txtLName.Text    = dataTable2.Rows[0]["LName"].ToString();

                        //if (dataTable2.Rows[0]["Picture"] == null)
                        //{
                        //    byte[] numArray = new byte[0];
                        //    this.pictureBoxImage.Image = Image.FromStream((Stream)new MemoryStream((byte[])dataTable2.Rows[0]["Picture"]));
                        //}
                        #endregion

                        notMatched = true;
                        string userID = dataRow["UserID"].ToString();

                        //TODO: Note that in your users table you should have
                        //      a userStatus to know if the user is in or out
                        //      when creating a new user make the userStatus Out
                        string userStatus = DAT_Biometric.GetUserStatus(userID);

                        current = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);

                        if (userStatus == "Out")
                        {
                            DAT_Biometric.InsertAttendance(userID, "In");
                            lblTime.Visible        = true;
                            lblTime.Text           = this.current.ToString();
                            lblSaveSuccess.Visible = true;
                            lblSaveSuccess.Text    = "Save Successful";
                            MessageBox.Show("Welcome");
                        }
                        else if (userStatus == "In")
                        {
                            DAT_Biometric.InsertAttendance(userID, "Out");
                            lblTime.Visible        = true;
                            lblTime.Text           = this.current.ToString();
                            lblSaveSuccess.Visible = true;
                            lblSaveSuccess.Text    = "Save Successful";
                            MessageBox.Show("Goodbye");
                        }
                        break;
                    }
                    else
                    {
                        notMatched = false;
                    }
                }
                if (!notMatched)
                {
                    this.txtUserID.Text = "";
                    this.lblStatus.Text = "Fingerprint not in Record";
                }

                verifyTemple.Run(0);
            }
        }
Exemple #14
0
        public bool isValid(FPTemplate obj)
        {
            bool isValid = !obj.Errors.Any();

            return(isValid);
        }
Exemple #15
0
 public bool ValidDeleteObject(FPTemplate fpTemplate)
 {
     fpTemplate.Errors.Clear();
     return(isValid(fpTemplate));
 }
Exemple #16
0
 public bool ValidUpdateObject(FPTemplate fpTemplate, IFPTemplateService _fpTemplateService, IFPUserService _fpUserService)
 {
     fpTemplate.Errors.Clear();
     ValidCreateObject(fpTemplate, _fpTemplateService, _fpUserService);
     return(isValid(fpTemplate));
 }
Exemple #17
0
        public bool DownloadAllUserData(FPMachine fpMachine, IFPUserService _fpUserService, IFPTemplateService _fpTemplateService, IEmployeeService _employeeService)
        {
            if (fpMachine == null || fpMachine.Id <= 0)
            {
                fpMachine.Errors.Add("Generic", "FingerPrint Machine ID not found!");
            }
            else
            {
                if (FPMachines.fpDevices[fpMachine.Id] == null)
                {
                    fpMachine.IsConnected = false;                                             // FPMachines.fpDevices.Add(FPMachineId, new FPDevice.ZKEvents());
                }
                else
                {
                    fpMachine.IsConnected = FPMachines.fpDevices[fpMachine.Id].bIsConnected;
                }
                if (fpMachine.IsConnected == false)
                {
                    fpMachine.Errors.Add("Generic", "Please connect the device first!");
                    return(false);
                }
                bool ok = true;
                lock (FPMachines.fpDevices[fpMachine.Id]._locker)
                {
                    //judge whether the device supports 9.0 fingerprint arithmetic
                    string sOption = "~ZKFPVersion";
                    string sValue  = "";
                    if (FPMachines.fpDevices[fpMachine.Id].axCZKEM1.GetSysOption(fpMachine.MachineNumber, sOption, out sValue))
                    {
                        //FPTemplate of v9 (uses 512B) and v10(uses 1.6kB) are not compatible
                        //if (sValue == "10")
                        //{
                        //    fpMachine.Errors.Add("Generic", "Your device is not using 9.0 arithmetic!");
                        //    return false;
                        //}
                    }
                    FPMachines.fpDevices[fpMachine.Id].Disable(); //.axCZKEM1.DisableDeviceWithTimeOut(fpMachine.MachineNumber, FPMachines.fpDevices[fpMachine.Id].DisabledTime); //.EnableDevice(fpMachine.MachineNumber, false); // Prevent user from using the device
                    try
                    {
                        FPMachines.fpDevices[fpMachine.Id].axCZKEM1.BeginBatchUpdate(fpMachine.MachineNumber, (int)FPDevice.BatchUpdateFlag.Overwrite); //create memory space for batching data

                        if (!FPMachines.fpDevices[fpMachine.Id].axCZKEM1.ReadAllUserID(fpMachine.MachineNumber))                                        //read all the user information to the memory
                        {
                            string err = FPMachines.fpDevices[fpMachine.Id].GetLastErrorMsg();
                            if (FPMachines.fpDevices[fpMachine.Id].iLastError != (int)FPDevice.ErrorCode.DataNotFound)
                            {
                                fpMachine.Errors.Add("Generic", "Unable to read All UserID (Error:" + err + ")");
                                ok = false;
                            }
                        }
                        if (ok && !FPMachines.fpDevices[fpMachine.Id].axCZKEM1.ReadAllTemplate(fpMachine.MachineNumber)) //read all the users' fingerprint templates to the memory
                        {
                            string err = FPMachines.fpDevices[fpMachine.Id].GetLastErrorMsg();
                            if (FPMachines.fpDevices[fpMachine.Id].iLastError != (int)FPDevice.ErrorCode.DataNotFound)
                            {
                                fpMachine.Errors.Add("Generic", "Unable to read All Templates (Error:" + err + ")");
                                ok = false;
                            }
                        }
                        int    idwEnrollNumber = 0;
                        string sName           = "";
                        string sPassword       = "";
                        int    iPrivilege      = 0;
                        bool   bEnabled        = false;
                        string card            = "";
                        int    pin2            = 0;
                        int    grp             = 0;
                        string TZstr           = "";

                        //string sTmpData = "";
                        byte[] bTmpData   = new byte[2048];
                        int    iTmpLength = 0;
                        int    iFlag      = 0;
                        //FPDevice._Template9_ tmp9;
                        int    vs  = (int)FPDevice.VerifyMethod.UnSet;
                        byte[] rsv = new byte[4];

                        if (ok)
                        {
                            // Mark All User as Not InSync first
                            foreach (var fpUser in _fpUserService.GetAll())
                            {
                                fpUser.IsInSync = false;
                            }

                            while (FPMachines.fpDevices[fpMachine.Id].axCZKEM1.GetAllUserInfo(fpMachine.MachineNumber, ref idwEnrollNumber, ref sName, ref sPassword, ref iPrivilege, ref bEnabled)) //get all the users' information from the memory
                            {
                                FPMachines.fpDevices[fpMachine.Id].axCZKEM1.GetPIN2(idwEnrollNumber, ref pin2);
                                FPMachines.fpDevices[fpMachine.Id].axCZKEM1.GetStrCardNumber(out card);
                                FPMachines.fpDevices[fpMachine.Id].axCZKEM1.GetUserGroup(fpMachine.MachineNumber, idwEnrollNumber, ref grp);
                                FPMachines.fpDevices[fpMachine.Id].axCZKEM1.GetUserTZStr(fpMachine.MachineNumber, idwEnrollNumber, ref TZstr);
                                FPMachines.fpDevices[fpMachine.Id].axCZKEM1.GetUserInfoEx(fpMachine.MachineNumber, idwEnrollNumber, out vs, out rsv[0]);
                                var err = FPMachines.fpDevices[fpMachine.Id].GetLastErrorMsg();

                                FPUser fpUser = _fpUserService.GetObjectByPIN(idwEnrollNumber);
                                if (fpUser == null)
                                {
                                    fpUser = new FPUser();
                                }
                                fpUser.PIN        = idwEnrollNumber;
                                fpUser.Name       = sName;
                                fpUser.Password   = sPassword;
                                fpUser.Privilege  = (byte)iPrivilege;
                                fpUser.IsEnabled  = bEnabled;
                                fpUser.Card       = card;
                                fpUser.PIN2       = pin2;
                                fpUser.Group      = (byte)grp;
                                fpUser.TimeZones  = TZstr;
                                fpUser.VerifyMode = vs;
                                fpUser.Reserved   = BitConverter.ToString(rsv).Replace("-", ""); //rsv.CopyTo(fpUser.Reserved, 0);
                                fpUser.IsInSync   = true;
                                _fpUserService.UpdateOrCreateObject(fpUser, _employeeService);
                                //Mark All fpTemplates as not InSync, thus non-existing fpTemplates will remain not InSync
                                var tmplist = _fpTemplateService.GetQueryable().Where(x => x.FPUserId == fpUser.Id);
                                foreach (var tmp in tmplist.Where(x => x.IsInSync && !x.IsDeleted).ToList())
                                {
                                    tmp.IsInSync = false;
                                    //_fpTemplateService.GetRepository().Update(tmp);
                                }
                                //Create or Update existing fpTemplates
                                for (int idwFingerIndex = 0; idwFingerIndex < 10; idwFingerIndex++)
                                {
                                    //if (FPMachines.fpDevices[fpMachine.Id].axCZKEM1.GetUserTmpExStr(fpMachine.MachineNumber, idwEnrollNumber, idwFingerIndex, ref sTmpData, ref iTmpLength)) //get the corresponding templates string and length from the memory
                                    if (FPMachines.fpDevices[fpMachine.Id].axCZKEM1.GetUserTmpEx(fpMachine.MachineNumber, idwEnrollNumber.ToString(), idwFingerIndex, out iFlag, out bTmpData[0], out iTmpLength))
                                    {
                                        FPTemplate fpTemplate = _fpTemplateService.GetQueryable().Where(x => x.FingerID == idwFingerIndex && x.FPUserId == fpUser.Id && !x.IsDeleted).FirstOrDefault();
                                        if (fpTemplate == null)
                                        {
                                            fpTemplate = new FPTemplate();
                                        }
                                        fpTemplate.FPUserId = fpUser.Id;
                                        fpTemplate.PIN      = (int)fpUser.PIN2;
                                        fpTemplate.FingerID = (short)idwFingerIndex;
                                        //fpTemplate.Template = sTmpData;
                                        fpTemplate.Template = Convert.ToBase64String(bTmpData, 0, iTmpLength); //Encoding.UTF8.GetString(bTmpData, 0, iTmpLength);
                                        fpTemplate.Size     = fpTemplate.Template.Length;                      //iTmpLength
                                        //tmp9 = FPDevice.ConvertStruct.ByteArrayToStruct<FPDevice._Template9_>(bTmpData);
                                        fpTemplate.Valid    = (byte)iFlag;                                     //1; // tmp9.Valid;
                                        fpTemplate.IsInSync = true;
                                        _fpTemplateService.UpdateOrCreateObject(fpTemplate, _fpUserService);
                                    }
                                }
                                tmplist         = tmplist.Where(x => !x.IsInSync);
                                fpUser.IsInSync = (tmplist.Count() == 0);
                                _fpUserService.UpdateObject(fpUser, _employeeService); // reupdate to prevent fpTemplate from changing fpUser.IsInSync to False when Updating
                            }
                        }
                        int errc = FPMachines.fpDevices[fpMachine.Id].GetLastError();
                        if (errc != (int)FPDevice.ErrorCode.NoError && errc != (int)FPDevice.ErrorCode.DataNotFound)
                        {
                            fpMachine.Errors.Add("Generic", "Download Failed (Error:" + FPMachines.fpDevices[fpMachine.Id].GetErrorMsg(errc) + ")");
                            ok = false;
                            //FPMachines.fpDevices[fpMachine.Id].axCZKEM1.CancelBatchUpdate(fpMachine.MachineNumber);
                        }
                        FPMachines.fpDevices[fpMachine.Id].axCZKEM1.BatchUpdate(fpMachine.MachineNumber); //download all the information in the memory
                    }
                    finally
                    {
                        //FPMachines.fpDevices[fpMachine.Id].axCZKEM1.RefreshData(fpMachine.MachineNumber); //the data in the device should be refreshed
                        FPMachines.fpDevices[fpMachine.Id].Enable(); //.axCZKEM1.EnableDevice(fpMachine.MachineNumber, true);
                    }
                }
                return(ok);
            }
            return(false);
        }
        public void OnEnrollFinger(int iEnrollNumber, int iFingerIndex, int iActionResult, int iTemplateLength, int iMachineNumber, int Tag)
        {
            try
            {
                if (iActionResult == 0) //Success
                {
                    //RTEvent OnEnrollFiger Has been Triggered
                    int FPMachineID = Tag; // 0;
                    //FPMachine fpMachine = null;
                    //foreach (var device in FPMachines.fpDevices)
                    //{
                    //    if (device.Value.iMachineNumber == iMachineNumber)
                    //    {
                    //        FPMachineID = device.Value.Tag;
                    //        //fpMachine = _fpMachineService.GetObjectById(FPMachineID);
                    //        break;
                    //    }
                    //}
                    var fpUser = _fpUserService.GetObjectByPIN(iEnrollNumber);
                    if (fpUser != null)
                    {
                        byte[] bTmpData   = new byte[2048];
                        int    iTmpLength = 0;
                        int    iFlag      = 0;
                        if (FPMachines.fpDevices[FPMachineID].axCZKEM1.GetUserTmpEx(iMachineNumber, iEnrollNumber.ToString(), iFingerIndex, out iFlag, out bTmpData[0], out iTmpLength))
                        {
                            FPTemplate fpTemplate = _fpTemplateService.GetQueryable().Where(x => x.FingerID == iFingerIndex && x.FPUserId == fpUser.Id && !x.IsDeleted).FirstOrDefault();
                            if (fpTemplate == null)
                            {
                                fpTemplate = new FPTemplate();
                            }
                            fpTemplate.FPUserId = fpUser.Id;
                            fpTemplate.PIN      = (int)fpUser.PIN2;
                            fpTemplate.FingerID = (short)iFingerIndex;
                            //fpTemplate.Template = sTmpData;
                            fpTemplate.Template = Convert.ToBase64String(bTmpData, 0, iTmpLength); //Encoding.UTF8.GetString(bTmpData, 0, iTmpLength);
                            fpTemplate.Size     = fpTemplate.Template.Length;                      //iTmpLength
                            //tmp9 = FPDevice.ConvertStruct.ByteArrayToStruct<FPDevice._Template9_>(bTmpData);
                            fpTemplate.Valid    = (byte)iFlag;                                     //1; // tmp9.Valid;
                            fpTemplate.IsInSync = true;
                            _fpTemplateService.UpdateOrCreateObject(fpTemplate, _fpUserService);

                            //Notify clients
                            dynamic model = new
                            {
                                fpTemplate.Id,
                                fpTemplate.PIN,
                                fpTemplate.FPUserId,
                                FPUserPIN = fpTemplate.FPUser.PIN,
                                FPUser    = fpTemplate.FPUser.Name,
                                fpTemplate.FingerID,
                                fpTemplate.Valid,
                                fpTemplate.IsInSync,
                                fpTemplate.Size,
                                fpTemplate.Template,
                                fpTemplate.CreatedAt,
                                fpTemplate.UpdatedAt,
                            };
                            string modelstr = JsonConvert.SerializeObject(model, JSONsettings);
                            var    feedback = GlobalHost.ConnectionManager.GetHubContext <FeedbackHub>();
                            //Calls addNewRecord on all clients (javascript function)
                            feedback.Clients.All.addNewRecord(fpTemplate.FPUserId.ToString(), modelstr);
                        }
                    }
                }
                else
                {
                    //RTEvent OnEnrollFiger was Triggered by Error
                }
            }
            finally
            {
            }
        }