Exemplo n.º 1
0
 public Users getuserByUserName(Users u)
 {
     SqlCommand cmd = new SqlCommand("select List_User_Cred.loginattempts , List_Usr_Profile.* from List_User_Cred, List_Usr_Profile where List_User_Cred.username = @userName AND List_Usr_Profile.username = @userName ", DALUtil.getConnection());
     cmd.Parameters.AddWithValue("@userName", u.userName);
     List<Users> temp = fetchData(cmd);
     return (temp != null) ? temp[0] : null;
 }
Exemplo n.º 2
0
 public Users VerifyUserCredentials(Users u)
 {
     SqlCommand cmd = new SqlCommand("select List_User_Cred.loginattempts , List_Usr_Profile.* from List_User_Cred, List_Usr_Profile where List_User_Cred.username = @userName AND List_User_Cred.password = @passWord AND List_Usr_Profile.username = @userName ", DALUtil.getConnection());
     cmd.Parameters.AddWithValue("@userName", u.userName);
     cmd.Parameters.AddWithValue("@passWord", CryptoUtility.Encrypt(u.passWord));
     List<Users> temp = fetchData(cmd);
     return (temp != null) ? temp[0] : null;
 }
Exemplo n.º 3
0
        public ContentManagements GetTermConditionsAndPrivacyPolicy()
        {
            SqlCommand cmd = new SqlCommand("SELECT TOP 1 id, terms_and_conditions, privacy_and_policy FROM content_management", DALUtil.getConnection());
            List <ContentManagements> temp = fetchData(cmd);

            return((temp != null) ? temp[0] : null);
        }
Exemplo n.º 4
0
 public void UpdateLoginAttempts(string username, string atempt)
 {
     SqlCommand cmd = new SqlCommand("update List_User_Cred set loginattempts = @Atempt where username = @Username", DALUtil.getConnection());
     cmd.Parameters.AddWithValue("@Atempt", atempt);
     cmd.Parameters.AddWithValue("@Username", username);
     executeCommand(cmd);
 }
Exemplo n.º 5
0
        public void CreateLog(int cId, string dEscp, string eCode, string lOctn)
        {
            SqlCommand cmd = new SqlCommand("INSERT INTO [dbo].[LogReporting] ([categoryID],[description],[errorCode],[location],[createdOn]) VALUES (@Categoryid, @Description, @Errorcode, @Location, @Createdon)", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Categoryid", cId);
            cmd.Parameters.AddWithValue("@Description", dEscp);
            cmd.Parameters.AddWithValue("@Errorcode", eCode);
            cmd.Parameters.AddWithValue("@Location", lOctn);
            cmd.Parameters.AddWithValue("@Createdon", DateTime.Now.ToString("HH:mm:ss dd-MM-yyyy"));
            executeCommand(cmd);
        }