コード例 #1
0
ファイル: UsersDAL.cs プロジェクト: smrgillani/smartAPIs
 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;
 }
コード例 #2
0
ファイル: UsersDAL.cs プロジェクト: smrgillani/smartAPIs
 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;
 }
コード例 #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);
        }
コード例 #4
0
ファイル: UsersDAL.cs プロジェクト: smrgillani/smartAPIs
 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);
 }
コード例 #5
0
ファイル: LogsDAL.cs プロジェクト: smrgillani/smartAPIs
        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);
        }