public int checkUserCreds(string Email, string Password) { int checkedUser = 0; Encrypt newCrypt = new Encrypt(); string encPassword = newCrypt.EncryptString(Password); var db = new PetaPoco.Database("Olgarsconnection"); VSLog vsLogger = new VSLog(); vsLogger.WriteDebug("About to select"); try { checkedUser = db.ExecuteScalar <int>("SELECT Count(*) FROM [User] WHERE EmailAddress=@0 AND UserPassword=@1 AND SysStatus=0 and DeleteStatus=0", Email, encPassword); } catch (Exception ex) { string apiResponse = ""; string sqlError = ""; string exMessage = ex.Message.ToString(); sqlError = db.LastSQL; vsLogger.WriteDebug("Logon Error"); vsLogger.WriteDebug(exMessage); apiResponse = exMessage; checkedUser = 0; } return(checkedUser); }
private void btnLogon_Click(object sender, EventArgs e) { Models.CurrentUser PresentUser = new Models.CurrentUser(); Controllers.UserOperations userOps = new Controllers.UserOperations(); if (string.IsNullOrWhiteSpace(txtUser.Text) == true | string.IsNullOrWhiteSpace(txtPwd.Text) == true) { lblError.Text = "Incorrect User Information"; } else { //for Testing = 1 VSLog vsLogger = new VSLog(); vsLogger.WriteDebug("About to Logon"); vsLogger.WriteDebug(txtUser.Text); int userstatus = 1; //userstatus = userOps.checkUserCreds(txtUser.Text, txtPwd.Text); if (userstatus > 0) { lblError.Text = "Correct User Information All Good"; this.Hide(); DigiScan frmScan = new DigiScan(); frmScan.ShowDialog(); this.Close(); } else { lblError.Text = "Incorrect User Credentials"; } } }
private void DigiScan_Load(object sender, EventArgs e) { VSLog vsLogger = new VSLog(); vsLogger.WriteDebug("Loaded Scanning Page" + System.DateTime.Now.ToString()); this.AutoSize = true; this.AutoSizeMode = AutoSizeMode.GrowOnly; }
private void DigiSignLogon_Load(object sender, EventArgs e) { VSLog vsLogger = new VSLog(); vsLogger.WriteDebug("Starting VDI Logon" + System.DateTime.Now.ToString()); this.AutoSize = true; this.AutoSizeMode = AutoSizeMode.GrowOnly; }
private void disableButtons(string custIdNo) { VSLog vsLogger = new VSLog(); vsLogger.WriteDebug("Disabling Buttons for ID No" + custIdNo); btnSearchPad.Visible = false; btnStartScan.Visible = false; btnStopScan.Visible = false; btnSaveScan.Visible = false; }
private void sendOtp(string fullName, string custIdNo) { VSLog vsLogger = new VSLog(); string response = ""; string otpNo = ""; otpNo = GenerateSignCode(custIdNo); Controllers.SMSMessageOperations smsOps = new Controllers.SMSMessageOperations(); Models.SMSObj smsObj = new Models.SMSObj(); vsLogger.WriteDebug("Inside SMS Code "); smsObj.messageText = "You about to sign a document please provide this ICARS Signing Security OTP " + otpNo + " to the Sales Team Member"; smsObj.toNumber = getMobileNumber(custIdNo); // "0834634921"; //smsObj.toNumber = "0799425095"; smsObj.olgarsUser = "******"; smsObj.toUser = fullName; smsObj.olgarsEmail = fullName; response = smsOps.sendManualSMSMessage(smsObj, "3", 2); //Add the to the DB the OTP Models.DigiSignature thisDigiSign = new Models.DigiSignature(); thisDigiSign.DateAdded = DateTime.Now; thisDigiSign.AddedBy = fullName; thisDigiSign.ResidentId = custIdNo; thisDigiSign.ResidentInitial = "NotSetup"; thisDigiSign.ResidentSignature = "NotSetup"; thisDigiSign.SalesInitial = "NotSetup"; thisDigiSign.SalesSignature = "NotSetup"; thisDigiSign.WitnessInitial = "NotSetup"; thisDigiSign.WitnessName = "NotSetup"; thisDigiSign.WitnessSignature = "NotSetup"; thisDigiSign.OtpNo = otpNo; thisDigiSign.ServerPath = GenerateFileName(); //Remove whatever Signature is there //Always a unique combination //Need to delete the files as well at some point deleteCustId(custIdNo); int thiSigId = addSig(thisDigiSign); }