コード例 #1
0
        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);
        }
コード例 #2
0
        public List <vw_CaseDefectsData> GetVictimsByCaseID(int CaseID, int SessionID)
        {
            var victims = (from _case in DataContext.Cases_Cases
                           join _session in DataContext.Cases_CaseSessions on _case.ID equals _session.CaseID
                           join _victim in DataContext.Cases_CaseVictims on _case.ID equals _victim.CaseID
                           join _personVictim in DataContext.Configurations_Persons on _victim.PersonID equals _personVictim.ID
                           join _victimsSessionLog in DataContext.Cases_VictimsSessionsLog on _victim.ID equals _victimsSessionLog.VictimID into VSLog
                           from _vslog in VSLog.DefaultIfEmpty()
                           join _PresenceStatus in DataContext.Configurations_Lookups on _vslog.PresenceStatusID equals _PresenceStatus.ID into PStatus
                           from _ps in PStatus.DefaultIfEmpty()
                           where _case.ID == CaseID && _session.ID == SessionID && _case.IsDeleted != true
                           select new vw_CaseDefectsData
            {
                ID = _victim.ID,
                PersonID = _victim.PersonID,
                Name = _personVictim.FullName,
                NationalID = _personVictim.NationalID,
                DefectType = PartyTypes.Victim,
                IsCivilRightProsecutor = _victim.IsCivilRightProsecutor,
                Presence = _vslog == null ? 0 :(PresenceStatus)_vslog.PresenceStatusID,
                JobName = _personVictim.JobTitle,
                NationalityType = _personVictim.NationalityID,
                PassportNumber = _personVictim.PassportNumber,
                Birthdate = _personVictim.Birthdate,
                Order = _victim.Order,
                Address = _personVictim.Address,
                Nationality = _personVictim.Configurations_Lookups.Name,
            }).ToList();

            return(victims);
        }
コード例 #3
0
        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";
                }
            }
        }
コード例 #4
0
        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;
        }
コード例 #5
0
        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;
        }
コード例 #6
0
        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;
        }
コード例 #7
0
        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);
        }