Exemplo n.º 1
0
 public int SetUserPermition(LoginOL setUSer)
 {
     using (IDbConnection db = new SqlConnection(dbConnection))
     {
         string sqlQuery     = "insert into Users(UserName,Password,IsDeleted,CreatedBy,CreatedDate)values('" + setUSer.username + "','" + setUSer.password.Trim() + "','0','" + setUSer.CreatedBy + "','" + DateTime.Now + "')";
         int    rowsAffected = db.Execute(sqlQuery, setUSer);
         return(rowsAffected);
     }
 }
Exemplo n.º 2
0
    public int SetUserPermition(LoginOL Users)
    {
        int rowAffected = new SetUserBL().setUSer(Users);

        if (rowAffected > 0)
        {
            return(rowAffected);
        }
        else
        {
            return(0);
        }
    }
Exemplo n.º 3
0
        public List <LoginOL> CheckLogin(string username, string password)
        {
            List <LoginOL> oblistol = new List <LoginOL>();
            sqlfunc        sqf      = new sqlfunc();

            sqf.cmd.CommandText = "CheckLogin";
            sqf.cmd.Parameters.AddWithValue("@UserName", username);
            sqf.cmd.Parameters.AddWithValue("@Password", password);
            DataTable      dt  = new DataTable();
            SqlDataAdapter adp = new SqlDataAdapter(sqf.cmd);

            adp.Fill(dt);
            if (dt.Rows.Count > 0)
            {
                LoginOL objlogin = new LoginOL();
                objlogin.username = dt.Rows[0]["UserName"].ToString();
                objlogin.password = dt.Rows[0]["Password"].ToString();
                oblistol.Add(objlogin);
            }
            sqf.Dispose();
            return(oblistol);
        }
Exemplo n.º 4
0
        public int setUSer(LoginOL setUser)
        {
            int rowAffected = new SetUserDL().SetUserPermition(setUser);

            return(rowAffected);
        }